Skip to contentSkip to conversation

dt-bindings: vendor-prefixes: add aosong

PATCH Superseded Anshul Dalal 2 participants 6 messages Nov 15, 2023

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Anshul Dalal

author maintainer
#0 lore raw

PATCH v2 1/3 dt-bindings: vendor-prefixes: add aosong

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

---

Changes for v2:
- Changed vendor prefix from asair to aosong

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 573578db9509..48d4ff635562 100644
@@ -117,6 +117,8 @@ patternProperties:
     description: Andes Technology Corporation
   "^anvo,.*":
     description: Anvo-Systems Dresden GmbH
+  "^aosong,.*":
+    description: Guangzhou Aosong Electronic Co., Ltd.
   "^apm,.*":
     description: Applied Micro Circuits Corporation (APM)
   "^apple,.*":
Signature · 1 line
2.42.0
author maintainer
#1 lore raw

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

Add bindings for Aosong AGS02MA TVOC sensor.

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

---

Changes for v2:
- Removed device from trivial-devices
- Added standalone binding with vdd-supply property

---
 .../bindings/iio/chemical/aosong,ags02ma.yaml | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +48 -0
new file mode 100644
index 000000000000..4a0278c6318c
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aosong AGS02MA VOC Sensor
+
+description: |
+  AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
+  address of 0x1a.
+
+  Datasheet:
+    https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+
+maintainers:
+  - Anshul Dalal <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - aosong,ags02ma
+      - asair,ags02ma
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@1a {
+            compatible = "aosong,ags02ma";
+            reg = <0x1a>;
+            vdd-supply = <&vdd_regulator>;
+        };
+    };
Signature · 1 line
2.42.0
#2 lore raw

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

Quoted 10 lines · Anshul Dalal

Add bindings for Aosong AGS02MA TVOC sensor.

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

Quoted 5 lines

---

Changes for v2:
- Removed device from trivial-devices

Your $subject still says "trivial-devices" though, so please fix that in your next submission.

Quoted 25 lines

- Added standalone binding with vdd-supply property

---
 .../bindings/iio/chemical/aosong,ags02ma.yaml | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +13 -0
new file mode 100644
index 000000000000..4a0278c6318c
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aosong AGS02MA VOC Sensor
+
+description: |
+  AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
+  address of 0x1a.
+
+  Datasheet:

Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +10 -0
+    https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+
+maintainers:
+  - Anshul Dalal <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - aosong,ags02ma
+      - asair,ags02ma

Why do you have two compatibles for the same device? Please document and use only one of these. The aoson website says:
"Guangzhou ASAIR Electronic Co., Ltd"
so I suspect "asair" is a more apt vendor prefix.

Thanks,
Conor.

Quoted 28 lines
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +25 -0
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@1a {
+            compatible = "aosong,ags02ma";
+            reg = <0x1a>;
+            vdd-supply = <&vdd_regulator>;
+        };
+    };
Signature · 1 line
2.42.0
author maintainer
#3 lore raw

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

Quoted 51 lines · Conor Dooley
Quoted 10 lines · Anshul Dalal

Add bindings for Aosong AGS02MA TVOC sensor.

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

Quoted 5 lines

---

Changes for v2:
- Removed device from trivial-devices

Your $subject still says "trivial-devices" though, so please fix that in your next submission.

Quoted 31 lines

- Added standalone binding with vdd-supply property

---
 .../bindings/iio/chemical/aosong,ags02ma.yaml | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +19 -0
new file mode 100644
index 000000000000..4a0278c6318c
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aosong AGS02MA VOC Sensor
+
+description: |
+  AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
+  address of 0x1a.
+
+  Datasheet:
+    https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+
+maintainers:
+  - Anshul Dalal <[email protected]>
+
+properties:
Quoted 8 lines

Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +4 -0
+  compatible:
+    enum:
+      - aosong,ags02ma
+      - asair,ags02ma

Why do you have two compatibles for the same device? Please document and use only one of these. The aoson website says:
"Guangzhou ASAIR Electronic Co., Ltd"

