* [PATCH v2 0/3] hwmon: (lm75) add MAX31875 support
@ 2026-09-24 8:41 John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875 John Erasmus Mari Geronimo
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: John Erasmus Mari Geronimo @ 2026-09-24 8:41 UTC (permalink / raw)
To: Guenter Roeck
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Jean Delvare, linux-hwmon, devicetree, linux-kernel,
linux-doc
Add support for the Analog Devices MAX31875 I2C temperature sensor by
extending the existing lm75 driver.
The MAX31875 provides a 16-bit configuration register, selectable
resolution of 8, 9, 10, or 12 bits, conversion rates of 125 ms, 250 ms,
1 s, or 4 s, and an alarm output.
As suggested by Guenter Roeck, this version reworks the implementation
to extend the existing lm75 driver instead of max31827, since the
MAX31875 is another LM75 variant (similar to max31725/max31726) rather
than a max31827-family part.
Changes since v1:
- Rework the implementation to use the existing lm75 driver instead of
the previously selected max31827 base driver.
- Add the MAX31875 Device Tree binding, documentation, and driver
configuration for resolution, conversion rate, and alarm reporting.
John Erasmus Mari Geronimo (3):
dt-bindings: hwmon: lm75: add MAX31875
hwmon: (lm75) add MAX31875 documentation
hwmon: (lm75) add MAX31875 support
.../devicetree/bindings/hwmon/lm75.yaml | 1 +
Documentation/hwmon/lm75.rst | 6 +++--
drivers/hwmon/Kconfig | 2 +-
drivers/hwmon/lm75.c | 25 +++++++++++++++++++
4 files changed, 31 insertions(+), 3 deletions(-)
base-commit: 9955c92abe72564a49c293b1c15cd3b4f02ea6a0
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875
2026-09-24 8:41 [PATCH v2 0/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
@ 2026-09-24 8:41 ` John Erasmus Mari Geronimo
2026-09-24 16:59 ` Conor Dooley
2026-09-24 8:41 ` [PATCH v2 2/3] hwmon: (lm75) add MAX31875 documentation John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2 siblings, 1 reply; 6+ messages in thread
From: John Erasmus Mari Geronimo @ 2026-09-24 8:41 UTC (permalink / raw)
To: Guenter Roeck
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Jean Delvare, linux-hwmon, devicetree, linux-kernel,
linux-doc
Add MAX31875 compatible string to lm75 dt-bindings.
Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
---
Documentation/devicetree/bindings/hwmon/lm75.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index b48bf3fd721fe..d56f3ec299105 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -14,6 +14,7 @@ properties:
compatible:
enum:
- adi,adt75
+ - adi,max31875
- ams,as6200
- atmel,at30ts74
- dallas,ds1775
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] hwmon: (lm75) add MAX31875 documentation
2026-09-24 8:41 [PATCH v2 0/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875 John Erasmus Mari Geronimo
@ 2026-09-24 8:41 ` John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2 siblings, 0 replies; 6+ messages in thread
From: John Erasmus Mari Geronimo @ 2026-09-24 8:41 UTC (permalink / raw)
To: Guenter Roeck
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Jean Delvare, linux-hwmon, devicetree, linux-kernel,
linux-doc
Document the Maxim MAX31875 I2C temperature sensor as a supported
chip in the lm75 driver documentation.
Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
---
Documentation/hwmon/lm75.rst | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
index ca46754e028b3..54a6a75e8a71b 100644
--- a/Documentation/hwmon/lm75.rst
+++ b/Documentation/hwmon/lm75.rst
@@ -66,9 +66,9 @@ Supported chips:
http://www.microchip.com/
- * Analog Devices ADT75
+ * Analog Devices ADT75, MAX31875
- Prefix: 'adt75'
+ Prefix: 'adt75', 'max31875'
Addresses scanned: none
@@ -76,6 +76,8 @@ Supported chips:
https://www.analog.com/adt75
+ https://www.analog.com/max31875
+
* ST Microelectronics STDS75
Prefix: 'stds75'
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support
2026-09-24 8:41 [PATCH v2 0/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875 John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 2/3] hwmon: (lm75) add MAX31875 documentation John Erasmus Mari Geronimo
@ 2026-09-24 8:41 ` John Erasmus Mari Geronimo
2026-09-24 16:46 ` Guenter Roeck
2 siblings, 1 reply; 6+ messages in thread
From: John Erasmus Mari Geronimo @ 2026-09-24 8:41 UTC (permalink / raw)
To: Guenter Roeck
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Jean Delvare, linux-hwmon, devicetree, linux-kernel,
linux-doc
Add support for the Maxim MAX31875 I2C temperature sensor by
extending the lm75 driver. The MAX31875 features a 16-bit
configuration register, configurable resolution (8, 9, 10, or
12 bits), and selectable conversion rates (125ms, 250ms, 1s, 4s).
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
---
drivers/hwmon/Kconfig | 2 +-
drivers/hwmon/lm75.c | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index e4c4f2b09732d..c68b6c3c2f866 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1525,7 +1525,7 @@ config SENSORS_LM75
If you say yes here you get support for one common type of
temperature sensor chip, with models including:
- - Analog Devices ADT75
+ - Analog Devices ADT75, MAX31875
- Atmel (now Microchip) AT30TS74
- Dallas Semiconductor DS75, DS1775 and DS7505
- Global Mixed-mode Technology (GMT) G751
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 104149a03bad0..886f83c8b0420 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -39,6 +39,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
max6625,
max6626,
max31725,
+ max31875,
mcp980x,
p3t1750,
p3t1755,
@@ -223,6 +224,15 @@ static const struct lm75_params device_params[] = {
.default_resolution = 16,
.default_sample_time = MSEC_PER_SEC / 20,
},
+ [max31875] = {
+ .config_reg_16bits = true,
+ .default_resolution = 10,
+ .resolutions = (u8 []) {8, 9, 10, 12 },
+ .default_sample_time = 4000,
+ .num_sample_times = 4,
+ .sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
+ .alarm = true,
+ },
[tcn75] = {
.default_resolution = 9,
.default_sample_time = MSEC_PER_SEC / 18,
@@ -421,6 +431,9 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
case tmp112:
*val = !!(regval & BIT(13)) == !!(regval & BIT(2));
break;
+ case max31875:
+ *val = (regval >> 7) & 0x1;
+ break;
default:
return -EINVAL;
}
@@ -495,6 +508,13 @@ static int lm75_update_interval(struct device *dev, long val)
return err;
data->sample_time = data->params->sample_times[index];
break;
+ case max31875:
+ err = regmap_update_bits(data->regmap, LM75_REG_CONF,
+ 0x0600, (3 - index) << 9);
+ if (err < 0)
+ return err;
+ data->sample_time = data->params->sample_times[index];
+ break;
case pct2075:
err = regmap_write(data->regmap, PCT2075_REG_IDLE, index + 1);
if (err)
@@ -848,6 +868,7 @@ static const struct i2c_device_id lm75_i2c_ids[] = {
{ .name = "max6626", .driver_data = max6626 },
{ .name = "max31725", .driver_data = max31725 },
{ .name = "max31726", .driver_data = max31725 },
+ { .name = "max31875", .driver_data = max31875 },
{ .name = "mcp980x", .driver_data = mcp980x },
{ .name = "p3t1750", .driver_data = p3t1750 },
{ .name = "p3t1755", .driver_data = p3t1755 },
@@ -905,6 +926,10 @@ static const struct of_device_id lm75_of_match[] = {
.compatible = "adi,adt75",
.data = (void *)adt75
},
+ {
+ .compatible = "adi,max31875",
+ .data = (void *)max31875
+ },
{
.compatible = "ams,as6200",
.data = (void *)as6200
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support
2026-09-24 8:41 ` [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
@ 2026-09-24 16:46 ` Guenter Roeck
0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2026-09-24 16:46 UTC (permalink / raw)
To: John Erasmus Mari Geronimo
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Jean Delvare, linux-hwmon, devicetree, linux-kernel,
linux-doc
On Thu, Sep 24, 2026 at 04:41:21PM +0800, John Erasmus Mari Geronimo wrote:
> Add support for the Maxim MAX31875 I2C temperature sensor by
> extending the lm75 driver. The MAX31875 features a 16-bit
> configuration register, configurable resolution (8, 9, 10, or
> 12 bits), and selectable conversion rates (125ms, 250ms, 1s, 4s).
>
> Suggested-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
> ---
> drivers/hwmon/Kconfig | 2 +-
> drivers/hwmon/lm75.c | 25 +++++++++++++++++++++++++
> 2 files changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index e4c4f2b09732d..c68b6c3c2f866 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -1525,7 +1525,7 @@ config SENSORS_LM75
> If you say yes here you get support for one common type of
> temperature sensor chip, with models including:
>
> - - Analog Devices ADT75
> + - Analog Devices ADT75, MAX31875
> - Atmel (now Microchip) AT30TS74
> - Dallas Semiconductor DS75, DS1775 and DS7505
> - Global Mixed-mode Technology (GMT) G751
> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
> index 104149a03bad0..886f83c8b0420 100644
> --- a/drivers/hwmon/lm75.c
> +++ b/drivers/hwmon/lm75.c
> @@ -39,6 +39,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
> max6625,
> max6626,
> max31725,
> + max31875,
> mcp980x,
> p3t1750,
> p3t1755,
> @@ -223,6 +224,15 @@ static const struct lm75_params device_params[] = {
> .default_resolution = 16,
> .default_sample_time = MSEC_PER_SEC / 20,
> },
> + [max31875] = {
> + .config_reg_16bits = true,
> + .default_resolution = 10,
> + .resolutions = (u8 []) {8, 9, 10, 12 },
This isn't how resolutions vs. sample time is supposed to be handled.
For most of the lm75 compatible chips, the sample time is associated
with the resolution: Changing the sample time changes the resolution.
This is not the case here: the chip has separate configuration register
bits for sample time and resolution, and the resolution does not change
automatically if the sample time changes. The above associates
8/9/10/12 bit resolution with the 125/250/1000/4000 sample times,
which is wrong. Instead, .resolutions should not be set at all,
reflecting the default 10 bit resolution.
> + .default_sample_time = 4000,
> + .num_sample_times = 4,
> + .sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
> + .alarm = true,
> + },
> [tcn75] = {
> .default_resolution = 9,
> .default_sample_time = MSEC_PER_SEC / 18,
> @@ -421,6 +431,9 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
> case tmp112:
> *val = !!(regval & BIT(13)) == !!(regval & BIT(2));
> break;
> + case max31875:
> + *val = (regval >> 7) & 0x1;
Please use
*val = !!(regval & BIT(7));
to match the rest of the code.
Thanks,
Guenter
> + break;
> default:
> return -EINVAL;
> }
> @@ -495,6 +508,13 @@ static int lm75_update_interval(struct device *dev, long val)
> return err;
> data->sample_time = data->params->sample_times[index];
> break;
> + case max31875:
> + err = regmap_update_bits(data->regmap, LM75_REG_CONF,
> + 0x0600, (3 - index) << 9);
> + if (err < 0)
> + return err;
> + data->sample_time = data->params->sample_times[index];
> + break;
> case pct2075:
> err = regmap_write(data->regmap, PCT2075_REG_IDLE, index + 1);
> if (err)
> @@ -848,6 +868,7 @@ static const struct i2c_device_id lm75_i2c_ids[] = {
> { .name = "max6626", .driver_data = max6626 },
> { .name = "max31725", .driver_data = max31725 },
> { .name = "max31726", .driver_data = max31725 },
> + { .name = "max31875", .driver_data = max31875 },
> { .name = "mcp980x", .driver_data = mcp980x },
> { .name = "p3t1750", .driver_data = p3t1750 },
> { .name = "p3t1755", .driver_data = p3t1755 },
> @@ -905,6 +926,10 @@ static const struct of_device_id lm75_of_match[] = {
> .compatible = "adi,adt75",
> .data = (void *)adt75
> },
> + {
> + .compatible = "adi,max31875",
> + .data = (void *)max31875
> + },
> {
> .compatible = "ams,as6200",
> .data = (void *)as6200
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875
2026-09-24 8:41 ` [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875 John Erasmus Mari Geronimo
@ 2026-09-24 16:59 ` Conor Dooley
0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-09-24 16:59 UTC (permalink / raw)
To: John Erasmus Mari Geronimo
Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jonathan Corbet, Shuah Khan, Jean Delvare, linux-hwmon,
devicetree, linux-kernel, linux-doc
[-- Attachment #1: Type: text/plain, Size: 993 bytes --]
On Thu, Sep 24, 2026 at 04:41:19PM +0800, John Erasmus Mari Geronimo wrote:
> Add MAX31875 compatible string to lm75 dt-bindings.
Commit message should explain why this is not compatible with exisiting
devices.
pw-bot: changes-requested
With one,
Acked-by: Conor Dooley <conor.dooley@microchip.com>
>
> Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
> ---
> Documentation/devicetree/bindings/hwmon/lm75.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> index b48bf3fd721fe..d56f3ec299105 100644
> --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> @@ -14,6 +14,7 @@ properties:
> compatible:
> enum:
> - adi,adt75
> + - adi,max31875
> - ams,as6200
> - atmel,at30ts74
> - dallas,ds1775
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-24 16:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 8:41 [PATCH v2 0/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 1/3] dt-bindings: hwmon: lm75: add MAX31875 John Erasmus Mari Geronimo
2026-09-24 16:59 ` Conor Dooley
2026-09-24 8:41 ` [PATCH v2 2/3] hwmon: (lm75) add MAX31875 documentation John Erasmus Mari Geronimo
2026-09-24 8:41 ` [PATCH v2 3/3] hwmon: (lm75) add MAX31875 support John Erasmus Mari Geronimo
2026-09-24 16:46 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®