Skip to contentSkip to conversation

Update APDS990x ALS to support device trees

PATCH Superseded Svyatoslav Ryhel 6 participants 19 messages Apr 19 – Apr 21

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Update APDS990x ALS to support device trees

Document Avago APDS9900/9901 ALS/Proximity sensor in schema and add its support to tsl2772 driver.

---
Changes in v2:
- dropped all previous patches
- apds990x was documented in tsl2772.yaml
- apds990x support was added to tsl2772.c
- original apds990x driver removed from misc
---

Svyatoslav Ryhel (3):
dt-bindings: iio: light: Document Avago APDS9900/9901 ALS/Proximity
sensor
iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor
misc: Remove old APDS990x driver

 .../bindings/iio/light/tsl2772.yaml           |    2 +
 Documentation/misc-devices/apds990x.rst       |  128 --
 drivers/iio/light/tsl2772.c                   |   16 +
 drivers/misc/Kconfig                          |   10 -
 drivers/misc/Makefile                         |    1 -
 drivers/misc/apds990x.c                       | 1284 -----------------
 include/linux/platform_data/apds990x.h        |   65 -
 7 files changed, 18 insertions(+), 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h
Signature · 1 line
2.51.0
#1 lore raw

PATCH v2 1/3 dt-bindings: iio: light: Document Avago APDS9900/9901 ALS/Proximity sensor

Document Avago APDS-9900/9901 combined ALS/IR-LED/Proximity sensor.

---
 Documentation/devicetree/bindings/iio/light/tsl2772.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/iio/light/tsl2772.yaml +2 -0
index d81229857944..9921ccaa64a0 100644
@@ -26,6 +26,8 @@ properties:
       - amstaos,tmd2672
       - amstaos,tsl2772
       - amstaos,tmd2772
+      - avago,apds9900
+      - avago,apds9901
       - avago,apds9930
 
   reg:
Signature · 1 line
2.51.0
#3 lore raw

PATCH v2 2/3 iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

In reply to Svyatoslav Ryhel

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +16 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
 	tmd2672,
 	tsl2772,
 	tmd2772,
+	apds990x,
 	apds9930,
 };
 
@@ -221,6 +222,12 @@ static const struct tsl2772_lux tmd2x72_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
 	{     0,      0 },
 };
 
+static const struct tsl2772_lux apds990x_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
+	{ 52000,  115960 },
+	{ 36400,   73840 },
+	{     0,       0 },
+};
+
 static const struct tsl2772_lux apds9930_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
 	{ 52000,  96824 },
 	{ 38792,  67132 },
@@ -238,6 +245,7 @@ static const struct tsl2772_lux *tsl2772_default_lux_table_group[] = {
 	[tmd2672] = tmd2x72_lux_table,
 	[tsl2772] = tsl2x72_lux_table,
 	[tmd2772] = tmd2x72_lux_table,
+	[apds990x] = apds990x_lux_table,
 	[apds9930] = apds9930_lux_table,
 };
 
@@ -289,6 +297,7 @@ static const int tsl2772_int_time_avail[][6] = {
 	[tmd2672] = { 0, 2730, 0, 2730, 0, 699000 },
 	[tsl2772] = { 0, 2730, 0, 2730, 0, 699000 },
 	[tmd2772] = { 0, 2730, 0, 2730, 0, 699000 },
+	[apds990x] = { 0, 2720, 0, 2720, 0, 696000 },
 	[apds9930] = { 0, 2730, 0, 2730, 0, 699000 },
 };
 
@@ -316,6 +325,7 @@ static const u8 device_channel_config[] = {
 	[tmd2672] = PRX2,
 	[tsl2772] = ALSPRX2,
 	[tmd2772] = ALSPRX2,
+	[apds990x] = ALSPRX,
 	[apds9930] = ALSPRX2,
 };
 
@@ -530,6 +540,7 @@ static int tsl2772_get_prox(struct iio_dev *indio_dev)
 	case tmd2672:
 	case tsl2772:
 	case tmd2772:
