iio: bu27034: Add a read only HARDWAREGAIN
authorMatti Vaittinen <mazziesaccount@gmail.com>
Fri, 5 Jul 2024 10:55:49 +0000 (13:55 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 09:13:35 +0000 (10:13 +0100)
commit06342d3f97fec858b8adb86bca59dbde82d0d0b3
treeff43a8c26a595e5d4bd966f518b34ce53c76dfa5
parenteb13959e2deac8b924cd663da8e564227d8b7184
iio: bu27034: Add a read only HARDWAREGAIN

The ROHM BU27034 light sensor has two data channels for measuring
different frequencies of light. The result from these channels is
combined into Lux value while the raw channel values are reported via
intensity channels.

Both of the intensity channels have adjustable gain setting which
impacts the scale of the raw channels. Eg, doubling the gain will double
the values read from the raw channels, which halves the scale value. The
integration time can also be set for the sensor. This does also have an
impact to the scale of the intensity channels because increasing the
integration time will also increase the values reported via the raw
channels.

Impact of integration time to the scale and the fact that the scale value
does not start from '1', can make it hard for a human reader to compute the
gain values based on the scale.

Add read-only HARDWAREGAIN to help debugging.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/ec349847cc994f3bd632e99b408a31e7c70581d0.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/rohm-bu27034.c