I'm sorry but I couldn't find any reference to such name on
http://www.aosong.com/en/
In the contact page (http://www.aosong.com/en/article-34.html),
I could only find references to "Guangzhou Aosong Electronic Co., Ltd."

Quoted 2 lines

so I suspect "asair" is a more apt vendor prefix.

Asair is the brand name under which Guangzhou Aosong Electronics sells their products [0]. After a prior discussion with Krzysztof [1], I thought it would be the best to go with Aosong instead.

The rationale being since a vendor can only have a single prefix, if Aosong were to sell some new product under the name Aosong, it would then have to have the same vendor-prefix as other products under the Asair brand.

[0]: https://www.linkedin.com/company/asairsensor/
[1]:
https://lore.kernel.org/lkml/[email protected]/
Best regards,
Anshul

#4 lore raw

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

Quoted 61 lines · Anshul Dalal
Quoted 51 lines · Conor Dooley
Quoted 10 lines · Anshul Dalal

Add bindings for Aosong AGS02MA TVOC sensor.

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

Quoted 5 lines

---

Changes for v2:
- Removed device from trivial-devices

Your $subject still says "trivial-devices" though, so please fix that in your next submission.

Quoted 31 lines

- Added standalone binding with vdd-supply property

---
 .../bindings/iio/chemical/aosong,ags02ma.yaml | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +19 -0
new file mode 100644
index 000000000000..4a0278c6318c
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aosong AGS02MA VOC Sensor
+
+description: |
+  AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
+  address of 0x1a.
+
+  Datasheet:
+    https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+
+maintainers:
+  - Anshul Dalal <[email protected]>
+
+properties:
Quoted 8 lines

Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml new file +4 -0
+  compatible:
+    enum:
+      - aosong,ags02ma
+      - asair,ags02ma

Why do you have two compatibles for the same device? Please document and use only one of these. The aoson website says:
"Guangzhou ASAIR Electronic Co., Ltd"

Quoted 4 lines

I'm sorry but I couldn't find any reference to such name on
http://www.aosong.com/en/
In the contact page (http://www.aosong.com/en/article-34.html),
I could only find references to "Guangzhou Aosong Electronic Co., Ltd."

On the page you linked in your original submission:
www.aosong.com/m/en/products-33.html (scroll down)

Quoted 11 lines
Quoted 2 lines

so I suspect "asair" is a more apt vendor prefix.

Asair is the brand name under which Guangzhou Aosong Electronics sells their products [0]. After a prior discussion with Krzysztof [1], I thought it would be the best to go with Aosong instead.

The rationale being since a vendor can only have a single prefix, if Aosong were to sell some new product under the name Aosong, it would then have to have the same vendor-prefix as other products under the Asair brand.

Go with Aosong then, sure. But please drop the "asair" prefixed compatible from your binding.

Cheers,
Conor,

author maintainer
#5 lore raw

PATCH v2 3/3 iio: chemical: add support for Aosong AGS02MA

In reply to Anshul Dalal

A simple driver for the TVOC (Total Volatile Organic Compounds) sensor from Aosong: 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 as percents

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

---

Changes for v2:
- Fixed Kconfig not selecting CRC8 (used to be select crc8)
- Changed instances of asair to aosong
- Report raw readings in percents instead of ppb
- Added myself as maintainer for the device binding

---
 MAINTAINERS                    |   7 ++
 drivers/iio/chemical/Kconfig   |  11 +++
 drivers/iio/chemical/Makefile  |   1 +
 drivers/iio/chemical/ags02ma.c | 161 +++++++++++++++++++++++++++++++++
 4 files changed, 180 insertions(+)
 create mode 100644 drivers/iio/chemical/ags02ma.c
MAINTAINERS +7 -0
index 81d5fc0bba68..07b82e766dbd 100644
@@ -3028,6 +3028,13 @@ S:	Supported
 W:	http://www.akm.com/
 F:	drivers/iio/magnetometer/ak8974.c
 
+AOSONG AGS02MA TVOC SENSOR DRIVER
+M:	Anshul Dalal <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
+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..02649ab81b3c 100644
@@ -5,6 +5,17 @@
 
 menu "Chemical Sensors"
 
+config AOSONG_AGS02MA
+	tristate "Aosong AGS02MA TVOC sensor driver"
+	depends on I2C
+	select CRC8
+	help
+	  Say Y here to build support for Aosong 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..2f3dee8bb779 100644
@@ -4,6 +4,7 @@
 #
 
 # When adding new entries keep the list in alphabetical order
+obj-$(CONFIG_AOSONG_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 +161 -0

161 lines not on this page · raw message

Signature · 1 line
2.42.0