+	case apds990x:
 	case apds9930:
 		if (!(ret & TSL2772_STA_PRX_VALID)) {
 			ret = -EINVAL;
@@ -1367,6 +1378,7 @@ static int tsl2772_device_id_verif(int id, int target)
 		return (id & 0xf0) == TRITON_ID;
 	case tmd2671:
 	case tmd2771:
+	case apds990x:
 		return (id & 0xf0) == HALIBUT_ID;
 	case tsl2572:
 	case tsl2672:
@@ -1898,6 +1910,8 @@ static const struct i2c_device_id tsl2772_idtable[] = {
 	{ "tmd2672", tmd2672 },
 	{ "tsl2772", tsl2772 },
 	{ "tmd2772", tmd2772 },
+	{ "apds9900", apds990x },
+	{ "apds9901", apds990x },
 	{ "apds9930", apds9930 },
 	{ }
 };
@@ -1915,6 +1929,8 @@ static const struct of_device_id tsl2772_of_match[] = {
 	{ .compatible = "amstaos,tmd2672" },
 	{ .compatible = "amstaos,tsl2772" },
 	{ .compatible = "amstaos,tmd2772" },
+	{ .compatible = "avago,apds9900" },
+	{ .compatible = "avago,apds9901" },
 	{ .compatible = "avago,apds9930" },
 	{ }
 };
Signature · 1 line
2.51.0
maintainer
#4 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

Quoted 5 lines · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

Hi Svyatoslav,

Just one small thing.

Experience has given me a strong aversion to the use of wildcards in naming within drivers. They go wrong too often because companies can seem to resist using similar names for very different parts.

drivers/iio/light/tsl2772.c enum { · line 130

Quoted 13 lines
---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +1 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
 	tmd2672,
 	tsl2772,
 	tmd2772,
+	apds990x,

As above, just name this after one of the supported parts. apds9900 That doesn't stop you using it for multiple compatible devices.

Same applies for all the uses of x as a wildcard.

thanks,

Jonathan

Quoted 2 lines
drivers/iio/light/tsl2772.c +0 -0
 	apds9930,
 };
#5 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

нд, 19 квіт. 2026 р. о 14:30 Jonathan Cameron <[email protected]> пише:

Quoted 8 lines
Quoted 4 lines · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

Quoted 9 lines
Quoted 1 line

Hi Svyatoslav,

Just one small thing.

Experience has given me a strong aversion to the use of wildcards in naming within drivers. They go wrong too often because companies can seem to resist using similar names for very different parts.

Noted.

Quoted 17 lines

drivers/iio/light/tsl2772.c enum { · line 130

Quoted 13 lines
---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +1 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
      tmd2672,
      tsl2772,
      tmd2772,
+     apds990x,

As above, just name this after one of the supported parts. apds9900 That doesn't stop you using it for multiple compatible devices.

Quoted 2 lines

Same applies for all the uses of x as a wildcard.

If this is the only thing keeping you from picking this patchset may I resend with apds990x fixed right away?

Quoted 7 lines

thanks,

Jonathan

Quoted 2 lines
drivers/iio/light/tsl2772.c +0 -0
      apds9930,
 };
maintainer
#6 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

Quoted 38 lines · On Sun, 19 Apr 2026 14:50:55 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 14:30 Jonathan Cameron <[email protected]> пише:

Quoted 8 lines
Quoted 4 lines · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

Quoted 9 lines
Quoted 1 line

Hi Svyatoslav,

Just one small thing.

Experience has given me a strong aversion to the use of wildcards in naming within drivers. They go wrong too often because companies can seem to resist using similar names for very different parts.

Noted.

Quoted 17 lines

drivers/iio/light/tsl2772.c enum { · line 130

Quoted 13 lines
---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +1 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
      tmd2672,
      tsl2772,
      tmd2772,
+     apds990x,  

As above, just name this after one of the supported parts. apds9900 That doesn't stop you using it for multiple compatible devices.

Quoted 5 lines
Quoted 2 lines

Same applies for all the uses of x as a wildcard.

If this is the only thing keeping you from picking this patchset may I resend with apds990x fixed right away?

No. I'm just one reviewer - others may need more time. You should wait at least a few days before sending a new version unless I've specifically requested a rushed version.

I only do that if I'm trying to get something in at the end of a kernel cycle or there are dependencies on a patch from others. In this case, neither applies so please take your time. I'd normally suggest approximately a week.

Thanks,

Jonathan

Quoted 8 lines
Quoted 8 lines

thanks,

Jonathan

Quoted 2 lines
drivers/iio/light/tsl2772.c +0 -0
      apds9930,
 };  
maintainer
#7 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

In reply to Svyatoslav Ryhel
Quoted 1 line · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so

A Sashiko review comment makes me wonder about one thing below if the register set does match. Maybe it's a bit more subtle than this patch description suggests?

Quoted 50 lines

just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +9 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
 	tmd2672,
 	tsl2772,
 	tmd2772,
+	apds990x,
 	apds9930,
 };
 
