Skip to contentSkip to conversation

dt-bindings: vendor-prefixes: add asair

PATCH Superseded Anshul Dalal 2 participants 13 messages Nov 7, 2023 – Nov 9, 2023

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Anshul Dalal

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: vendor-prefixes: add asair

Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20 temperature and humidity sensor under the name Asair

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 573578db9509..df3204f9dda6 100644
@@ -143,6 +143,8 @@ patternProperties:
     description: Artesyn Embedded Technologies Inc.
   "^asahi-kasei,.*":
     description: Asahi Kasei Corp.
+  "^asair,.*":
+    description: Aosong Electronic Co., Ltd.
   "^asc,.*":
     description: All Sensors Corporation
   "^asix,.*":
Signature · 1 line
2.42.0
author maintainer
#1 lore raw

PATCH 2/3 dt-bindings: trivial-devices: add asair,ags02ma

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index cd58179ae337..9cd67b758a88 100644
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma
             # i2c serial eeprom (24cxx)
           - at,24c08
             # i2c trusted platform module (TPM)
Signature · 1 line
2.42.0
#2 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 20 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +0 -0
index cd58179ae337..9cd67b758a88 100644

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

Best regards,
Krzysztof

author maintainer
#3 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Hello Krzysztof,

Quoted 16 lines · Krzysztof Kozlowski
Quoted 15 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 10 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index cd58179ae337..9cd67b758a88 100644
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

I am sorry but I'm not sure what you meant. Are you referring to the addition of some information in the commit description?

Best regards,
Anshul

#4 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 33 lines · Anshul Dalal

Hello Krzysztof,

Quoted 16 lines · Krzysztof Kozlowski
Quoted 15 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 10 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index cd58179ae337..9cd67b758a88 100644
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

Quoted 2 lines

I am sorry but I'm not sure what you meant. Are you referring to the addition of some information in the commit description?

I meant that your device might not be trivial. Your device takes VDD supply, which is now not described in the bindings. Do you want to say that VDD supply in all possible designs is hard-wired to non-controllable regulator supply?

Best regards,
Krzysztof

author maintainer
#5 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 34 lines · Krzysztof Kozlowski
Quoted 33 lines · Anshul Dalal

Hello Krzysztof,

Quoted 28 lines · Krzysztof Kozlowski
Quoted 20 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +0 -0
index cd58179ae337..9cd67b758a88 100644

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

Quoted 7 lines
Quoted 2 lines

I am sorry but I'm not sure what you meant. Are you referring to the addition of some information in the commit description?

I meant that your device might not be trivial. Your device takes VDD supply, which is now not described in the bindings. Do you want to say that VDD supply in all possible designs is hard-wired to non-controllable regulator supply?

I can't speak for all possible designs but for testing this driver I had just connected the VDD pin to 5V out of the Raspberry Pi. I have since verified 3.3V to also work.
Could you explain why vdd-supply is a property or point me to further sources. Wouldn't almost all devices have a VDD/VCC pin for power in?

Best Regards,
Anshul

#6 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 43 lines · Anshul Dalal
Quoted 34 lines · Krzysztof Kozlowski
Quoted 33 lines · Anshul Dalal

Hello Krzysztof,

Quoted 28 lines · Krzysztof Kozlowski
Quoted 20 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +0 -0
index cd58179ae337..9cd67b758a88 100644

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

Quoted 7 lines
Quoted 2 lines

I am sorry but I'm not sure what you meant. Are you referring to the addition of some information in the commit description?

I meant that your device might not be trivial. Your device takes VDD supply, which is now not described in the bindings. Do you want to say that VDD supply in all possible designs is hard-wired to non-controllable regulator supply?

Quoted 5 lines

I can't speak for all possible designs but for testing this driver I had just connected the VDD pin to 5V out of the Raspberry Pi. I have since verified 3.3V to also work.
Could you explain why vdd-supply is a property or point me to further sources. Wouldn't almost all devices have a VDD/VCC pin for power in?

Most of the devices have such pin. For most of the devices we include it in the bindings.

git grep regulator_get -- drivers/iio/
git grep vdd -- drivers/iio/

If you do not describe it in the bindings, then your device will have to be supplied by always-on regulators (and marking controllable regulator as always-on because of this is not correct).

