linux/drivers/staging/iio
Jeremy Fertic 76b7fe8d6c staging: iio: adt7316: fix handling of dac high resolution option
The adt7316/7 and adt7516/7 have the option to output voltage proportional
to temperature on dac a and/or dac b. The default dac resolution in this
mode is 8 bits with the dac high resolution option enabling 10 bits. None
of these settings affect dacs c and d. Remove the "1 (12 bits)" output from
the show function since that is not an option for this mode. Return
"1 (10 bits)" if the device is one of the above mentioned chips and the dac
high resolution mode is enabled.

In the store function, the driver currently allows the user to write to the
ADT7316_DA_HIGH_RESOLUTION bit regardless of the device in use. Add a check
to return an error in the case of an adt7318 or adt7519. Remove the else
statement that clears the ADT7316_DA_HIGH_RESOLUTION bit. Instead, clear it
before conditionally enabling it, depending on user input. This matches the
typical pattern in the driver when an attribute is a boolean.

Fixes: 35f6b6b86e ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver")
Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-05 17:52:17 +00:00
..
accel staging:iio:accel:adis16240: sign extend function replace hard code duplication 2018-06-24 14:45:06 +01:00
adc staging: iio: adc: ad7606: Move out of staging 2019-01-05 16:10:59 +00:00
addac staging: iio: adt7316: fix handling of dac high resolution option 2019-01-05 17:52:17 +00:00
cdc staging: iio: cdc: ad7150: fix misaligned lines 2018-10-07 20:08:04 +01:00
Documentation staging:iio:docs: drop setting of THIS_MODULE from staging docs. 2017-09-03 18:10:28 +01:00
frequency drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
impedance-analyzer staging: iio: ad5933: use clock framework for clock reference 2018-12-16 14:05:56 +00:00
meter staging:iio:meter: Drop ADE7759 driver 2018-05-20 12:21:54 +01:00
resolver staging:iio:ad2s90: Move out of staging 2018-12-01 15:40:39 +00:00
Kconfig staging: iio: Drop ADIS16060 driver from staging 2018-06-10 11:52:31 +01:00
Makefile staging: iio: Drop ADIS16060 driver from staging 2018-06-10 11:52:31 +01:00
TODO staging: iio: Augment TODO file with GPIO work item 2018-04-23 14:36:10 +02:00