linux/drivers/staging
Jeremy Fertic e9de475723 staging: iio: adt7316: fix dac_bits assignment
The value of dac_bits is used in adt7316_show_DAC() and adt7316_store_DAC(),
and it should be either 8, 10, or 12 bits depending on the device in use. The
driver currently only assigns a value to dac_bits in
adt7316_store_da_high_resolution(). The purpose of the dac high resolution
option is not to change dac resolution for normal operation. Instead, it
is specific to an optional feature where one or two of the four dacs can
be set to output voltage proportional to temperature. If the user chooses
to set dac a and/or dac b to output voltage proportional to temperature,
the da_high_resolution attribute can optionally be enabled to use 10 bit
resolution rather than the default 8 bits. This is only available on the
10 and 12 bit dac devices. If the user attempts to read or write dacs a
or b under these settings, the driver's current behaviour is to return an
error. Dacs c and d continue to operate normally under these conditions.
With the above in mind, remove the dac_bits assignments from this function
since the value of dac_bits as used in the driver is not dependent on this
dac high resolution option.

Since the dac_bits assignments discussed above are currently the only ones
in this driver, the default value of dac_bits is 0. This results in incorrect
calculations when the dacs are read or written in adt7316_show_DAC() and
adt7316_store_DAC(). To correct this, assign a value to dac_bits in
adt7316_probe() to ensure correct operation as soon as the device is
registered and available to userspace.

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:48:39 +00:00
..
android staging: android: ion: Remove unused header files 2018-12-05 09:39:45 +01:00
axis-fifo staging: axis-fifo: Split line to stay in 80 characters. 2018-11-20 10:59:30 +01:00
board
clocking-wizard staging: clocking-wizard: match parenthesis indentation 2018-10-09 14:57:33 +02:00
comedi staging: comedi: change do_insn*_ioctl to allow more samples 2018-12-12 11:37:58 +01:00
emxx_udc staging: emxx_udc: Remove cast and move all in one line. 2018-12-05 09:44:10 +01:00
erofs staging: erofs: Fix spelling issue 2018-12-12 11:30:05 +01:00
fbtft staging: fbtft: Prefer using the BIT macro 2018-10-03 11:36:08 -07:00
fsl-dpaa2 Staging/IIO patches for 4.20-rc1 2018-10-29 10:38:10 -07:00
fwserial fwserial: switch to ->[sg]et_serial() 2018-09-14 11:19:47 -04:00
gasket staging: gasket: formatting fixes 2018-11-12 14:43:15 -08:00
gdm724x
goldfish staging: goldfish: Add SPDX license identifier. 2018-11-07 12:27:33 +01:00
greybus staging: greybus: Added space between string concatenated 2018-12-05 09:47:02 +01:00
gs_fpgaboot
iio staging: iio: adt7316: fix dac_bits assignment 2019-01-05 17:48:39 +00:00
ks7010 staging: ks7010: remove unnecessary blank line 2018-11-07 12:35:10 +01:00
media Merge 4.20-rc6 into staging-next 2018-12-10 09:23:50 +01:00
most staging: most: use format specifier "%s" in snprintf 2018-11-09 04:34:12 -08:00
mt29f_spinand mtd: rawnand: Deprecate ->{set,get}_features() hooks 2018-10-03 11:12:25 +02:00
mt7621-dma Merge 4.20-rc5 into staging-next 2018-12-03 07:55:28 +01:00
mt7621-dts staging: mt7621-dts: avoid warnings in pinctrl definitions 2018-12-12 11:55:39 +01:00
mt7621-eth staging: mt7621-eth: fix compile warning. 2018-12-12 11:55:39 +01:00
mt7621-mmc staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.c 2018-12-12 11:57:41 +01:00
mt7621-pci staging: mt7621-pci: add comment clarifying inverted reset lines 2018-12-05 09:39:45 +01:00
mt7621-pinctrl staging: mt7621-pinctrl: fix uninitialized variable ngroups 2018-11-11 11:47:38 -08:00
mt7621-spi staging: mt7621-spi: drop support for SPI mode 1/2/3 2018-12-12 11:34:53 +01:00
netlogic
nvec
octeon staging: octeon-ethernet: delete redundant include 2018-12-06 16:12:49 +01:00
octeon-usb staging: octeon-usb: use a helper function to set the DMA mask 2018-12-05 09:47:02 +01:00
olpc_dcon staging: olpc_dcon: olpc_dcon_xo_1.c: Switch to the gpio descriptor interface 2018-11-08 03:59:47 -08:00
pi433 staging: pi433: add missing call to cdev_del() 2018-12-05 09:39:45 +01:00
rtl8188eu staging: rtl8188eu: reuse Hal_GetChnlGroup88E() 2018-12-12 11:37:58 +01:00
rtl8192e staging: rtl8192e: Add SPDX-License-Identifier - Style 2018-11-05 14:16:33 +01:00
rtl8192u staging: rtl8192u: rename struct name _rt_firmare_seg_container 2018-11-07 12:35:10 +01:00
rtl8712 Merge 4.20-rc6 into staging-next 2018-12-10 09:23:50 +01:00
rtl8723bs staging: rtl8723bs: remove semaphore remnants 2018-12-12 11:50:46 +01:00
rtlwifi staging: rtlwifi: fix spelling mistake "disnabled" -> "disabled" 2018-12-05 09:39:45 +01:00
rts5208 Staging: rts5208: Capitalise preprocessor variable names 2018-11-05 14:16:33 +01:00
sm750fb staging: sm750fb: Add spaces around '+' 2018-11-07 12:35:10 +01:00
speakup staging: speakup: change semaphore to completion 2018-12-12 11:31:14 +01:00
unisys
vboxvideo staging: vboxvideo: Rename uint32_t type to u32 2018-11-23 10:58:47 +01:00
vc04_services staging: bcm2835-camera: Add hint about possible faulty config 2018-12-12 11:56:47 +01:00
vme
vt6655 staging: vt6655: fix small typo 2018-11-07 13:07:26 +01:00
vt6656
wilc1000 staging: wilc1000: correct inconsistent indenting 2018-12-05 09:51:15 +01:00
wlan-ng staging: wlan-ng: remove unused variable in prism2fw.c 2018-11-20 10:59:30 +01:00
xgifb staging: xgifb: clean an indentation issue 2018-11-07 12:35:10 +01:00
Kconfig staging: dgnc: delete the driver 2018-10-02 15:14:14 -07:00
Makefile staging: dgnc: delete the driver 2018-10-02 15:14:14 -07:00