Skip to contentSkip to conversation

iio: chemical: add SGP41 driver

PATCH In review Akshat Chandra 5 participants 7 messages Aug 31 – Oct 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: chemical: add SGP41 driver

---
 .../devicetree/bindings/trivial-devices.yaml  |   2 +
 drivers/iio/chemical/Kconfig                  |  11 +
 drivers/iio/chemical/Makefile                 |   1 +
 drivers/iio/chemical/sgp41.c                  | 384 ++++++++++++++++++
 4 files changed, 398 insertions(+)
 create mode 100644 drivers/iio/chemical/sgp41.c
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index 2de8eb09c..c3b51d8ee 100644
@@ -420,6 +420,8 @@ properties:
           - sensirion,sgp30
             # Sensirion gas sensor with I2C interface
           - sensirion,sgp40
+            # Sensirion gas sensor with I2C interface
+          - sensirion,sgp41
             # Sensirion low power multi-pixel gas sensor with I2C interface
           - sensirion,sgpc3
             # Sensirion temperature & humidity sensor with I2C interface
drivers/iio/chemical/Kconfig +11 -0
index b22afa1f6..cbb6a51b1 100644
@@ -210,6 +210,17 @@ config SENSIRION_SGP40
 	  To compile this driver as module, choose M here: the
 	  module will be called sgp40.
 
+config SENSIRION_SGP41
+	tristate "Sensirion SGP41 gas sensor"
+	depends on I2C
+	select CRC8
+	help
+	  Say Y here to build I2C interface to support Sensirion SGP41 gas
+	  sensor
+
+	  To compile this driver as module, choose M here: the
+	  module will be called sgp41.
+
 config SPS30
 	tristate
 	select IIO_BUFFER
drivers/iio/chemical/Makefile +1 -0
index 2287a00a6..90041aaa4 100644
@@ -25,6 +25,7 @@ obj-$(CONFIG_SEN0322)	+= sen0322.o
 obj-$(CONFIG_SENSEAIR_SUNRISE_CO2) += sunrise_co2.o
 obj-$(CONFIG_SENSIRION_SGP30)	+= sgp30.o
 obj-$(CONFIG_SENSIRION_SGP40)	+= sgp40.o
+obj-$(CONFIG_SENSIRION_SGP41)	+= sgp41.o
 obj-$(CONFIG_SPS30) += sps30.o
 obj-$(CONFIG_SPS30_I2C) += sps30_i2c.o
 obj-$(CONFIG_SPS30_SERIAL) += sps30_serial.o
drivers/iio/chemical/sgp41.c new file +384 -0

384 lines not on this page · raw message

Signature · 1 line
2.53.0
#1 lore raw

On Mon, Aug 31, 2026 at 08:42:35PM +0530, Akshat Chandra wrote:

NO, we do not accept this.
Please, try to read kernel documentation and follow it. This patch is far from the kernel standards, sorry.

I would recommend to also read others' emails in the mailing list (linux-iio@) along with the code of recently accepted drivers (can be found in v7.3-rc1) that follow (more or less) the standards we require.

Quoted 1 line
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Akshat Chandra
Quoted 9 lines · On Mon, 31 Aug 2026 20:42:35 +0530 Akshat Chandra <[email protected]> wrote:
---
 .../devicetree/bindings/trivial-devices.yaml  |   2 +
 drivers/iio/chemical/Kconfig                  |  11 +
 drivers/iio/chemical/Makefile                 |   1 +
 drivers/iio/chemical/sgp41.c                  | 384 ++++++++++++++++++
 4 files changed, 398 insertions(+)
 create mode 100644 drivers/iio/chemical/sgp41.c

Not only you're missing a commit message, you're also missing a MAINTAINERS entry and a dt-bindings entry! Please fix this! (Note, the dt-bindings and MAINTAINERS entry should go together in one patch, preferrably first in the series).

Signature · 2 lines
Kind regards,
Joshua Crofts
maintainer
#3 lore raw
Quoted 13 lines · On Mon, 31 Aug 2026 23:21:57 +0200 Joshua Crofts <[email protected]>…
Quoted 9 lines · On Mon, 31 Aug 2026 20:42:35 +0530 Akshat Chandra <[email protected]> wrote:
---
 .../devicetree/bindings/trivial-devices.yaml  |   2 +
 drivers/iio/chemical/Kconfig                  |  11 +
 drivers/iio/chemical/Makefile                 |   1 +
 drivers/iio/chemical/sgp41.c                  | 384 ++++++++++++++++++
 4 files changed, 398 insertions(+)
 create mode 100644 drivers/iio/chemical/sgp41.c
Quoted 5 lines

