Skip to content

Commit 4b56b21

Browse files
committed
drivers: hwmon: max31827: add max31875
Add support for MAX31875 Low-Power I2C Temperature Sensor in MAX31827 driver Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
1 parent b5df72b commit 4b56b21

File tree

2 files changed

+354
-79
lines changed

2 files changed

+354
-79
lines changed

Documentation/hwmon/max31827.rst

+30-10
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,18 @@ Supported chips:
2929

3030
Datasheet: Publicly available at the Analog Devices website
3131

32+
* Maxim MAX31875
33+
34+
Prefix: 'max31875'
35+
36+
Addresses scanned: I2C 0x48 - 0x4f
37+
38+
Datasheet: Publicly available at the Analog Devices website
39+
3240

3341
Authors:
3442
- Daniel Matyas <[email protected]>
43+
- John Erasmus Mari Geronimo <[email protected]>
3544

3645
Description
3746
-----------
@@ -45,13 +54,20 @@ configured to operate in the same manner with 1 write operation to the
4554
configuration register. From here on, we will refer to all these chips as
4655
MAX31827.
4756

48-
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme. This
49-
sensor measures the temperature of the chip itself.
57+
This driver also supports the MAX31875. Its fault queue is set to 1 and it has
58+
no alarm polarity.
59+
60+
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme while
61+
MAX31875 has a 4 WLP packaging scheme. This sensor measures the temperature of
62+
the chip itself.
5063

5164
MAX31827 has low and over temperature alarms with an effective value and a
5265
hysteresis value: -40 and -30 degrees for under temperature alarm and +100 and
5366
+90 degrees for over temperature alarm.
5467

68+
MAX31875 has only an over temperature alarm with an effective value and a
69+
hysteresis value: +80 and +75 degrees.
70+
5571
The alarm can be configured in comparator and interrupt mode from the
5672
devicetree. In Comparator mode, the OT/UT status bits have a value of 1 when the
5773
temperature rises above the TH value or falls below TL, which is also subject to
@@ -75,19 +91,22 @@ it is recommended to perform a read of the configuration/status register to
7591
clear the status bits before changing the operating mode.
7692

7793
The conversions can be manual with the one-shot functionality and automatic with
78-
a set frequency. When powered on, the chip measures temperatures with 1 conv/s.
94+
a set frequency. When powered on, the MAX31827 measures temperatures with 1
95+
conv/s while the MAX31875 measures temperatures with 0.25 conv/s or 1 conv/4s.
7996
The conversion rate can be modified with update_interval attribute of the chip.
8097
Conversion/second = 1/update_interval. Thus, the available options according to
8198
the data sheet are:
8299

83100
- 64000 (ms) = 1 conv/64 sec
84101
- 32000 (ms) = 1 conv/32 sec
85102
- 16000 (ms) = 1 conv/16 sec
86-
- 4000 (ms) = 1 conv/4 sec
87-
- 1000 (ms) = 1 conv/sec (default)
103+
- 4000 (ms) = 1 conv/4 sec (MAX31875 default)
104+
- 1000 (ms) = 1 conv/sec (MAX31827 default)
88105
- 250 (ms) = 4 conv/sec
89106
- 125 (ms) = 8 conv/sec
90107

108+
The MAX31875 only supports the last four values above.
109+
91110
Enabling the device when it is already enabled has the side effect of setting
92111
the conversion frequency to 1 conv/s. The conversion time varies depending on
93112
the resolution.
@@ -97,16 +116,16 @@ available resolutions are:
97116

98117
- 8 bit -> 8.75 ms conversion time
99118
- 9 bit -> 17.5 ms conversion time
100-
- 10 bit -> 35 ms conversion time
101-
- 12 bit (default) -> 140 ms conversion time
119+
- 10 bit (MAX31875 default) -> 35 ms conversion time
120+
- 12 bit (MAX31827 default) -> 140 ms conversion time
102121

103122
There is a temp1_resolution attribute which indicates the unit change in the
104123
input temperature in milli-degrees C.
105124

106125
- 1000 mC -> 8 bit
107126
- 500 mC -> 9 bit
108-
- 250 mC -> 10 bit
109-
- 62 mC -> 12 bit (default) - actually this is 62.5, but the fil returns 62
127+
- 250 mC -> 10 bit (MAX31875 default)
128+
- 62 mC -> 12 bit (MAX31827 default) - actually this is 62.5, but the fil returns 62
110129

111130
When chip is in shutdown mode and a read operation is requested, one-shot is
112131
triggered, the device waits for <conversion time> ms, and only after that is
@@ -125,7 +144,8 @@ Bus timeout resets the I2C-compatible interface when SCL is low for more than
125144

126145
Alarm polarity determines if the active state of the alarm is low or high. The
127146
behavior for both settings is dependent on the Fault Queue setting. The ALARM
128-
pin is an open-drain output and requires a pullup resistor to operate.
147+
pin is an open-drain output and requires a pullup resistor to operate. The
148+
MAX31875 does not have this feature.
129149

130150
The Fault Queue bits select how many consecutive temperature faults must occur
131151
before overtemperature or undertemperature faults are indicated in the

0 commit comments

Comments
 (0)