iio: light: bu27034: Fix scale format
authorMatti Vaittinen <mazziesaccount@gmail.com>
Tue, 13 Jun 2023 09:34:36 +0000 (12:34 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Jul 2023 17:02:02 +0000 (18:02 +0100)
commitd47b9b84292706784482a661324bbc178153781f
tree8e334b4198b4905afcbe47b145b186deb8366008
parent6bc471b6c3aeaa7b95d1b86a1bb8d91a3c341fa5
iio: light: bu27034: Fix scale format

The driver is expecting accuracy of NANOs for intensity scale in
raw_write. The IIO core is however defaulting to MICROs. This leads the
raw-write of smallest scales to never succeed as correct selector(s) are
not found.

Fix this by implementing the .write_raw_get_fmt callback to use NANO
accuracy for writes of IIO_CHAN_INFO_SCALE.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor")
Link: https://lore.kernel.org/r/5369117315cf05b88cf0ccb87373fd77190f6ca2.1686648422.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/rohm-bu27034.c