@@ -221,6 +222,12 @@ static const struct tsl2772_lux tmd2x72_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
 	{     0,      0 },
 };
 
+static const struct tsl2772_lux apds990x_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
+	{ 52000,  115960 },
+	{ 36400,   73840 },
+	{     0,       0 },
+};
+
 static const struct tsl2772_lux apds9930_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
 	{ 52000,  96824 },
 	{ 38792,  67132 },
@@ -238,6 +245,7 @@ static const struct tsl2772_lux *tsl2772_default_lux_table_group[] = {
 	[tmd2672] = tmd2x72_lux_table,
 	[tsl2772] = tsl2x72_lux_table,
 	[tmd2772] = tmd2x72_lux_table,
+	[apds990x] = apds990x_lux_table,
 	[apds9930] = apds9930_lux_table,
 };
 
@@ -289,6 +297,7 @@ static const int tsl2772_int_time_avail[][6] = {
 	[tmd2672] = { 0, 2730, 0, 2730, 0, 699000 },
 	[tsl2772] = { 0, 2730, 0, 2730, 0, 699000 },
 	[tmd2772] = { 0, 2730, 0, 2730, 0, 699000 },
+	[apds990x] = { 0, 2720, 0, 2720, 0, 696000 },
 	[apds9930] = { 0, 2730, 0, 2730, 0, 699000 },
 };
 

drivers/iio/light/tsl2772.c static const u8 device_channel_config[] = { · line 328

Quoted 4 lines
drivers/iio/light/tsl2772.c +1 -0
@@ -316,6 +325,7 @@ static const u8 device_channel_config[] = {
 	[tmd2672] = PRX2,
 	[tsl2772] = ALSPRX2,
 	[tmd2772] = ALSPRX2,
+	[apds990x] = ALSPRX,

This is different from tsl2772?

Quoted 2 lines
drivers/iio/light/tsl2772.c +0 -0
 	[apds9930] = ALSPRX2,
 };
#8 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

нд, 19 квіт. 2026 р. о 16:38 Jonathan Cameron <[email protected]> пише:

Quoted 59 lines
Quoted 1 line · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so

A Sashiko review comment makes me wonder about one thing below if the register set does match. Maybe it's a bit more subtle than this patch description suggests?

Quoted 49 lines

just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +9 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
      tmd2672,
      tsl2772,
      tmd2772,
+     apds990x,
      apds9930,
 };
 
@@ -221,6 +222,12 @@ static const struct tsl2772_lux tmd2x72_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      {     0,      0 },
 };
 
+static const struct tsl2772_lux apds990x_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
+     { 52000,  115960 },
+     { 36400,   73840 },
+     {     0,       0 },
+};
+
 static const struct tsl2772_lux apds9930_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      { 52000,  96824 },
      { 38792,  67132 },
@@ -238,6 +245,7 @@ static const struct tsl2772_lux *tsl2772_default_lux_table_group[] = {
      [tmd2672] = tmd2x72_lux_table,
      [tsl2772] = tsl2x72_lux_table,
      [tmd2772] = tmd2x72_lux_table,
+     [apds990x] = apds990x_lux_table,
      [apds9930] = apds9930_lux_table,
 };
 
@@ -289,6 +297,7 @@ static const int tsl2772_int_time_avail[][6] = {
      [tmd2672] = { 0, 2730, 0, 2730, 0, 699000 },
      [tsl2772] = { 0, 2730, 0, 2730, 0, 699000 },
      [tmd2772] = { 0, 2730, 0, 2730, 0, 699000 },
+     [apds990x] = { 0, 2720, 0, 2720, 0, 696000 },
      [apds9930] = { 0, 2730, 0, 2730, 0, 699000 },
 };
 
Quoted 7 lines

