Skip to content
Commit 45130fb0 authored by Jeremy Fertic's avatar Jeremy Fertic Committed by Jonathan Cameron
Browse files

staging: iio: adt7316: fix the dac read calculation



The calculation of the current dac value is using the wrong bits of the
dac lsb register. Create two macros to shift the lsb register value into
lsb position, depending on whether the dac is 10 or 12 bit. Initialize
data to 0 so, with an 8 bit dac, the msb register value can be bitwise
ORed with data.

Fixes: 35f6b6b8 ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver")
Signed-off-by: default avatarJeremy Fertic <jeremyfertic@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 76b7fe8d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment