public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30
@ 2026-04-28 11:09 Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology Zaixiang Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zaixiang Xu @ 2026-04-28 11:09 UTC (permalink / raw)
  To: linux
  Cc: robh, krzk+dt, conor+dt, linux-hwmon, devicetree, linux-kernel,
	zaixiang.xu.dev

Hi all,

This v6 addresses the feedback provided by Guenter on v5 regarding the 
Sashiko results.

In v5, I attempted to rely entirely on the I2C core's fallback matching 
and moved the devices to trivial-devices.yaml. However, as Guenter 
pointed out, the driver requires a proper of_device_id table to pass 
DT checks and function correctly.

Because an explicit of_match_table is necessary in the driver, it is 
no longer appropriate to list these sensors in trivial-devices.yaml. 
Therefore, in this v6, I have introduced a proper, dedicated YAML 
binding for the Sensirion SHT30 series and GXCAS GXHT30.

Changes in v6:
- Dropped the trivial-devices.yaml approach from v5.
- Added a dedicated YAML binding file (sensirion,sht30.yaml).
- Added standard devicetree support (of_device_id table) to sht3x.c 
  as requested by Guenter.
- Split the patches into 4 logically separated commits (Vendor prefix, 
  YAML binding, Driver DT support, Driver GXHT30 support).

Changes in v5:
- (Attempted) Move to trivial-devices.yaml and drop of_match_table.
- Dropped wildcards, added specific models.
- Wrapped commit messages to 72 characters.

v3 & v4:
- Standalone YAML binding (but incorrectly used wildcards).

v2:
- Fix placeholder "Your Name" in MODULE_AUTHOR.

v1:
- Initial submission.

Zaixiang Xu (4):
  dt-bindings: vendor-prefixes: Add GXCAS Technology
  dt-bindings: hwmon: Add Sensirion SHT30 series
  hwmon: (sht3x) Add devicetree support
  hwmon: (sht3x) Add support for GXCAS GXHT30

 .../bindings/hwmon/sensirion,sht30.yaml       | 67 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 drivers/hwmon/sht3x.c                         | 22 +++++-
 3 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v6 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology
  2026-04-28 11:09 [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
@ 2026-04-28 11:09 ` Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 2/4] dt-bindings: hwmon: Add Sensirion SHT30 series Zaixiang Xu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Zaixiang Xu @ 2026-04-28 11:09 UTC (permalink / raw)
  To: linux
  Cc: robh, krzk+dt, conor+dt, linux-hwmon, devicetree, linux-kernel,
	zaixiang.xu.dev

Add vendor prefix for Beijing Galaxy-CAS Technology Co., Ltd. (GXCAS).
The prefix was confirmed from the manufacturer's website:
https://www.gxcas.com/en/index.html

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index ee7fd3cfe203..354836eb8e72 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -676,6 +676,8 @@ patternProperties:
     description: Gateworks Corporation
                  use "gateworks" vendor prefix
     deprecated: true
+  "^gxcas,.*":
+    description: Beijing Galaxy-CAS Technology Co., Ltd.
   "^hannstar,.*":
     description: HannStar Display Corporation
   "^haochuangyi,.*":
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 2/4] dt-bindings: hwmon: Add Sensirion SHT30 series
  2026-04-28 11:09 [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology Zaixiang Xu
@ 2026-04-28 11:09 ` Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 3/4] hwmon: (sht3x) Add devicetree support Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 4/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Zaixiang Xu @ 2026-04-28 11:09 UTC (permalink / raw)
  To: linux
  Cc: robh, krzk+dt, conor+dt, linux-hwmon, devicetree, linux-kernel,
	zaixiang.xu.dev

Add YAML devicetree binding schema for Sensirion SHT30 series and the
compatible GXCAS GXHT30 sensors.

Use fallback compatibles for compatible chips and add optional
interrupts and vdd-supply properties.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
---
 .../bindings/hwmon/sensirion,sht30.yaml       | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml b/Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml
new file mode 100644
index 000000000000..9b120f8d303c
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/sensirion,sht30.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sensirion SHT3x and GXCAS GXHT30 humidity and temperature sensors
+
+maintainers:
+  - Zaixiang Xu <zaixiang.xu.dev@gmail.com>
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - sensirion,sht30
+          - sensirion,sht31
+          - sensirion,sht35
+          - sensirion,sht85
+          - sensirion,sts30
+          - sensirion,sts31
+          - sensirion,sts32
+          - sensirion,sts35
+      - items:
+          - const: gxcas,gxht30
+          - const: sensirion,sht30
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: Regulator that provides power to the VDD pin.
+
+  reset-gpios:
+    maxItems: 1
+    description:
+      GPIO connected to the nRESET pin. Active low.
+
+  interrupts:
+    maxItems: 1
+    description:
+      Interrupt connected to the ALERT pin.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        humidity-sensor@44 {
+            compatible = "gxcas,gxht30", "sensirion,sht30";
+            reg = <0x44>;
+            vdd-supply = <&vcc_3v3_reg>;
+            reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 3/4] hwmon: (sht3x) Add devicetree support
  2026-04-28 11:09 [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 2/4] dt-bindings: hwmon: Add Sensirion SHT30 series Zaixiang Xu
@ 2026-04-28 11:09 ` Zaixiang Xu
  2026-04-28 11:09 ` [PATCH v6 4/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Zaixiang Xu @ 2026-04-28 11:09 UTC (permalink / raw)
  To: linux
  Cc: robh, krzk+dt, conor+dt, linux-hwmon, devicetree, linux-kernel,
	zaixiang.xu.dev

Add of_match_table to support devicetree based instantiation.
Specific match data is used to distinguish between temperature/humidity
(SHT) and temperature-only (STS) sensors.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
---
 drivers/hwmon/sht3x.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
index 08306ccb6d0b..6437568aaf73 100644
--- a/drivers/hwmon/sht3x.c
+++ b/drivers/hwmon/sht3x.c
@@ -939,8 +939,25 @@ static const struct i2c_device_id sht3x_ids[] = {
 
 MODULE_DEVICE_TABLE(i2c, sht3x_ids);
 
+static const struct of_device_id sht3x_of_match[] = {
+	{ .compatible = "sensirion,sht30", .data = (void *)(uintptr_t)sht3x },
+	{ .compatible = "sensirion,sht31", .data = (void *)(uintptr_t)sht3x },
+	{ .compatible = "sensirion,sht35", .data = (void *)(uintptr_t)sht3x },
+	{ .compatible = "sensirion,sht85", .data = (void *)(uintptr_t)sht3x },
+	{ .compatible = "sensirion,sts30", .data = (void *)(uintptr_t)sts3x },
+	{ .compatible = "sensirion,sts31", .data = (void *)(uintptr_t)sts3x },
+	{ .compatible = "sensirion,sts32", .data = (void *)(uintptr_t)sts3x },
+	{ .compatible = "sensirion,sts35", .data = (void *)(uintptr_t)sts3x },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, sht3x_of_match);
+
 static struct i2c_driver sht3x_i2c_driver = {
-	.driver.name = "sht3x",
+	.driver = {
+		.name = "sht3x",
+		.of_match_table = sht3x_of_match,
+	},
 	.probe       = sht3x_probe,
 	.id_table    = sht3x_ids,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 4/4] hwmon: (sht3x) Add support for GXCAS GXHT30
  2026-04-28 11:09 [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
                   ` (2 preceding siblings ...)
  2026-04-28 11:09 ` [PATCH v6 3/4] hwmon: (sht3x) Add devicetree support Zaixiang Xu
@ 2026-04-28 11:09 ` Zaixiang Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Zaixiang Xu @ 2026-04-28 11:09 UTC (permalink / raw)
  To: linux
  Cc: robh, krzk+dt, conor+dt, linux-hwmon, devicetree, linux-kernel,
	zaixiang.xu.dev

Add support for the GXCAS GXHT30 humidity and temperature sensor.
The GXHT30 is software compatible with the Sensirion SHT30.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
---
 drivers/hwmon/sht3x.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
index 6437568aaf73..f52114c13edb 100644
--- a/drivers/hwmon/sht3x.c
+++ b/drivers/hwmon/sht3x.c
@@ -934,6 +934,7 @@ static const struct i2c_device_id sht3x_ids[] = {
 	{"sht3x", sht3x},
 	{"sts3x", sts3x},
 	{"sht85", sht3x},
+	{"gxht30", sht3x},
 	{}
 };
 
@@ -948,6 +949,7 @@ static const struct of_device_id sht3x_of_match[] = {
 	{ .compatible = "sensirion,sts31", .data = (void *)(uintptr_t)sts3x },
 	{ .compatible = "sensirion,sts32", .data = (void *)(uintptr_t)sts3x },
 	{ .compatible = "sensirion,sts35", .data = (void *)(uintptr_t)sts3x },
+	{ .compatible = "gxcas,gxht30", .data = (void *)(uintptr_t)sht3x },
 	{ }
 };
 
@@ -965,5 +967,6 @@ module_i2c_driver(sht3x_i2c_driver);
 
 MODULE_AUTHOR("David Frey <david.frey@sensirion.com>");
 MODULE_AUTHOR("Pascal Sachs <pascal.sachs@sensirion.com>");
+MODULE_AUTHOR("Zaixiang Xu <zaixiang.xu.dev@gmail.com>");
 MODULE_DESCRIPTION("Sensirion SHT3x humidity and temperature sensor driver");
 MODULE_LICENSE("GPL");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-28 11:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 11:09 [PATCH v6 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
2026-04-28 11:09 ` [PATCH v6 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology Zaixiang Xu
2026-04-28 11:09 ` [PATCH v6 2/4] dt-bindings: hwmon: Add Sensirion SHT30 series Zaixiang Xu
2026-04-28 11:09 ` [PATCH v6 3/4] hwmon: (sht3x) Add devicetree support Zaixiang Xu
2026-04-28 11:09 ` [PATCH v6 4/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox