Skip to content

hwmon: (lm75) add MAX31875 support

John Erasmus Mari Geronimo linux-devicetree linux-doc linux-hwmon lkml 3 versions – Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 3 repliesApplied
  2. v33 patches 0 repliesSuperseded
  3. v23 patches 2 repliesSuperseded

Changes in v4 from the cover letter

- driver: skip the alert polarity configuration for the MAX31875. It has no polarity bit, and the bit used for 16-bit chips is part of its conversion rate field.
- driver: set the default resolution and conversion rate at probe so the driver state matches the chip.
- The conversion rate field is D2:D1 of the configuration register (see the datasheet's Configuration Register Definition). It is read here as 0x0600 because the driver reads this register without byte swapping.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3dt-bindings: hwmon: lm75: add MAX31875Documentation/devicetree/bindings/hwmon/lm75.yaml+1 -01 reply
2/3hwmon: (lm75) add MAX31875 documentationDocumentation/hwmon/lm75.rst+4 -21 reply
3/3hwmon: (lm75) add MAX31875 supportdrivers/hwmon/Kconfig drivers/hwmon/lm75.c+30 -21 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchConor Dooley
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] hwmon: (lm75) add MAX31875 support

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.

Changes since v3:
- driver: skip the alert polarity configuration for the MAX31875. It has no polarity bit, and the bit used for 16-bit chips is part of its conversion rate field.
- driver: set the default resolution and conversion rate at probe so the driver state matches the chip.
- The conversion rate field is D2:D1 of the configuration register (see the datasheet's Configuration Register Definition). It is read here as 0x0600 because the driver reads this register without byte swapping.

Tested on a Raspberry Pi 4B with a MAX31875: defaults are restored at probe after the chip is set to 12-bit/125 ms, update_interval selects each of the four conversion rates without changing the resolution, and temp1_alarm follows temp1_max. This was run on the Raspberry Pi 6.12 tree, which reads the configuration register byte-swapped, so the equivalent bit positions were used there.

Changes since v2:
- dt-bindings: expand the commit message to explain why the MAX31875 needs its own compatible string instead of reusing an existing lm75-family one, and pick up Conor Dooley's Acked-by given conditional on that fix.
- driver: drop the .resolutions table, which incorrectly tied resolution to the sample-time index even though the two are independently configurable on this chip (Guenter Roeck).
- driver: use the BIT() idiom for the alarm bit read to match the rest of the file (Guenter Roeck).

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                          | 30 ++++++++++++++++++-
 4 files changed, 35 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1