Re: [PATCH v1 0/5] Update APDS990x ALS to support device trees
From: David Lechner
Date: Sat Apr 18 2026 - 18:20:45 EST
On 4/18/26 2:48 PM, Svyatoslav Ryhel wrote:
> сб, 18 квіт. 2026 р. о 19:24 David Lechner <dlechner@xxxxxxxxxxxx> пише:
>>
>> On 4/18/26 9:47 AM, Svyatoslav Ryhel wrote:
>>> Document Avago APDS9900/9901 ALS/Proximity sensor in schema and modernize
>>> its driver to support OF bindings.
>>>
>>> Svyatoslav Ryhel (5):
>>> dt-bindings: iio: light: Document Avago APDS9900/9901 ALS/Proximity
>>> sensor
>>> misc: apds990x: Use more device managed approach in the probe
>>> misc: apds990x: Drop Vled supply
>>> misc: apds990x: Convert to use OF bindings
>>> misc: apds990x: Drop IRQF_TRIGGER_LOW trigger
>>>
>>> .../bindings/iio/light/avago,apds9900.yaml | 83 ++++++++
>>> drivers/misc/apds990x.c | 197 +++++++++---------
>>
>> As mentioned in my reply to the dt-bindings patch, there is already an
>> IIO driver that looks like it could be compatible. I'm guessing that
>> this misc driver pre-dates the IIO subsystem. I would have a look at it
>> instead (drivers/iio/light/tsl2772.c).
>>
>
> tsl2772 driver fits, thanks for pointing out. Maybe you know how
> apds9930 lux table was calculated? It is quite obscure to me.
The tsl2772 driver says:
/*
* Different devices require different coefficents, and these numbers were
* derived from the 'Lux Equation' section of the various device datasheets.
* All of these coefficients assume a Glass Attenuation (GA) factor of 1.
* The coefficients are multiplied by 1000 to avoid floating point operations.
* The two rows in each table correspond to the Lux1 and Lux2 equations from
* the datasheets.
*/
So probably just need to look up the A tsl datasheet and compare it to the
apds datasheet. The apds has some equations with GA, so just need to figure
out what Lux1 and Lux2 correspond to.
>
> Obviously this patchset is obsolete and different set of changes is required.
>
>>> include/linux/platform_data/apds990x.h | 65 ------
>>> 3 files changed, 187 insertions(+), 158 deletions(-)
>>> create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9900.yaml
>>> delete mode 100644 include/linux/platform_data/apds990x.h
>>>
>>