If you are unsure and you just work on some sensor not used for final product, I think it's fine as is, so to add the regulator later if ever needed.

Best regards,
Krzysztof

author maintainer
#7 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 53 lines · Krzysztof Kozlowski
Quoted 43 lines · Anshul Dalal
Quoted 34 lines · Krzysztof Kozlowski
Quoted 33 lines · Anshul Dalal

Hello Krzysztof,

Quoted 28 lines · Krzysztof Kozlowski
Quoted 20 lines · Anshul Dalal

Add bindings for Asair AGS02MA TVOC sensor to trivial devices.

The sensor communicates over i2c with the default address 0x1a. TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +0 -0
index cd58179ae337..9cd67b758a88 100644

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 51

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -47,6 +47,8 @@ properties:
           - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
+            # TVOC (Total Volatile Organic Compounds) i2c sensor
+          - asair,ags02ma

I think you miss VDD supply.

Quoted 7 lines
Quoted 2 lines

I am sorry but I'm not sure what you meant. Are you referring to the addition of some information in the commit description?

I meant that your device might not be trivial. Your device takes VDD supply, which is now not described in the bindings. Do you want to say that VDD supply in all possible designs is hard-wired to non-controllable regulator supply?

Quoted 5 lines

I can't speak for all possible designs but for testing this driver I had just connected the VDD pin to 5V out of the Raspberry Pi. I have since verified 3.3V to also work.
Could you explain why vdd-supply is a property or point me to further sources. Wouldn't almost all devices have a VDD/VCC pin for power in?

Most of the devices have such pin. For most of the devices we include it in the bindings.

Quoted 7 lines

git grep regulator_get -- drivers/iio/
git grep vdd -- drivers/iio/

If you do not describe it in the bindings, then your device will have to be supplied by always-on regulators (and marking controllable regulator as always-on because of this is not correct).

Thanks for the explanation Krzysztof. If I understand correctly, having an vdd-supply in the binding indicates that the device may be powered by a controllable power source instead of one that is always on.

Quoted 3 lines

If you are unsure and you just work on some sensor not used for final product, I think it's fine as is, so to add the regulator later if ever needed.

No problem, I can add the required properties in the next patch version. I need to make a few changes to the driver anyways.

Just out of curiosity, the sensor supports reassigning of the i2c address by writing to the 0x21 register from the default address of 0x1a. Is there some way to represent this in the binding. For future reference, is there some exhaustive list or specification document for all the allowed properties.

Thanks for the help,
Anshul

#8 lore raw

Re: [PATCH 2/3] dt-bindings: trivial-devices: add asair,ags02ma

Quoted 10 lines · Anshul Dalal
Quoted 3 lines

If you are unsure and you just work on some sensor not used for final product, I think it's fine as is, so to add the regulator later if ever needed.

No problem, I can add the required properties in the next patch version. I need to make a few changes to the driver anyways.

Just out of curiosity, the sensor supports reassigning of the i2c address by writing to the 0x21 register from the default address of 0x1a.

You can list allowed addresses, but we rarely do it.

Quoted 3 lines

Is there some way to represent this in the binding.
For future reference, is there some exhaustive list or specification document for all the allowed properties.

Any property could be allowed so the is no list of them.

dt-extract-props -v Documentation/devicetree/bindings/

Best regards,
Krzysztof

author maintainer
#9 lore raw

PATCH 3/3 iio: chemical: add support for Asair AGS02MA

In reply to Anshul Dalal

A simple driver for the TVOC (Total Volatile Organic Compounds) sensor from Asair: AGS02MA

Steps in reading the VOC sensor value over i2c:
1. Read 5 bytes from the register AGS02MA_TVOC_READ_REG [0x00]
2. The first 4 bytes are taken as the big endian sensor data with final byte being the CRC
3. The CRC is verified and the value is returned over an IIO_CHAN_INFO_RAW channel

Tested on Raspberry Pi Zero 2W

Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html

---
 MAINTAINERS                    |   6 ++
 drivers/iio/chemical/Kconfig   |  11 +++
 drivers/iio/chemical/Makefile  |   1 +
 drivers/iio/chemical/ags02ma.c | 156 +++++++++++++++++++++++++++++++++
 4 files changed, 174 insertions(+)
 create mode 100644 drivers/iio/chemical/ags02ma.c
