Re: [PATCH v7 4/5] iio: light: ROHM BU27034 Ambient Light Sensor

From: Vaittinen, Matti
Date: Wed Apr 12 2023 - 07:55:44 EST


On 4/10/23 13:38, Matti Vaittinen wrote:
> On 4/8/23 14:21, Jonathan Cameron wrote:
>> On Fri, 31 Mar 2023 15:41:58 +0300
>> Matti Vaittinen <mazziesaccount@xxxxxxxxx> wrote:
>>
>>> ROHM BU27034 is an ambient light sensor with 3 channels and 3 photo
>>> diodes
>>> capable of detecting a very wide range of illuminance. Typical
>>> application
>>> is adjusting LCD and backlight power of TVs and mobile phones.
>>>
>>> Add initial  support for the ROHM BU27034 ambient light sensor.
>>>
>>> NOTE:
>>>     - Driver exposes 4 channels. One IIO_LIGHT channel providing the
>>>       calculated lux values based on measured data from diodes #0 and
>>>       #1. In addition, 3 IIO_INTENSITY channels are emitting the raw
>>>       register data from all diodes for more intense user-space
>>>       computations.
>>>     - Sensor has GAIN values that can be adjusted from 1x to 4096x.
>>>     - Sensor has adjustible measurement times of 5, 55, 100, 200 and
>>>       400 mS. Driver does not support 5 mS which has special
>>>       limitations.
>>>     - Driver exposes standard 'scale' adjustment which is
>>>       implemented by:
>>>         1) Trying to adjust only the GAIN
>>>         2) If GAIN adjustment alone can't provide requested
>>>            scale, adjusting both the time and the gain is
>>>            attempted.
>>>     - Driver exposes writable INT_TIME property that can be used
>>>       for adjusting the measurement time. Time adjustment will also
>>>       cause the driver to try to adjust the GAIN so that the
>>>       overall scale is kept as close to the original as possible.
>>>
>>> Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>

As I wrote in the other (sysfs) mail - this driver version is buggy as
it handles INT_TIMEs in micro seconds. The correct unit would be seconds.

I'll send an incremental fix to this and the gts-helpers on top of the
iio/togreg (hopefully soon).

Yours,
-- Matti

--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~