Skip to contentSkip to conversation

hwmon: (sht3x) Add support for GXCAS GXHT30

PATCH Superseded Zaixiang Xu 2 participants 5 messages Apr 3 – Apr 10

Subsystems (2)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover hwmon: (sht3x) Add support for GXCAS GXHT30

Hi all,

First, I sincerely apologize for the noise in v3 and v4. I unfortunately missed the crucial feedback provided in v1 by Krzysztof, Conor, and Guenter.

In this v5, I have completely dropped the incorrect approaches from the previous versions and completely refactored the patchset to strictly follow the maintainers' guidelines:

1. Wildcards are entirely avoided. Explicit chip names are used.
2. The standalone YAML binding has been dropped. The devices are now added to trivial-devices.yaml.
3. The redundant of_match_table addition in the driver is dropped. The driver now relies on the I2C core's fallback matching mechanism.

Patch 1 adds the vendor prefix for GXCAS (Carries Conor's Acked-by from v1).
Patch 2 adds the explicit SHT3x/STS3x and GXHT30 models to trivial-devices.yaml.
Patch 3 adds minimal I2C ID support to the sht3x driver.

---
Changelog:

v5:
- Dropped the standalone YAML binding file.
- Added explicit chip models (sht30, sht31, sht35, sht85, sts30, sts31, gxht30) to trivial-devices.yaml to avoid wildcards.
- Dropped the of_match_table addition in sht3x.c.
- Wrapped all commit messages to 72 characters.
- Added company website to the vendor prefix commit message.

v3 & v4:
- (Incorrectly) Proceeded with the standalone YAML file.
- (Incorrectly) Added of_match_table with wildcards to the driver.

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

v1:
- Initial submission.

Zaixiang Xu (3):
dt-bindings: vendor-prefixes: Add GXCAS Technology
dt-bindings: trivial-devices: add Sensirion SHT3x/STS3x and GXCAS

    GXHT30

hwmon: (sht3x) Add support for GXCAS GXHT30 sensor

 Documentation/devicetree/bindings/trivial-devices.yaml | 9 +++++++++
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 drivers/hwmon/sht3x.c                                  | 2 ++
 3 files changed, 13 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v5 1/3 dt-bindings: vendor-prefixes: Add GXCAS Technology

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

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index ee7fd3cfe203..354836eb8e72 100644
@@ -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,.*":
Signature · 1 line
2.34.1
#2 lore raw

PATCH v5 2/3 dt-bindings: trivial-devices: add Sensirion SHT3x/STS3x and GXCAS GXHT30

In reply to Zaixiang Xu

The Sensirion SHT3x/STS3x series (and its compatible alternative, the GXCAS GXHT30) are simple I2C temperature and humidity sensors. They require no external resources other than the I2C bus and power supply, fitting perfectly into the trivial-devices category.

Historically, the driver matched against the "sht3x" wildcard compatible string. However, as pointed out by DT maintainers, wildcards are heavily discouraged in new bindings, and specific part numbers representing real devices should be used instead.

Therefore, document the explicit chip names (sht30, sht31, sht35, sht85, sts30, sts31) along with the fully compatible gxht30 in trivial-devices.yaml. Note that sht85 is already supported in the driver but was missing from the bindings.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +9 -0
index a482aeadcd44..e6efabfb1b14 100644
@@ -125,6 +125,8 @@ properties:
           - fsl,mma8450
             # MPR121: Proximity Capacitive Touch Sensor Controller
           - fsl,mpr121
+            # GXCAS temperature & humidity sensor with I2C interface
+          - gxcas,gxht30
             # HiTRON AC/DC CompactPCI Power Supply
           - hitron,hac300s
             # Honeywell Humidicon HIH-6130 humidity/temperature sensor
@@ -399,7 +401,14 @@ properties:
           - sensirion,sht20
           - sensirion,sht21
           - sensirion,sht25
+          - sensirion,sht30
+          - sensirion,sht31
+          - sensirion,sht35
           - sensirion,sht4x
+          - sensirion,sht85
+            # Sensirion temperature sensor with I2C interface
+          - sensirion,sts30
+          - sensirion,sts31
             # Sensortek 3 axis accelerometer
           - sensortek,stk8312
             # Sensortek 3 axis accelerometer
Signature · 1 line
2.34.1
#3 lore raw

PATCH v5 3/3 hwmon: (sht3x) Add support for GXCAS GXHT30 sensor

In reply to Zaixiang Xu

The GXCAS GXHT30 is a humidity and temperature sensor that is software compatible with the Sensirion SHT3x series.

Add the "gxht30" chip name to the i2c_device_id table to allow I2C core matching. For Device Tree instantiation, this driver relies on the I2C core fallback matching or DT compatible fallbacks (e.g., matching "gxcas,gxht30" with "sensirion,sht30").

---
 drivers/hwmon/sht3x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hwmon/sht3x.c +2 -0
index 08306ccb6d0b..abcc7b4abe5a 100644
@@ -934,6 +934,7 @@ static const struct i2c_device_id sht3x_ids[] = {
 	{"sht3x", sht3x},
 	{"sts3x", sts3x},
 	{"sht85", sht3x},
+	{"gxht30", sht3x},
 	{}
 };
 
@@ -948,5 +949,6 @@ module_i2c_driver(sht3x_i2c_driver);
 
 MODULE_AUTHOR("David Frey <[email protected]>");
 MODULE_AUTHOR("Pascal Sachs <[email protected]>");
+MODULE_AUTHOR("Zaixiang Xu <[email protected]>");
 MODULE_DESCRIPTION("Sensirion SHT3x humidity and temperature sensor driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.34.1
maintainer
#4 lore raw
In reply to Zaixiang Xu
Quoted 16 lines · Zaixiang Xu

Hi all,

First, I sincerely apologize for the noise in v3 and v4. I unfortunately missed the crucial feedback provided in v1 by Krzysztof, Conor, and Guenter.

In this v5, I have completely dropped the incorrect approaches from the previous versions and completely refactored the patchset to strictly follow the maintainers' guidelines:

1. Wildcards are entirely avoided. Explicit chip names are used.
2. The standalone YAML binding has been dropped. The devices are now added to trivial-devices.yaml.
3. The redundant of_match_table addition in the driver is dropped. The driver now relies on the I2C core's fallback matching mechanism.

Quoted 6 lines

Patch 1 adds the vendor prefix for GXCAS (Carries Conor's Acked-by from v1).
Patch 2 adds the explicit SHT3x/STS3x and GXHT30 models to trivial-devices.yaml.
Patch 3 adds minimal I2C ID support to the sht3x driver.

Sashiko feedback:

https://sashiko.dev/#/patchset/1775211296-63722-1-git-send-email-zaixiang.xu.dev%40gmail.com

I think at the very least this will require a proper of_device_id table.

Thanks,
Guenter