* [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
2025-09-07 22:06 [PATCH 0/3] hwmon: (sht21) Add devicetree support Kurt Borja
@ 2025-09-07 22:06 ` Kurt Borja
2025-09-07 22:19 ` Guenter Roeck
2025-09-07 22:06 ` [PATCH 2/3] hwmon: (sht21) Add devicetree support Kurt Borja
2025-09-07 22:06 ` [PATCH 3/3] dt-bindings: trivial-devices: Add sht2x sensors Kurt Borja
2 siblings, 1 reply; 10+ messages in thread
From: Kurt Borja @ 2025-09-07 22:06 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree,
Kurt Borja
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 | 11 +++++++++++
drivers/hwmon/sht21.c | 3 +++
2 files changed, 14 insertions(+)
diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst
index 1bccc8e8aac8d3532ec17dcdbc6a172102877085..65f85ca68ecac1cba6ad23f783fd648305c40927 100644
--- a/Documentation/hwmon/sht21.rst
+++ b/Documentation/hwmon/sht21.rst
@@ -2,6 +2,17 @@ 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
diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
index 97327313529b467ed89d8f6b06c2d78efd54efbf..a2748659edc262dac9d87771f849a4fc0a29d981 100644
--- a/drivers/hwmon/sht21.c
+++ b/drivers/hwmon/sht21.c
@@ -275,7 +275,10 @@ static int sht21_probe(struct i2c_client *client)
/* Device ID table */
static const struct i2c_device_id sht21_id[] = {
+ { "sht20" },
{ "sht21" },
+ { "sht25" },
+ { "sht2x" },
{ }
};
MODULE_DEVICE_TABLE(i2c, sht21_id);
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
2025-09-07 22:06 ` [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips Kurt Borja
@ 2025-09-07 22:19 ` Guenter Roeck
2025-09-07 22:45 ` Kurt Borja
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2025-09-07 22:19 UTC (permalink / raw)
To: Kurt Borja, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On 9/7/25 15:06, Kurt Borja wrote:
> 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 | 11 +++++++++++
> drivers/hwmon/sht21.c | 3 +++
> 2 files changed, 14 insertions(+)
>
> diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst
> index 1bccc8e8aac8d3532ec17dcdbc6a172102877085..65f85ca68ecac1cba6ad23f783fd648305c40927 100644
> --- a/Documentation/hwmon/sht21.rst
> +++ b/Documentation/hwmon/sht21.rst
> @@ -2,6 +2,17 @@ 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
> +
> +
Too many empty lines.
Please add SHT20 to Kconfig as well.
>
> * Sensirion SHT21
>
> diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
> index 97327313529b467ed89d8f6b06c2d78efd54efbf..a2748659edc262dac9d87771f849a4fc0a29d981 100644
> --- a/drivers/hwmon/sht21.c
> +++ b/drivers/hwmon/sht21.c
> @@ -275,7 +275,10 @@ static int sht21_probe(struct i2c_client *client)
>
> /* Device ID table */
> static const struct i2c_device_id sht21_id[] = {
> + { "sht20" },
> { "sht21" },
> + { "sht25" },
> + { "sht2x" },
AFAICS there is no sht2x chip.
> { }
> };
> MODULE_DEVICE_TABLE(i2c, sht21_id);
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
2025-09-07 22:19 ` Guenter Roeck
@ 2025-09-07 22:45 ` Kurt Borja
2025-09-07 22:54 ` Guenter Roeck
0 siblings, 1 reply; 10+ messages in thread
From: Kurt Borja @ 2025-09-07 22:45 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On Sun Sep 7, 2025 at 5:19 PM -05, Guenter Roeck wrote:
> On 9/7/25 15:06, Kurt Borja wrote:
>> 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 | 11 +++++++++++
>> drivers/hwmon/sht21.c | 3 +++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst
>> index 1bccc8e8aac8d3532ec17dcdbc6a172102877085..65f85ca68ecac1cba6ad23f783fd648305c40927 100644
>> --- a/Documentation/hwmon/sht21.rst
>> +++ b/Documentation/hwmon/sht21.rst
>> @@ -2,6 +2,17 @@ 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
>> +
>> +
>
> Too many empty lines.
The next entries are also separated by 3 lines. I did it like that for
symmetry.
>
> Please add SHT20 to Kconfig as well.
Sure!
>
>>
>> * Sensirion SHT21
>>
>> diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
>> index 97327313529b467ed89d8f6b06c2d78efd54efbf..a2748659edc262dac9d87771f849a4fc0a29d981 100644
>> --- a/drivers/hwmon/sht21.c
>> +++ b/drivers/hwmon/sht21.c
>> @@ -275,7 +275,10 @@ static int sht21_probe(struct i2c_client *client)
>>
>> /* Device ID table */
>> static const struct i2c_device_id sht21_id[] = {
>> + { "sht20" },
>> { "sht21" },
>> + { "sht25" },
>> + { "sht2x" },
>
> AFAICS there is no sht2x chip.
>
>
>> { }
>> };
>> MODULE_DEVICE_TABLE(i2c, sht21_id);
>>
--
~ Kurt
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
2025-09-07 22:45 ` Kurt Borja
@ 2025-09-07 22:54 ` Guenter Roeck
0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2025-09-07 22:54 UTC (permalink / raw)
To: Kurt Borja, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On 9/7/25 15:45, Kurt Borja wrote:
> On Sun Sep 7, 2025 at 5:19 PM -05, Guenter Roeck wrote:
>> On 9/7/25 15:06, Kurt Borja wrote:
>>> 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 | 11 +++++++++++
>>> drivers/hwmon/sht21.c | 3 +++
>>> 2 files changed, 14 insertions(+)
>>>
>>> diff --git a/Documentation/hwmon/sht21.rst b/Documentation/hwmon/sht21.rst
>>> index 1bccc8e8aac8d3532ec17dcdbc6a172102877085..65f85ca68ecac1cba6ad23f783fd648305c40927 100644
>>> --- a/Documentation/hwmon/sht21.rst
>>> +++ b/Documentation/hwmon/sht21.rst
>>> @@ -2,6 +2,17 @@ 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
>>> +
>>> +
>>
>> Too many empty lines.
>
> The next entries are also separated by 3 lines. I did it like that for
> symmetry.
>
Two wrongs don't make it right.
Guenter
>>
>> Please add SHT20 to Kconfig as well.
>
> Sure!
>
>>
>>>
>>> * Sensirion SHT21
>>>
>>> diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
>>> index 97327313529b467ed89d8f6b06c2d78efd54efbf..a2748659edc262dac9d87771f849a4fc0a29d981 100644
>>> --- a/drivers/hwmon/sht21.c
>>> +++ b/drivers/hwmon/sht21.c
>>> @@ -275,7 +275,10 @@ static int sht21_probe(struct i2c_client *client)
>>>
>>> /* Device ID table */
>>> static const struct i2c_device_id sht21_id[] = {
>>> + { "sht20" },
>>> { "sht21" },
>>> + { "sht25" },
>>> + { "sht2x" },
>>
>> AFAICS there is no sht2x chip.
>>
>>
>>> { }
>>> };
>>> MODULE_DEVICE_TABLE(i2c, sht21_id);
>>>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] hwmon: (sht21) Add devicetree support
2025-09-07 22:06 [PATCH 0/3] hwmon: (sht21) Add devicetree support Kurt Borja
2025-09-07 22:06 ` [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips Kurt Borja
@ 2025-09-07 22:06 ` Kurt Borja
2025-09-07 22:19 ` Guenter Roeck
2025-09-07 22:06 ` [PATCH 3/3] dt-bindings: trivial-devices: Add sht2x sensors Kurt Borja
2 siblings, 1 reply; 10+ messages in thread
From: Kurt Borja @ 2025-09-07 22:06 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree,
Kurt Borja
Add DT support for sht2x chips.
Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
drivers/hwmon/sht21.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
index a2748659edc262dac9d87771f849a4fc0a29d981..9813e04f60430f8e60f614d9c68785428978c4a4 100644
--- a/drivers/hwmon/sht21.c
+++ b/drivers/hwmon/sht21.c
@@ -283,8 +283,16 @@ 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,sht2x" },
+ { }
+};
+
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,
};
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] hwmon: (sht21) Add devicetree support
2025-09-07 22:06 ` [PATCH 2/3] hwmon: (sht21) Add devicetree support Kurt Borja
@ 2025-09-07 22:19 ` Guenter Roeck
2025-09-07 22:48 ` Kurt Borja
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2025-09-07 22:19 UTC (permalink / raw)
To: Kurt Borja, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On 9/7/25 15:06, Kurt Borja wrote:
> Add DT support for sht2x chips.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> drivers/hwmon/sht21.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
> index a2748659edc262dac9d87771f849a4fc0a29d981..9813e04f60430f8e60f614d9c68785428978c4a4 100644
> --- a/drivers/hwmon/sht21.c
> +++ b/drivers/hwmon/sht21.c
> @@ -283,8 +283,16 @@ 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,sht2x" },
This should be individual entries, not a placeholder for multiple chips.
> + { }
> +};
> +
> 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,
> };
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] hwmon: (sht21) Add devicetree support
2025-09-07 22:19 ` Guenter Roeck
@ 2025-09-07 22:48 ` Kurt Borja
0 siblings, 0 replies; 10+ messages in thread
From: Kurt Borja @ 2025-09-07 22:48 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On Sun Sep 7, 2025 at 5:19 PM -05, Guenter Roeck wrote:
> On 9/7/25 15:06, Kurt Borja wrote:
>> Add DT support for sht2x chips.
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
>> ---
>> drivers/hwmon/sht21.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
>> index a2748659edc262dac9d87771f849a4fc0a29d981..9813e04f60430f8e60f614d9c68785428978c4a4 100644
>> --- a/drivers/hwmon/sht21.c
>> +++ b/drivers/hwmon/sht21.c
>> @@ -283,8 +283,16 @@ 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,sht2x" },
>
> This should be individual entries, not a placeholder for multiple chips.
Sure! I'll add an entry for each chip.
FWIW sensirion also uses sht2x as a placeholder in datasheets.
Thanks for your review!
>
>> + { }
>> +};
>> +
>> 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,
>> };
>>
--
~ Kurt
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] dt-bindings: trivial-devices: Add sht2x sensors
2025-09-07 22:06 [PATCH 0/3] hwmon: (sht21) Add devicetree support Kurt Borja
2025-09-07 22:06 ` [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips Kurt Borja
2025-09-07 22:06 ` [PATCH 2/3] hwmon: (sht21) Add devicetree support Kurt Borja
@ 2025-09-07 22:06 ` Kurt Borja
2025-09-07 22:20 ` Guenter Roeck
2 siblings, 1 reply; 10+ messages in thread
From: Kurt Borja @ 2025-09-07 22:06 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree,
Kurt Borja
Add sensirion,sht2x trivial sensors.
Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
Documentation/devicetree/bindings/trivial-devices.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index f3dd18681aa6f81255141bdda6daf8e45369a2c2..736b8b6819036a183f26f84dc489ce27ec7d8bc4 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -362,6 +362,7 @@ properties:
# Sensirion low power multi-pixel gas sensor with I2C interface
- sensirion,sgpc3
# Sensirion temperature & humidity sensor with I2C interface
+ - sensirion,sht2x
- sensirion,sht4x
# Sensortek 3 axis accelerometer
- sensortek,stk8312
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 3/3] dt-bindings: trivial-devices: Add sht2x sensors
2025-09-07 22:06 ` [PATCH 3/3] dt-bindings: trivial-devices: Add sht2x sensors Kurt Borja
@ 2025-09-07 22:20 ` Guenter Roeck
0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2025-09-07 22:20 UTC (permalink / raw)
To: Kurt Borja, Jean Delvare, Jonathan Corbet, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: stable, linux-hwmon, linux-doc, linux-kernel, devicetree
On 9/7/25 15:06, Kurt Borja wrote:
> Add sensirion,sht2x trivial sensors.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> Documentation/devicetree/bindings/trivial-devices.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index f3dd18681aa6f81255141bdda6daf8e45369a2c2..736b8b6819036a183f26f84dc489ce27ec7d8bc4 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -362,6 +362,7 @@ properties:
> # Sensirion low power multi-pixel gas sensor with I2C interface
> - sensirion,sgpc3
> # Sensirion temperature & humidity sensor with I2C interface
> + - sensirion,sht2x
I think this should list the individual chips, not a "x" placeholder.
> - sensirion,sht4x
> # Sensortek 3 axis accelerometer
> - sensortek,stk8312
>
^ permalink raw reply [flat|nested] 10+ messages in thread