summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fertic <jeremyfertic@gmail.com>2018-12-12 01:54:59 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-12-16 15:05:55 +0100
commit5107d16e0aa4f56925c1627830c0e901782350df (patch)
treec7e9b2a183c09247226f5b4b3add7bf386446e94
parentstaging: iio: adt7316: invert the logic of the check for an ldac pin (diff)
downloadlinux-5107d16e0aa4f56925c1627830c0e901782350df.tar.xz
linux-5107d16e0aa4f56925c1627830c0e901782350df.zip
staging: iio: adt7316: use correct variable in DAC_internal_Vref read
The dac internal vref settings are part of the ldac config register rather than the dac config register. Change the variable being used so the read returns the correct result. Whilst a fix, it is for a driver in heavy churn so do not backport to stable without taking considerable care and testing. Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/staging/iio/addac/adt7316.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index e5e1f9d6357f..c1050dc678cf 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -1061,10 +1061,10 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev,
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
return sprintf(buf, "0x%x\n",
- (chip->dac_config & ADT7516_DAC_IN_VREF_MASK) >>
+ (chip->ldac_config & ADT7516_DAC_IN_VREF_MASK) >>
ADT7516_DAC_IN_VREF_OFFSET);
return sprintf(buf, "%d\n",
- !!(chip->dac_config & ADT7316_DAC_IN_VREF));
+ !!(chip->ldac_config & ADT7316_DAC_IN_VREF));
}
static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,