Commit 85a1c119 authored by Jeremy Fertic's avatar Jeremy Fertic Committed by Jonathan Cameron

staging: iio: adt7316: invert the logic of the check for an ldac pin

ADT7316_DA_EN_VIA_DAC_LDCA is set when the dac and ldac registers are being
used to update the dacs instead of the ldac pin. ADT7516_SEL_AIN3 is an adc
input that shares the ldac pin. Only set these bits if an ldac pin is not
being used.

This could be backported to stable, but note there are various
other bugs that probably make that a waste of time.
Signed-off-by: default avatarJeremy Fertic <jeremyfertic@gmail.com>
Fixes: 35f6b6b8 ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver")
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 53a6f022
...@@ -2130,7 +2130,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, ...@@ -2130,7 +2130,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,
return ret; return ret;
} }
if (chip->ldac_pin) { if (!chip->ldac_pin) {
chip->config3 |= ADT7316_DA_EN_VIA_DAC_LDCA; chip->config3 |= ADT7316_DA_EN_VIA_DAC_LDCA;
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX) if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
chip->config1 |= ADT7516_SEL_AIN3; chip->config1 |= ADT7516_SEL_AIN3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment