^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Kernel driver lm73
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) ==================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Texas Instruments LM73
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) Prefix: 'lm73'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Addresses scanned: I2C 0x48, 0x49, 0x4a, 0x4c, 0x4d, and 0x4e
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Datasheet: Publicly available at the Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) https://www.ti.com/product/lm73
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) Author: Guillaume Ligneul <guillaume.ligneul@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) Documentation: Chris Verges <kg4ysn@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) The LM73 is a digital temperature sensor. All temperature values are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) given in degrees Celsius.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Measurement Resolution Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) ------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) The LM73 supports four resolutions, defined in terms of degrees C per
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) LSB: 0.25, 0.125, 0.0625, and 0.3125. Changing the resolution mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) affects the conversion time of the LM73's analog-to-digital converter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) From userspace, the desired resolution can be specified as a function of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) conversion time via the 'update_interval' sysfs attribute for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) device. This attribute will normalize ranges of input values to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) maximum times defined for the resolution in the datasheet.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ============= ============= ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) Resolution Conv. Time Input Range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) (C/LSB) (msec) (msec)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ============= ============= ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 0.25 14 0..14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 0.125 28 15..28
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 0.0625 56 29..56
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 0.03125 112 57..infinity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ============= ============= ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) The following examples show how the 'update_interval' attribute can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) used to change the conversion time::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) $ echo 0 > update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) $ cat update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) $ cat temp1_input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 24250
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) $ echo 22 > update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) $ cat update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 28
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) $ cat temp1_input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 24125
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) $ echo 56 > update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) $ cat update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 56
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) $ cat temp1_input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 24062
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) $ echo 85 > update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) $ cat update_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 112
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) $ cat temp1_input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 24031
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) As shown here, the lm73 driver automatically adjusts any user input for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 'update_interval' via a step function. Reading back the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 'update_interval' value after a write operation will confirm the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) conversion time actively in use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Mathematically, the resolution can be derived from the conversion time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) via the following function:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) g(x) = 0.250 * [log(x/14) / log(2)]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) where 'x' is the output from 'update_interval' and 'g(x)' is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) resolution in degrees C per LSB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) Alarm Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) The LM73 features a simple over-temperature alarm mechanism. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) feature is exposed via the sysfs attributes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) The attributes 'temp1_max_alarm' and 'temp1_min_alarm' are flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) provided by the LM73 that indicate whether the measured temperature has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) passed the 'temp1_max' and 'temp1_min' thresholds, respectively. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) values _must_ be read to clear the registers on the LM73.