[PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips

Kurt Borja posted 3 patches 1 day, 18 hours ago
There is a newer version of this series
[PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
Posted by Kurt Borja 1 day, 18 hours ago
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
Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
Posted by Guenter Roeck 1 day, 18 hours ago
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);
>
Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
Posted by Kurt Borja 1 day, 17 hours ago
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
Re: [PATCH 1/3] hwmon: (sht21) Add support for all sht2x chips
Posted by Guenter Roeck 1 day, 17 hours ago
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);
>>>
> 
>