From: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx> According to the datasheet for all ad719x ADCs, the burnout currents can be enabled only if buffer is enabled and CHOP is disabled. So, if neither of these conditions are met, then we should disable the burnout currents in the driver as well, and warn the user. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx> --- drivers/staging/iio/adc/ad7192.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index d11c6de9c777..7f204013d6d4 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -266,6 +266,12 @@ static int ad7192_setup(struct ad7192_state *st, st->conf = AD7192_CONF_GAIN(0); + if (pdata->burnout_curr_en && (!pdata->buf_en || pdata->chop_en)) { + pdata->burnout_curr_en = false; + dev_warn(dev, + "Can't enable burnout currents: see CHOP or buffer\n"); + } + if (pdata->rej60_en) st->mode |= AD7192_MODE_REJ60; -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html