iio: light: bu27008: Fix scale format
authorMatti Vaittinen <mazziesaccount@gmail.com>
Tue, 13 Jun 2023 09:34:55 +0000 (12:34 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Jul 2023 17:02:02 +0000 (18:02 +0100)
commit096649cd7cb0fc1c8f684829f816d938ad1eb808
treef59977f848ce9745a2dabdb6352ebb8b9878aeb0
parentd47b9b84292706784482a661324bbc178153781f
iio: light: bu27008: 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.

Fixes: 41ff93d14f78 ("iio: light: ROHM BU27008 color sensor")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/e4778b74cde41431f77bc8dd88ec18605da0b400.1686648422.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/rohm-bu27008.c