drivers/iio/light/tsl2772.c static const u8 device_channel_config[] = { · line 328

Quoted 5 lines
drivers/iio/light/tsl2772.c +1 -0
@@ -316,6 +325,7 @@ static const u8 device_channel_config[] = {
      [tmd2672] = PRX2,
      [tsl2772] = ALSPRX2,
      [tmd2772] = ALSPRX2,
+     [apds990x] = ALSPRX,

This is different from tsl2772?

yes, lux table is different and made according to datasheet, tsl2772_int_time_avail differs, ALSPRX configuration assumes that proximity sensor needs no calibration which is true for apds9900/1 while tsl2772 needs calibration, device ID is different 0x20/0x29 for apds and 0x30 for tsl2772

Quoted 4 lines
Quoted 3 lines
drivers/iio/light/tsl2772.c +0 -0
      [apds9930] = ALSPRX2,
 };
maintainer
#9 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

Quoted 68 lines · On Sun, 19 Apr 2026 16:46:25 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:38 Jonathan Cameron <[email protected]> пише:

Quoted 59 lines
Quoted 1 line · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so

A Sashiko review comment makes me wonder about one thing below if the register set does match. Maybe it's a bit more subtle than this patch description suggests?

Quoted 49 lines

just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +9 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
      tmd2672,
      tsl2772,
      tmd2772,
+     apds990x,
      apds9930,
 };
 
@@ -221,6 +222,12 @@ static const struct tsl2772_lux tmd2x72_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      {     0,      0 },
 };
 
+static const struct tsl2772_lux apds990x_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
+     { 52000,  115960 },
+     { 36400,   73840 },
+     {     0,       0 },
+};
+
 static const struct tsl2772_lux apds9930_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      { 52000,  96824 },
      { 38792,  67132 },
@@ -238,6 +245,7 @@ static const struct tsl2772_lux *tsl2772_default_lux_table_group[] = {
      [tmd2672] = tmd2x72_lux_table,
      [tsl2772] = tsl2x72_lux_table,
      [tmd2772] = tmd2x72_lux_table,
+     [apds990x] = apds990x_lux_table,
      [apds9930] = apds9930_lux_table,
 };
 
@@ -289,6 +297,7 @@ static const int tsl2772_int_time_avail[][6] = {
      [tmd2672] = { 0, 2730, 0, 2730, 0, 699000 },
      [tsl2772] = { 0, 2730, 0, 2730, 0, 699000 },
      [tmd2772] = { 0, 2730, 0, 2730, 0, 699000 },
+     [apds990x] = { 0, 2720, 0, 2720, 0, 696000 },
      [apds9930] = { 0, 2730, 0, 2730, 0, 699000 },
 };
 
Quoted 7 lines

drivers/iio/light/tsl2772.c static const u8 device_channel_config[] = { · line 328

Quoted 5 lines
drivers/iio/light/tsl2772.c +1 -0
@@ -316,6 +325,7 @@ static const u8 device_channel_config[] = {
      [tmd2672] = PRX2,
      [tsl2772] = ALSPRX2,
      [tmd2772] = ALSPRX2,
+     [apds990x] = ALSPRX,  

This is different from tsl2772?

Quoted 5 lines

yes, lux table is different and made according to datasheet, tsl2772_int_time_avail differs, ALSPRX configuration assumes that proximity sensor needs no calibration which is true for apds9900/1 while tsl2772 needs calibration, device ID is different 0x20/0x29 for apds and 0x30 for tsl2772

All makes sense but that means the patch description needs to be more precise about what elements are compatible, or use vaguer wording like 'similar to'.

Jonathan

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
drivers/iio/light/tsl2772.c +0 -0
      [apds9930] = ALSPRX2,
 };  
#10 lore raw

Re: [PATCH v2 2/3] iio: tsl2772: add support for Avago APDS9900/9901 ALS/Proximity sensor

нд, 19 квіт. 2026 р. о 19:25 Jonathan Cameron <[email protected]> пише:

Quoted 78 lines
Quoted 68 lines · On Sun, 19 Apr 2026 16:46:25 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:38 Jonathan Cameron <[email protected]> пише:

Quoted 59 lines
Quoted 1 line · On Sun, 19 Apr 2026 11:31:23 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS990x has the same register set as the TAOS/AMS TSL2772 so

A Sashiko review comment makes me wonder about one thing below if the register set does match. Maybe it's a bit more subtle than this patch description suggests?

Quoted 49 lines

just add the correct bindings and the appropriate LUX table derived from the values in the datasheet. Driver was tested on the LG Optimus Vu P895.

---
 drivers/iio/light/tsl2772.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/iio/light/tsl2772.c +9 -0
index c8f15ba95267..8dab34bf00ca 100644
@@ -127,6 +127,7 @@ enum {
      tmd2672,
      tsl2772,
      tmd2772,
+     apds990x,
      apds9930,
 };
 
@@ -221,6 +222,12 @@ static const struct tsl2772_lux tmd2x72_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      {     0,      0 },
 };
 
+static const struct tsl2772_lux apds990x_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
+     { 52000,  115960 },
+     { 36400,   73840 },
+     {     0,       0 },
+};
+
 static const struct tsl2772_lux apds9930_lux_table[TSL2772_DEF_LUX_TABLE_SZ] = {
      { 52000,  96824 },
      { 38792,  67132 },
@@ -238,6 +245,7 @@ static const struct tsl2772_lux *tsl2772_default_lux_table_group[] = {
      [tmd2672] = tmd2x72_lux_table,
      [tsl2772] = tsl2x72_lux_table,
      [tmd2772] = tmd2x72_lux_table,
+     [apds990x] = apds990x_lux_table,
      [apds9930] = apds9930_lux_table,
 };
 
@@ -289,6 +297,7 @@ static const int tsl2772_int_time_avail[][6] = {
      [tmd2672] = { 0, 2730, 0, 2730, 0, 699000 },
      [tsl2772] = { 0, 2730, 0, 2730, 0, 699000 },
      [tmd2772] = { 0, 2730, 0, 2730, 0, 699000 },
+     [apds990x] = { 0, 2720, 0, 2720, 0, 696000 },
      [apds9930] = { 0, 2730, 0, 2730, 0, 699000 },
 };
 
Quoted 7 lines

drivers/iio/light/tsl2772.c static const u8 device_channel_config[] = { · line 328

Quoted 5 lines
drivers/iio/light/tsl2772.c +1 -0
@@ -316,6 +325,7 @@ static const u8 device_channel_config[] = {
      [tmd2672] = PRX2,
      [tsl2772] = ALSPRX2,
      [tmd2772] = ALSPRX2,
+     [apds990x] = ALSPRX,

This is different from tsl2772?

Quoted 5 lines

yes, lux table is different and made according to datasheet, tsl2772_int_time_avail differs, ALSPRX configuration assumes that proximity sensor needs no calibration which is true for apds9900/1 while tsl2772 needs calibration, device ID is different 0x20/0x29 for apds and 0x30 for tsl2772

Quoted 4 lines

All makes sense but that means the patch description needs to be more precise about what elements are compatible, or use vaguer wording like 'similar to'.

Fair, noted.

Quoted 9 lines

Jonathan

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
drivers/iio/light/tsl2772.c +0 -0
      [apds9930] = ALSPRX2,
 };
#11 lore raw

PATCH v2 3/3 misc: Remove old APDS990x driver

In reply to Svyatoslav Ryhel

The Avago APDS9900/9901 ALS/Proximity sensor is now supported by tsl2772 IIO driver so there is no need to keep this old implementation. Remove it.

---
 Documentation/misc-devices/apds990x.rst |  128 ---
 drivers/misc/Kconfig                    |   10 -
 drivers/misc/Makefile                   |    1 -
 drivers/misc/apds990x.c                 | 1284 -----------------------
 include/linux/platform_data/apds990x.h  |   65 --
 5 files changed, 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h
Documentation/misc-devices/apds990x.rst deleted +0 -128
deleted file mode 100644
index e2f75577f731..000000000000
@@ -1,128 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-======================
-Kernel driver apds990x
-======================
-
-Supported chips:
-Avago APDS990X
-
-Data sheet:
-Not freely available
-
-Author:
-Samu Onkalo <[email protected]>
-
-Description
------------
-
-APDS990x is a combined ambient light and proximity sensor. ALS and proximity
-functionality are highly connected. ALS measurement path must be running
-while the proximity functionality is enabled.
-
-ALS produces raw measurement values for two channels: Clear channel
-(infrared + visible light) and IR only. However, threshold comparisons happen
-using clear channel only. Lux value and the threshold level on the HW
-might vary quite much depending the spectrum of the light source.
-
-Driver makes necessary conversions to both directions so that user handles
-only lux values. Lux value is calculated using information from the both
-channels. HW threshold level is calculated from the given lux value to match
-with current type of the lightning. Sometimes inaccuracy of the estimations
-lead to false interrupt, but that doesn't harm.
-
-ALS contains 4 different gain steps. Driver automatically
-selects suitable gain step. After each measurement, reliability of the results
-is estimated and new measurement is triggered if necessary.
-
-Platform data can provide tuned values to the conversion formulas if
-values are known. Otherwise plain sensor default values are used.
-
-Proximity side is little bit simpler. There is no need for complex conversions.
-It produces directly usable values.
-
-Driver controls chip operational state using pm_runtime framework.
-Voltage regulators are controlled based on chip operational state.
-
-SYSFS
------
-
-
-chip_id
-	RO - shows detected chip type and version
-
-power_state
-	RW - enable / disable chip. Uses counting logic
-
-	     1 enables the chip
-	     0 disables the chip
-lux0_input
-	RO - measured lux value
-
-	     sysfs_notify called when threshold interrupt occurs
-
-lux0_sensor_range
-	RO - lux0_input max value.
-
-	     Actually never reaches since sensor tends
-	     to saturate much before that. Real max value varies depending
-	     on the light spectrum etc.
-
-lux0_rate
-	RW - measurement rate in Hz
-
-lux0_rate_avail
-	RO - supported measurement rates
-
-lux0_calibscale
-	RW - calibration value.
-
-	     Set to neutral value by default.
-	     Output results are multiplied with calibscale / calibscale_default
-	     value.
-
-lux0_calibscale_default
-	RO - neutral calibration value
-
-lux0_thresh_above_value
-	RW - HI level threshold value.
-
-	     All results above the value
-	     trigs an interrupt. 65535 (i.e. sensor_range) disables the above
-	     interrupt.
-
-lux0_thresh_below_value
-	RW - LO level threshold value.
-
-	     All results below the value
-	     trigs an interrupt. 0 disables the below interrupt.
-
-prox0_raw
-	RO - measured proximity value
-
-	     sysfs_notify called when threshold interrupt occurs
-
-prox0_sensor_range
-	RO - prox0_raw max value (1023)
-
-prox0_raw_en
-	RW - enable / disable proximity - uses counting logic
-
-	     - 1 enables the proximity
-	     - 0 disables the proximity
-
-prox0_reporting_mode
-	RW - trigger / periodic.
-
-	     In "trigger" mode the driver tells two possible
-	     values: 0 or prox0_sensor_range value. 0 means no proximity,
-	     1023 means proximity. This causes minimal number of interrupts.
-	     In "periodic" mode the driver reports all values above
-	     prox0_thresh_above. This causes more interrupts, but it can give
-	     _rough_ estimate about the distance.
-
-prox0_reporting_mode_avail
-	RO - accepted values to prox0_reporting_mode (trigger, periodic)
-
-prox0_thresh_above_value
-	RW - threshold level which trigs proximity events.
drivers/misc/Kconfig +0 -10
index 8cbd71a0dc35..051cf2c44b90 100644
@@ -392,16 +392,6 @@ config SENSORS_BH1770
 	   To compile this driver as a module, choose M here: the
 	   module will be called bh1770glc. If unsure, say N here.
 
-config SENSORS_APDS990X
-	 tristate "APDS990X combined als and proximity sensors"
-	 depends on I2C
-	help
-	   Say Y here if you want to build a driver for Avago APDS990x
-	   combined ambient light and proximity sensor chip.
-
-	   To compile this driver as a module, choose M here: the
-	   module will be called apds990x. If unsure, say N here.
-
 config HMC6352
 	tristate "Honeywell HMC6352 compass"
 	depends on I2C
drivers/misc/Makefile +0 -1
index 62c3d03206e9..bfad6982591c 100644
@@ -20,7 +20,6 @@ obj-$(CONFIG_RPMB)		+= rpmb-core.o
 obj-$(CONFIG_QCOM_COINCELL)	+= qcom-coincell.o
 obj-$(CONFIG_QCOM_FASTRPC)	+= fastrpc.o
 obj-$(CONFIG_SENSORS_BH1770)	+= bh1770glc.o
-obj-$(CONFIG_SENSORS_APDS990X)	+= apds990x.o
 obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
 obj-$(CONFIG_KGDB_TESTS)	+= kgdbts.o
 obj-$(CONFIG_SGI_XP)		+= sgi-xp/
drivers/misc/apds990x.c deleted +0 -1284

1,284 lines not on this page · raw message

include/linux/platform_data/apds990x.h deleted +0 -65

65 lines not on this page · raw message

Signature · 1 line
2.51.0
maintainer Acked-by on v2 3/3
#12 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

Quoted 4 lines · Svyatoslav Ryhel

The Avago APDS9900/9901 ALS/Proximity sensor is now supported by tsl2772 IIO driver so there is no need to keep this old implementation. Remove it.

Quoted 10 lines
---
 Documentation/misc-devices/apds990x.rst |  128 ---
 drivers/misc/Kconfig                    |   10 -
 drivers/misc/Makefile                   |    1 -
 drivers/misc/apds990x.c                 | 1284 -----------------------
 include/linux/platform_data/apds990x.h  |   65 --
 5 files changed, 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h
maintainer
#13 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

In reply to Svyatoslav Ryhel
Quoted 6 lines · On Sun, 19 Apr 2026 11:31:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS9900/9901 ALS/Proximity sensor is now supported by tsl2772 IIO driver so there is no need to keep this old implementation. Remove it.

---
 Documentation/misc-devices/apds990x.rst |  128 ---

Sashiko AI reviewing is now running on anything that hits [email protected]

I'm slowly getting into the habit of checking out what it finds though I'm 500+ emails behind so it might not be that thorough today :*

Anyhow, it caught an easy one here.

This file is referenced from Documentation/misc-devices/index.rst so that needs an update as well.

There is the obvious point of ABI compatibility raised as well, but given we don't seem to be getting much push back on that maybe that's not a significant concern.

Jonathan

Quoted 8 lines
 drivers/misc/Kconfig                    |   10 -
 drivers/misc/Makefile                   |    1 -
 drivers/misc/apds990x.c                 | 1284 -----------------------
 include/linux/platform_data/apds990x.h  |   65 --
 5 files changed, 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h
#14 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

нд, 19 квіт. 2026 р. о 16:33 Jonathan Cameron <[email protected]> пише:

Quoted 12 lines
Quoted 6 lines · On Sun, 19 Apr 2026 11:31:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS9900/9901 ALS/Proximity sensor is now supported by tsl2772 IIO driver so there is no need to keep this old implementation. Remove it.

---
 Documentation/misc-devices/apds990x.rst |  128 ---

Sashiko AI reviewing is now running on anything that hits [email protected]

Quoted 8 lines

I'm slowly getting into the habit of checking out what it finds though I'm 500+ emails behind so it might not be that thorough today :*

Anyhow, it caught an easy one here.

This file is referenced from Documentation/misc-devices/index.rst so that needs an update as well.

Good catch, index was not updated, I will do so in v3.

Quoted 3 lines

There is the obvious point of ABI compatibility raised as well, but given we don't seem to be getting much push back on that maybe that's not a significant concern.

I did not found any ABI in the Documentation/ABI regarding this sensor using grep, maybe you are more familiar?

Quoted 11 lines

Jonathan

Quoted 8 lines
 drivers/misc/Kconfig                    |   10 -
 drivers/misc/Makefile                   |    1 -
 drivers/misc/apds990x.c                 | 1284 -----------------------
 include/linux/platform_data/apds990x.h  |   65 --
 5 files changed, 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h
maintainer
#15 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

Quoted 22 lines · On Sun, 19 Apr 2026 16:41:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:33 Jonathan Cameron <[email protected]> пише:

Quoted 12 lines
Quoted 6 lines · On Sun, 19 Apr 2026 11:31:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

The Avago APDS9900/9901 ALS/Proximity sensor is now supported by tsl2772 IIO driver so there is no need to keep this old implementation. Remove it.

---
 Documentation/misc-devices/apds990x.rst |  128 ---  

Sashiko AI reviewing is now running on anything that hits [email protected]

Quoted 8 lines

I'm slowly getting into the habit of checking out what it finds though I'm 500+ emails behind so it might not be that thorough today :*

Anyhow, it caught an easy one here.

This file is referenced from Documentation/misc-devices/index.rst so that needs an update as well.

Quoted 8 lines

Good catch, index was not updated, I will do so in v3.

Quoted 3 lines

There is the obvious point of ABI compatibility raised as well, but given we don't seem to be getting much push back on that maybe that's not a significant concern.

I did not found any ABI in the Documentation/ABI regarding this sensor using grep, maybe you are more familiar?

Doesn't matter if it's documented explicitly (many older drivers are not). The question is whether anyone has supported parts and userspace code that makes use of the sysfs files this driver provides.

Their userspace will be broken by dropping it. The lack of upstream users makes this less critical but it can be argued it's still a possible regression.

Jonathan

Quoted 12 lines
Quoted 12 lines

Jonathan

Quoted 8 lines
 drivers/misc/Kconfig                    |   10 -
 drivers/misc/Makefile                   |    1 -
 drivers/misc/apds990x.c                 | 1284 -----------------------
 include/linux/platform_data/apds990x.h  |   65 --
 5 files changed, 1488 deletions(-)
 delete mode 100644 Documentation/misc-devices/apds990x.rst
 delete mode 100644 drivers/misc/apds990x.c
 delete mode 100644 include/linux/platform_data/apds990x.h  
#16 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

Quoted 5 lines · Jonathan Cameron
Quoted 3 lines · On Sun, 19 Apr 2026 16:41:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:33 Jonathan Cameron <[email protected]> пише:

Quoted 2 lines

On Sun, 19 Apr 2026 11:31:24 +0300
Svyatoslav Ryhel <[email protected]> wrote:

...

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

There is the obvious point of ABI compatibility raised as well, but given we don't seem to be getting much push back on that maybe that's not a significant concern.

I did not found any ABI in the Documentation/ABI regarding this sensor using grep,

The code is what is in use, it has an ABI. The question if it's in use or not.

Quoted 8 lines
Quoted 1 line

maybe you are more familiar?

Doesn't matter if it's documented explicitly (many older drivers are not). The question is whether anyone has supported parts and userspace code that makes use of the sysfs files this driver provides.

Their userspace will be broken by dropping it. The lack of upstream users makes this less critical but it can be argued it's still a possible regression.

Usual recommendation is to google, and check Debian code search engine. I randomly chose a couple of sysfs nodes and only kernel code refers to them. So, at least there is a good sign that it likely not in use. But one has to perform more checks (all attributes, more sources of information) and summarise that in the commit message.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#17 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Jonathan Cameron
Quoted 1 line · On Sun, 19 Apr 2026 16:41:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:33 Jonathan Cameron <[email protected]> пише:

Quoted 8 lines
Quoted 2 lines

Their userspace will be broken by dropping it. The lack of upstream users makes this less critical but it can be argued it's still a possible regression.

Usual recommendation is to google, and check Debian code search engine. I randomly chose a couple of sysfs nodes and only kernel code refers to them. So, at least there is a good sign that it likely not in use. But one has to perform more checks (all attributes, more sources of information) and summarise that in the commit message.

I think in this case it's sufficient to point out that there is no devicetree support in the driver, and no pre-DT board file ever declared a platform_device with apds990x_platform_data in mainline kernels. The ambient light sensor drivers in drivers/misc/ were all added in before the change from boardfile to DT, and from custom ABI to drivers/iio.

Arnd

#18 lore raw

Re: [PATCH v2 3/3] misc: Remove old APDS990x driver

Quoted 14 lines · Arnd Bergmann
Quoted 4 lines · Andy Shevchenko
Quoted 2 lines · Jonathan Cameron
Quoted 1 line · On Sun, 19 Apr 2026 16:41:24 +0300 Svyatoslav Ryhel <[email protected]> wrote:

нд, 19 квіт. 2026 р. о 16:33 Jonathan Cameron <[email protected]> пише:

Quoted 8 lines
Quoted 2 lines

Their userspace will be broken by dropping it. The lack of upstream users makes this less critical but it can be argued it's still a possible regression.

Usual recommendation is to google, and check Debian code search engine. I randomly chose a couple of sysfs nodes and only kernel code refers to them. So, at least there is a good sign that it likely not in use. But one has to perform more checks (all attributes, more sources of information) and summarise that in the commit message.

Quoted 6 lines

I think in this case it's sufficient to point out that there is no devicetree support in the driver, and no pre-DT board file ever declared a platform_device with apds990x_platform_data in mainline kernels. The ambient light sensor drivers in drivers/misc/ were all added in before the change from boardfile to DT, and from custom ABI to drivers/iio.

Works for me. I am all for removing old and legacy (especially non-FW node compatible) code.

Signature · 2 lines
With Best Regards,
Andy Shevchenko