* [PATCH] hwmon: (sht3x) add support for SHT85
@ 2025-12-09 17:58 Antoni Pokusinski
2025-12-09 21:19 ` Guenter Roeck
0 siblings, 1 reply; 5+ messages in thread
From: Antoni Pokusinski @ 2025-12-09 17:58 UTC (permalink / raw)
To: jdelvare, linux, corbet
Cc: linux-hwmon, linux-doc, linux-kernel, Antoni Pokusinski
SHT85 is a temperature and humidity sensor with an interface very
similar to SHT3x. However, it does not feature alerts (and therefore
limits).
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
---
Documentation/hwmon/sht3x.rst | 11 ++++++++++-
drivers/hwmon/sht3x.c | 26 +++++++++++++++++---------
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/Documentation/hwmon/sht3x.rst b/Documentation/hwmon/sht3x.rst
index 9585fa7c5a5d..25c7428f0a77 100644
--- a/Documentation/hwmon/sht3x.rst
+++ b/Documentation/hwmon/sht3x.rst
@@ -23,6 +23,15 @@ Supported chips:
- https://sensirion.com/media/documents/1DA31AFD/61641F76/Sensirion_Temperature_Sensors_STS3x_Datasheet.pdf
- https://sensirion.com/media/documents/292A335C/65537BAF/Sensirion_Datasheet_STS32_STS33.pdf
+ * Sensirion SHT85
+
+ Prefix: 'sht85'
+
+ Addresses scanned: none
+
+ Datasheets:
+ - https://sensirion.com/media/documents/4B40CEF3/640B2346/Sensirion_Humidity_Sensors_SHT85_Datasheet.pdf
+
Author:
- David Frey <david.frey@sensirion.com>
@@ -31,7 +40,7 @@ Author:
Description
-----------
-This driver implements support for the Sensirion SHT3x-DIS and STS3x-DIS
+This driver implements support for the Sensirion SHT3x-DIS, STS3x-DIS and SHT85
series of humidity and temperature sensors. Temperature is measured in degrees
celsius, relative humidity is expressed as a percentage. In the sysfs interface,
all values are scaled by 1000, i.e. the value for 31.5 degrees celsius is 31500.
diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
index f36c0229328f..eff915d31452 100644
--- a/drivers/hwmon/sht3x.c
+++ b/drivers/hwmon/sht3x.c
@@ -63,6 +63,7 @@ static const unsigned char sht3x_cmd_read_serial_number[] = { 0x37, 0x80 };
enum sht3x_chips {
sht3x,
sts3x,
+ sht85,
};
enum sht3x_limits {
@@ -668,6 +669,8 @@ static umode_t sht3x_is_visible(const void *data, enum hwmon_sensor_types type,
}
break;
case hwmon_temp:
+ if (chip_data->chip_id == sht85 && attr != hwmon_temp_input)
+ break;
switch (attr) {
case hwmon_temp_input:
case hwmon_temp_alarm:
@@ -684,6 +687,8 @@ static umode_t sht3x_is_visible(const void *data, enum hwmon_sensor_types type,
case hwmon_humidity:
if (chip_data->chip_id == sts3x)
break;
+ if (chip_data->chip_id == sht85 && attr != hwmon_humidity_input)
+ break;
switch (attr) {
case hwmon_humidity_input:
case hwmon_humidity_alarm:
@@ -908,16 +913,18 @@ static int sht3x_probe(struct i2c_client *client)
mutex_init(&data->i2c_lock);
mutex_init(&data->data_lock);
- /*
- * An attempt to read limits register too early
- * causes a NACK response from the chip.
- * Waiting for an empirical delay of 500 us solves the issue.
- */
- usleep_range(500, 600);
+ if (data->chip_id == sht3x || data->chip_id == sts3x) {
+ /*
+ * An attempt to read limits register too early
+ * causes a NACK response from the chip.
+ * Waiting for an empirical delay of 500 us solves the issue.
+ */
+ usleep_range(500, 600);
- ret = limits_update(data);
- if (ret)
- return ret;
+ ret = limits_update(data);
+ if (ret)
+ return ret;
+ }
hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, data,
&sht3x_chip_info, sht3x_groups);
@@ -933,6 +940,7 @@ static int sht3x_probe(struct i2c_client *client)
static const struct i2c_device_id sht3x_ids[] = {
{"sht3x", sht3x},
{"sts3x", sts3x},
+ {"sht85", sht85},
{}
};
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] hwmon: (sht3x) add support for SHT85
2025-12-09 17:58 [PATCH] hwmon: (sht3x) add support for SHT85 Antoni Pokusinski
@ 2025-12-09 21:19 ` Guenter Roeck
2025-12-10 3:09 ` Guenter Roeck
0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2025-12-09 21:19 UTC (permalink / raw)
To: Antoni Pokusinski, jdelvare, corbet; +Cc: linux-hwmon, linux-doc, linux-kernel
On 12/9/25 09:58, Antoni Pokusinski wrote:
> SHT85 is a temperature and humidity sensor with an interface very
> similar to SHT3x. However, it does not feature alerts (and therefore
> limits).
>
The datasheet does suggest that the chip supports both temperature and
humidity tracking alert status, which only makes sense if the chip
supports alert limits. It does not support an alert _pin_, but that
doesn't mean that it does not support limits. I'll want to see definite
confirmation that the chip does not support the limit commands.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hwmon: (sht3x) add support for SHT85
2025-12-09 21:19 ` Guenter Roeck
@ 2025-12-10 3:09 ` Guenter Roeck
2025-12-10 21:44 ` Antoni Pokusinski
0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2025-12-10 3:09 UTC (permalink / raw)
To: Antoni Pokusinski, jdelvare, corbet; +Cc: linux-hwmon, linux-doc, linux-kernel
On 12/9/25 13:19, Guenter Roeck wrote:
> On 12/9/25 09:58, Antoni Pokusinski wrote:
>> SHT85 is a temperature and humidity sensor with an interface very
>> similar to SHT3x. However, it does not feature alerts (and therefore
>> limits).
>>
>
> The datasheet does suggest that the chip supports both temperature and
> humidity tracking alert status, which only makes sense if the chip
> supports alert limits. It does not support an alert _pin_, but that
> doesn't mean that it does not support limits. I'll want to see definite
> confirmation that the chip does not support the limit commands.
>
Looking closer into the SHT85 datasheet, the sensor chip is actually a SHT35.
Given that, disabling limit attributes and alarms is neither necessary
nor acceptable. It isn't even necessary to add "sht85" to the device ID
table; sht3x works just fine. I don't mind if it is added, but it does
not need a new chip ID (at least until/unless interrupt support is added
to the driver).
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hwmon: (sht3x) add support for SHT85
2025-12-10 3:09 ` Guenter Roeck
@ 2025-12-10 21:44 ` Antoni Pokusinski
2025-12-10 21:56 ` Guenter Roeck
0 siblings, 1 reply; 5+ messages in thread
From: Antoni Pokusinski @ 2025-12-10 21:44 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-hwmon, linux-doc, linux-kernel
Hello Guenter,
Thanks for the quick review
On Tue, Dec 09, 2025 at 07:09:55PM -0800, Guenter Roeck wrote:
> On 12/9/25 13:19, Guenter Roeck wrote:
> > On 12/9/25 09:58, Antoni Pokusinski wrote:
> > > SHT85 is a temperature and humidity sensor with an interface very
> > > similar to SHT3x. However, it does not feature alerts (and therefore
> > > limits).
> > >
> >
> > The datasheet does suggest that the chip supports both temperature and
> > humidity tracking alert status, which only makes sense if the chip
> > supports alert limits. It does not support an alert _pin_, but that
> > doesn't mean that it does not support limits. I'll want to see definite
> > confirmation that the chip does not support the limit commands.
> >
>
> Looking closer into the SHT85 datasheet, the sensor chip is actually a SHT35.
> Given that, disabling limit attributes and alarms is neither necessary
> nor acceptable. It isn't even necessary to add "sht85" to the device ID
> table; sht3x works just fine. I don't mind if it is added, but it does
> not need a new chip ID (at least until/unless interrupt support is added
> to the driver).
>
> Thanks,
> Guenter
>
I've just tested the SHT85 sensor with the non-modified sht3x driver and
the limits and alerts work fine indeed. I was a bit confused by the SHT85
datasheet which does not explicitly mention the limit commands, that's
why I excluded them in the patch, sorry for the confusion.
I guess I could simply add {"sht85", sht3x} entry to the i2c_device_id[],
this would also indicate clearly that sht85 is supported by this driver.
Kind regards,
Antoni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hwmon: (sht3x) add support for SHT85
2025-12-10 21:44 ` Antoni Pokusinski
@ 2025-12-10 21:56 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2025-12-10 21:56 UTC (permalink / raw)
To: Antoni Pokusinski; +Cc: linux-hwmon, linux-doc, linux-kernel
On 12/10/25 13:44, Antoni Pokusinski wrote:
>
> Hello Guenter,
> Thanks for the quick review
>
> On Tue, Dec 09, 2025 at 07:09:55PM -0800, Guenter Roeck wrote:
>> On 12/9/25 13:19, Guenter Roeck wrote:
>>> On 12/9/25 09:58, Antoni Pokusinski wrote:
>>>> SHT85 is a temperature and humidity sensor with an interface very
>>>> similar to SHT3x. However, it does not feature alerts (and therefore
>>>> limits).
>>>>
>>>
>>> The datasheet does suggest that the chip supports both temperature and
>>> humidity tracking alert status, which only makes sense if the chip
>>> supports alert limits. It does not support an alert _pin_, but that
>>> doesn't mean that it does not support limits. I'll want to see definite
>>> confirmation that the chip does not support the limit commands.
>>>
>>
>> Looking closer into the SHT85 datasheet, the sensor chip is actually a SHT35.
>> Given that, disabling limit attributes and alarms is neither necessary
>> nor acceptable. It isn't even necessary to add "sht85" to the device ID
>> table; sht3x works just fine. I don't mind if it is added, but it does
>> not need a new chip ID (at least until/unless interrupt support is added
>> to the driver).
>>
>> Thanks,
>> Guenter
>>
> I've just tested the SHT85 sensor with the non-modified sht3x driver and
> the limits and alerts work fine indeed. I was a bit confused by the SHT85
> datasheet which does not explicitly mention the limit commands, that's
> why I excluded them in the patch, sorry for the confusion.
>
No problem.
> I guess I could simply add {"sht85", sht3x} entry to the i2c_device_id[],
> this would also indicate clearly that sht85 is supported by this driver.
>
Yes, please do that, and add a note to the documentation and Kconfig.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-12-10 21:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 17:58 [PATCH] hwmon: (sht3x) add support for SHT85 Antoni Pokusinski
2025-12-09 21:19 ` Guenter Roeck
2025-12-10 3:09 ` Guenter Roeck
2025-12-10 21:44 ` Antoni Pokusinski
2025-12-10 21:56 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).