|
| 1 | +.. SPDX-License-Identifier: GPL-2.0 |
| 2 | +
|
| 3 | +Kernel driver max31875 |
| 4 | +====================== |
| 5 | + |
| 6 | +Supported chips: |
| 7 | + |
| 8 | + * Maxim MAX31875 |
| 9 | + |
| 10 | + Prefix: 'max31875' |
| 11 | + |
| 12 | + Addresses scanned: I2C 0x48 - 0x4f |
| 13 | + |
| 14 | + Datasheet: Publicly available at the Analog Devices website |
| 15 | + |
| 16 | + |
| 17 | +Authors: |
| 18 | + - John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com> |
| 19 | + |
| 20 | +Description |
| 21 | +----------- |
| 22 | + |
| 23 | +MAX31875 implements a temperature sensor with a 4 WLP packaging scheme. This |
| 24 | +sensor measures the temperature of the chip itself. |
| 25 | + |
| 26 | +MAX31875 has an over temperature alarm with an effective value and a hysteresis |
| 27 | +value: +80 and +75 degrees. |
| 28 | + |
| 29 | +The alarm can be configured in comparator and interrupt mode from the |
| 30 | +devicetree. In Comparator mode, the OT status bit have a value of 1 when the |
| 31 | +temperature rises above the T_OS value, which is also subject to the Fault Queue |
| 32 | +selection. OT status returns to 0 when the temperature drops below the T_HYST |
| 33 | +value or when shutdown mode is entered. |
| 34 | + |
| 35 | +In interrupt mode exceeding T_OS also sets OT status to 1, which remains set |
| 36 | +until a read operation is performed on any of the registers; at this point, it |
| 37 | +returns to 0. Once OT status is set to 1 from exceeding T_OS and reset, it is |
| 38 | +set to 1 again only when the temperature drops below T_HYST. The output remains |
| 39 | +asserted until it is reset by a read. It is set again if the temperature rises |
| 40 | +above T_OS, and so on. |
| 41 | + |
| 42 | +Putting the MAX31875 into shutdown mode also resets the OT status. Note that if |
| 43 | +the mode is changed while OT status is set, an OT status reset may be required |
| 44 | +before it begins to behave normally. To prevent this, it is recommended to |
| 45 | +perform a read of the configuration/status register to clear the status bits |
| 46 | +before changing the operating mode. |
| 47 | + |
| 48 | +The conversions can be manual with the one-shot functionality and automatic with |
| 49 | +a set frequency. When powered on, the chip measures temperatures with 0.25 |
| 50 | +conv/s. The conversion rate can be modified with update_interval attribute of |
| 51 | +the chip. Conversion/second = 1/update_interval. Thus, the available options |
| 52 | +according to the data sheet are: |
| 53 | + |
| 54 | +- 4000 (ms) = 0.25 conv/sec (default) |
| 55 | +- 1000 (ms) = 1 conv/sec |
| 56 | +- 250 (ms) = 4 conv/sec |
| 57 | +- 125 (ms) = 8 conv/sec |
| 58 | + |
| 59 | +Enabling the device when it is already enabled has the side effect of setting |
| 60 | +the conversion frequency to 0.25 conv/s. The conversion time varies depending on |
| 61 | +the resolution. |
| 62 | + |
| 63 | +The conversion time doubles with every bit of increased resolution. The |
| 64 | +available resolutions are: |
| 65 | + |
| 66 | +- 8 bit -> 8.75 ms conversion time |
| 67 | +- 9 bit -> 17.5 ms conversion time |
| 68 | +- 10 bit (default) -> 35 ms conversion time |
| 69 | +- 12 bit -> 140 ms conversion time |
| 70 | +- 13 bit (extended) -> 280 ms conversion time |
| 71 | + |
| 72 | +There is a temp1_resolution attribute which indicates the unit change in the |
| 73 | +input temperature in milli-degrees C. In extended format, the MSB is given a |
| 74 | +value of 128 degrees C (compared to normal format: 64 degrees C), which allows |
| 75 | +temperatures as high as 150 degrees C to be measured. |
| 76 | + |
| 77 | +- 1000 mC -> 8 bit |
| 78 | +- 500 mC -> 9 bit |
| 79 | +- 250 mC -> 10 bit (default) |
| 80 | +- 62 mC -> 12 bit - actually this is 62.5, but the file returns 62 |
| 81 | +- 62 mC -> 13 bit (extended) - actually this is 62.5, but the file returns 62 |
| 82 | + |
| 83 | +When chip is in shutdown mode and a read operation is requested, one-shot is |
| 84 | +triggered, the device waits for <conversion time> ms, and only after that is |
| 85 | +the temperature value register read. Note that the conversion times are rounded |
| 86 | +up to the nearest possible integer. |
| 87 | + |
| 88 | +The LSB of the temperature values is 0.0625 degrees Celsius, but the values of |
| 89 | +the temperatures are displayed in milli-degrees. This means, that some data is |
| 90 | +lost. The step between 2 consecutive values is 62 or 63. This effect can be seen |
| 91 | +in the writing of alarm values too. For positive numbers the user-input value |
| 92 | +will always be rounded down to the nearest possible value, for negative numbers |
| 93 | +the user-input will always be rounded up to the nearest possible value. |
| 94 | + |
| 95 | +Bus timeout resets the I2C-compatible interface when SCL is low for more than |
| 96 | +30ms (nominal). |
| 97 | + |
| 98 | +The Fault Queue bits select how many consecutive temperature faults must occur |
| 99 | +before overtemperature fault is indicated in the OT status bit. |
0 commit comments