]> git.baikalelectronics.ru Git - kernel.git/commit
iio: si1133: read 24-bit signed integer for measurement
authorMaxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Wed, 19 Feb 2020 17:40:08 +0000 (12:40 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Mar 2020 17:28:42 +0000 (17:28 +0000)
commite67702f397f3a99a4ae66016c76a7f010299d4ad
treea58ff8d7e0daa749f38bc74f2b5366bb41b05f21
parentd52a73e035ab68cd1abebc71819fd1bdf6727680
iio: si1133: read 24-bit signed integer for measurement

The chip is configured in 24 bit mode. The values read from
it must always be treated as is. This fixes the issue by
replacing the previous 16 bits value by a 24 bits buffer.

This changes affects the value output by previous version of
the driver, since the least significant byte was missing.
The upper half of 16 bit values previously output are now
the upper half of a 24 bit value.

Fixes: 13e7dabc4c37 ("iio: light: introduce si1133")
Reported-by: Simon Goyette <simon.goyette@gmail.com>
Co-authored-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/si1133.c