Not only you're missing a commit message, you're also missing a MAINTAINERS entry and a dt-bindings entry! Please fix this! (Note, the dt-bindings and MAINTAINERS entry should go together in one patch, preferrably first in the series).

Whilst it should be a separate patch, the route here to use trivial-devices might make sense. Only thing that might be worth documenting would be vdd-supply.

I'm would be looking for description in the cover letter of how this is different from, and not suited to extension of another drive such as the sgp40 (obviously there are more channels on one than the other so it isn't trivial!)

Jonathan

#4 lore raw
Quoted 10 lines · Jonathan Cameron

Whilst it should be a separate patch, the route here to use trivial-devices might make sense. Only thing that might be worth documenting would be vdd-supply.

I'm would be looking for description in the cover letter of how this is different from, and not suited to extension of another drive such as the sgp40 (obviously there are more channels on one than the other so it isn't trivial!)

Jonathan

Hi Akshat,

I'd like to pick up SGP41 support, taking the approach Jonathan suggested above and extending the sgp40 driver rather than adding a separate one. I have SGP40 and SGP41 boards on the way for testing.

Unless you already have a v2 close to ready, I plan to post a series in the next few weeks and will Cc you on it. Your review and testing would be very welcome.

Thanks,
Lukasz Kulga

author
#5 lore raw

Hi Lukasz,

Thanks for reaching out.

Quoted 3 lines

I'd like to pick up SGP41 support, taking the approach Jonathan suggested above and extending the sgp40 driver rather than adding a separate one.

I have a v2 nearly ready (binding as a trivial-devices entry with vdd-supply, plus a separate driver). Hardware testing on my SGP41 board is still remaining, so I expect to post it within the next 2 weeks.

I kept it separate because SGP41 has different commands, CRC-protected two-word results, a NOx channel and a 10 s conditioning phase that sgp40 lacks. I'll explain this in the cover letter as Jonathan asked, and I'm happy to rework it as an sgp40 extension if he prefers.

I'll Cc you on v2. Testing on your boards would be very welcome.

Thanks,
Akshat

Quoted 26 lines · Lukasz Kulga,
Quoted 10 lines · Jonathan Cameron

Whilst it should be a separate patch, the route here to use trivial-devices might make sense. Only thing that might be worth documenting would be vdd-supply.

I'm would be looking for description in the cover letter of how this is different from, and not suited to extension of another drive such as the sgp40 (obviously there are more channels on one than the other so it isn't trivial!)

Jonathan

Hi Akshat,

I'd like to pick up SGP41 support, taking the approach Jonathan suggested above and extending the sgp40 driver rather than adding a separate one. I have SGP40 and SGP41 boards on the way for testing.

Unless you already have a v2 close to ready, I plan to post a series in the next few weeks and will Cc you on it. Your review and testing would be very welcome.

Thanks,
Lukasz Kulga

author
#6 lore raw
In reply to Lukasz Kulga

Re: SGP41 support
Reply to:

Quoted 7 lines

Hi Akshat,

I'd like to pick up SGP41 support, taking the approach Jonathan suggested above and extending the sgp40 driver rather than adding a separate one. I have SGP40 and SGP41 boards on the way for testing.

Quoted 6 lines

Unless you already have a v2 close to ready, I plan to post a series in the next few weeks and will Cc you on it. Your review and testing would be very welcome.

Thanks,
Lukasz Kulga

Hi Lukasz,

Thanks for reaching out.
I have a v2 nearly ready (binding as a trivial-devices entry with vdd-supply, plus a separate driver). Hardware testing on my SGP41 board is still remaining, so I expect to post it within the next 2 weeks.

I kept it separate because SGP41 has different commands, CRC-protected two-word results, a NOx channel and a 10 s conditioning phase that sgp40 lacks. I'll explain this in the cover letter as Jonathan asked, and I'm happy to rework it as an sgp40 extension if he prefers.

I'll Cc you on v2. Testing on your boards would be very welcome.

Thanks,
Akshat

Quoted 26 lines · Lukasz Kulga
Quoted 10 lines · Jonathan Cameron

Whilst it should be a separate patch, the route here to use trivial-devices might make sense. Only thing that might be worth documenting would be vdd-supply.

I'm would be looking for description in the cover letter of how this is different from, and not suited to extension of another drive such as the sgp40 (obviously there are more channels on one than the other so it isn't trivial!)

Jonathan

Hi Akshat,

I'd like to pick up SGP41 support, taking the approach Jonathan suggested above and extending the sgp40 driver rather than adding a separate one. I have SGP40 and SGP41 boards on the way for testing.

Unless you already have a v2 close to ready, I plan to post a series in the next few weeks and will Cc you on it. Your review and testing would be very welcome.

Thanks,
Lukasz Kulga