MAINTAINERS +6 -0
index 81d5fc0bba68..3592d83543b5 100644
@@ -3028,6 +3028,12 @@ S:	Supported
 W:	http://www.akm.com/
 F:	drivers/iio/magnetometer/ak8974.c
 
+ASAIR AGS02MA TVOC SENSOR DRIVER
+M:	Anshul Dalal <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/iio/chemical/ags02ma.c
+
 ASC7621 HARDWARE MONITOR DRIVER
 M:	George Joseph <[email protected]>
 L:	[email protected]
drivers/iio/chemical/Kconfig +11 -0
index c30657e10ee1..58c57c15abdb 100644
@@ -5,6 +5,17 @@
 
 menu "Chemical Sensors"
 
+config ASAIR_AGS02MA
+	tristate "Asair AGS02MA TVOC sensor driver"
+	depends on I2C
+	select crc8
+	help
+	  Say Y here to build support for Asair AGS02MA TVOC (Total Volatile
+	  Organic Compounds) sensor.
+
+	  To compile this driver as module, choose M here: the module will be
+	  called ags02ma.
+
 config ATLAS_PH_SENSOR
 	tristate "Atlas Scientific OEM SM sensors"
 	depends on I2C
drivers/iio/chemical/Makefile +1 -0
index a11e777a7a00..885009f6115f 100644
@@ -4,6 +4,7 @@
 #
 
 # When adding new entries keep the list in alphabetical order
+obj-$(CONFIG_ASAIR_AGS02MA)	+= ags02ma.o
 obj-$(CONFIG_ATLAS_PH_SENSOR)	+= atlas-sensor.o
 obj-$(CONFIG_ATLAS_EZO_SENSOR)	+= atlas-ezo-sensor.o
 obj-$(CONFIG_BME680) += bme680_core.o
drivers/iio/chemical/ags02ma.c new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
2.42.0
#10 lore raw
In reply to Anshul Dalal
Quoted 2 lines · Anshul Dalal

Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20 temperature and humidity sensor under the name Asair

The name of the company is Aosong Electronic or Asair? What does Asair stands for? Sensors name? Then it is not a vendor prefix.

Quoted 11 lines
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 573578db9509..df3204f9dda6 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 150

Quoted 8 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -143,6 +143,8 @@ patternProperties:
     description: Artesyn Embedded Technologies Inc.
   "^asahi-kasei,.*":
     description: Asahi Kasei Corp.
+  "^asair,.*":
+    description: Aosong Electronic Co., Ltd.
   "^asc,.*":
     description: All Sensors Corporation
   "^asix,.*":

Best regards,
Krzysztof

author maintainer
#11 lore raw
Quoted 7 lines · Krzysztof Kozlowski
Quoted 2 lines · Anshul Dalal

Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20 temperature and humidity sensor under the name Asair

The name of the company is Aosong Electronic or Asair? What does Asair stands for? Sensors name? Then it is not a vendor prefix.

Asair is the brand name under which Aosong Electronics sells their products. I thought Asair would be the better choice since all their products use that as the manufacturer name instead of Aosong as well as all the retail suppliers of their sensors.

Quoted 23 lines
Quoted 11 lines
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 573578db9509..df3204f9dda6 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 150

Quoted 8 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -143,6 +143,8 @@ patternProperties:
     description: Artesyn Embedded Technologies Inc.
   "^asahi-kasei,.*":
     description: Asahi Kasei Corp.
+  "^asair,.*":
+    description: Aosong Electronic Co., Ltd.
   "^asc,.*":
     description: All Sensors Corporation
   "^asix,.*":

Best regards,
Krzysztof

#12 lore raw
Quoted 5 lines · Anshul Dalal
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Anshul Dalal

Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20 temperature and humidity sensor under the name Asair

Quoted 8 lines
Quoted 3 lines

The name of the company is Aosong Electronic or Asair? What does Asair stands for? Sensors name? Then it is not a vendor prefix.

Asair is the brand name under which Aosong Electronics sells their products. I thought Asair would be the better choice since all their products use that as the manufacturer name instead of Aosong as well as all the retail suppliers of their sensors.

What if Aosong sells new product, e.g. power supply, under name Aosong. Would you create new prefix? One vendor should have one prefix, so in that case all other products not sold under Asair should be with "asair".

Best regards,
Krzysztof