Hi all,
The sht21 driver actually supports all i2c sht2x chips so add support for those names and additionally add DT support.
Tested for sht20 and verified against the datasheet for sht25.
Thanks!
Signed-off-by: Kurt Borja kuurtb@gmail.com --- Changes in v2: - Add a documentation cleanup patch - Add entry for each chip instead of sht2x placeholder - Update Kconfig too - Link to v1: https://lore.kernel.org/r/20250907-sht2x-v1-0-fd56843b1b43@gmail.com
--- Kurt Borja (4): hwmon: (sht21) Documentation cleanup hwmon: (sht21) Add support for SHT20, SHT25 chips hwmon: (sht21) Add devicetree support dt-bindings: trivial-devices: Add sht2x sensors
.../devicetree/bindings/trivial-devices.yaml | 3 +++ Documentation/hwmon/sht21.rst | 26 +++++++++++++--------- drivers/hwmon/Kconfig | 4 ++-- drivers/hwmon/sht21.c | 14 +++++++++++- 4 files changed, 33 insertions(+), 14 deletions(-) --- base-commit: b236920731dd90c3fba8c227aa0c4dee5351a639 change-id: 20250907-sht2x-9b96125a0cf5
Drop extra empty lines and organize sysfs entries in a table.
Signed-off-by: Kurt Borja kuurtb@gmail.com --- Documentation/hwmon/sht21.rst | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst index 1bccc8e8aac8d3532ec17dcdbc6a172102877085..9f66cd51b45dc4b89ce757d2209445478de046cd 100644 --- a/Documentation/hwmon/sht21.rst +++ b/Documentation/hwmon/sht21.rst @@ -13,8 +13,6 @@ Supported chips:
https://www.sensirion.com/file/datasheet_sht21
- - * Sensirion SHT25
Prefix: 'sht25' @@ -25,8 +23,6 @@ Supported chips:
https://www.sensirion.com/file/datasheet_sht25
- - Author:
Urs Fleisch urs.fleisch@sensirion.com @@ -47,13 +43,11 @@ in the board setup code. sysfs-Interface ---------------
-temp1_input - - temperature input - -humidity1_input - - humidity input -eic - - Electronic Identification Code +=================== ============================================================ +temp1_input Temperature input +humidity1_input Humidity input +eic Electronic Identification Code +=================== ============================================================
Notes -----
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#opti...
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree. Subject: [PATCH v2 1/4] hwmon: (sht21) Documentation cleanup Link: https://lore.kernel.org/stable/20250907-sht2x-v2-1-1c7dc90abf8e%40gmail.com
All sht2x chips share the same communication protocol so add support for them.
Cc: stable@vger.kernel.org Signed-off-by: Kurt Borja kuurtb@gmail.com --- Documentation/hwmon/sht21.rst | 10 ++++++++++ drivers/hwmon/Kconfig | 4 ++-- drivers/hwmon/sht21.c | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst index 9f66cd51b45dc4b89ce757d2209445478de046cd..d20e8a460ba6c7c8452bcdce68a1fce963413640 100644 --- a/Documentation/hwmon/sht21.rst +++ b/Documentation/hwmon/sht21.rst @@ -3,6 +3,16 @@ Kernel driver sht21
Supported chips:
+ * Sensirion SHT20 + + Prefix: 'sht20' + + Addresses scanned: none + + Datasheet: Publicly available at the Sensirion website + + https://www.sensirion.com/file/datasheet_sht20 + * Sensirion SHT21
Prefix: 'sht21' diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 9d28fcf7cd2a6f9e2f54694a717bd85ff4047b46..90dc8051418689e7a92293df15ce35cd822c77ff 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1930,8 +1930,8 @@ config SENSORS_SHT21 tristate "Sensiron humidity and temperature sensors. SHT21 and compat." depends on I2C help - If you say yes here you get support for the Sensiron SHT21, SHT25 - humidity and temperature sensors. + If you say yes here you get support for the Sensiron SHT20, SHT21, + SHT25 humidity and temperature sensors.
This driver can also be built as a module. If so, the module will be called sht21. diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c index 97327313529b467ed89d8f6b06c2d78efd54efbf..97d71e3361e9d7f0512880149ba6479601b2fc0c 100644 --- a/drivers/hwmon/sht21.c +++ b/drivers/hwmon/sht21.c @@ -275,7 +275,9 @@ static int sht21_probe(struct i2c_client *client)
/* Device ID table */ static const struct i2c_device_id sht21_id[] = { + { "sht20" }, { "sht21" }, + { "sht25" }, { } }; MODULE_DEVICE_TABLE(i2c, sht21_id);
Add DT support for sht2x chips.
Cc: stable@vger.kernel.org Signed-off-by: Kurt Borja kuurtb@gmail.com --- drivers/hwmon/sht21.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c index 97d71e3361e9d7f0512880149ba6479601b2fc0c..2c2d3afba5155f951096210e2f4b3214def3b000 100644 --- a/drivers/hwmon/sht21.c +++ b/drivers/hwmon/sht21.c @@ -282,8 +282,18 @@ static const struct i2c_device_id sht21_id[] = { }; MODULE_DEVICE_TABLE(i2c, sht21_id);
+static const struct of_device_id sht21_of_match[] = { + { .compatible = "sensirion,sht20" }, + { .compatible = "sensirion,sht21" }, + { .compatible = "sensirion,sht25" }, + { } +}; + static struct i2c_driver sht21_driver = { - .driver.name = "sht21", + .driver = { + .name = "sht21", + .of_match_table = sht21_of_match, + }, .probe = sht21_probe, .id_table = sht21_id, };
Add sensirion,sht2x trivial sensors.
Cc: stable@vger.kernel.org Signed-off-by: Kurt Borja kuurtb@gmail.com --- Documentation/devicetree/bindings/trivial-devices.yaml | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index f3dd18681aa6f81255141bdda6daf8e45369a2c2..952244a7105591a0095b1ae57da7cb7345bdfc61 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -362,6 +362,9 @@ properties: # Sensirion low power multi-pixel gas sensor with I2C interface - sensirion,sgpc3 # Sensirion temperature & humidity sensor with I2C interface + - sensirion,sht20 + - sensirion,sht21 + - sensirion,sht25 - sensirion,sht4x # Sensortek 3 axis accelerometer - sensortek,stk8312
linux-stable-mirror@lists.linaro.org