Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver lm73
0002 ==================
0003 
0004 Supported chips:
0005 
0006   * Texas Instruments LM73
0007 
0008     Prefix: 'lm73'
0009 
0010     Addresses scanned: I2C 0x48, 0x49, 0x4a, 0x4c, 0x4d, and 0x4e
0011 
0012     Datasheet: Publicly available at the Texas Instruments website
0013 
0014                https://www.ti.com/product/lm73
0015 
0016 
0017 Author: Guillaume Ligneul <guillaume.ligneul@gmail.com>
0018 
0019 Documentation: Chris Verges <kg4ysn@gmail.com>
0020 
0021 
0022 Description
0023 -----------
0024 
0025 The LM73 is a digital temperature sensor.  All temperature values are
0026 given in degrees Celsius.
0027 
0028 Measurement Resolution Support
0029 ------------------------------
0030 
0031 The LM73 supports four resolutions, defined in terms of degrees C per
0032 LSB: 0.25, 0.125, 0.0625, and 0.3125.  Changing the resolution mode
0033 affects the conversion time of the LM73's analog-to-digital converter.
0034 From userspace, the desired resolution can be specified as a function of
0035 conversion time via the 'update_interval' sysfs attribute for the
0036 device.  This attribute will normalize ranges of input values to the
0037 maximum times defined for the resolution in the datasheet.
0038 
0039     ============= ============= ============
0040     Resolution    Conv. Time    Input Range
0041     (C/LSB)       (msec)        (msec)
0042     ============= ============= ============
0043     0.25          14             0..14
0044     0.125         28            15..28
0045     0.0625        56            29..56
0046     0.03125       112           57..infinity
0047     ============= ============= ============
0048 
0049 The following examples show how the 'update_interval' attribute can be
0050 used to change the conversion time::
0051 
0052     $ echo 0 > update_interval
0053     $ cat update_interval
0054     14
0055     $ cat temp1_input
0056     24250
0057 
0058     $ echo 22 > update_interval
0059     $ cat update_interval
0060     28
0061     $ cat temp1_input
0062     24125
0063 
0064     $ echo 56 > update_interval
0065     $ cat update_interval
0066     56
0067     $ cat temp1_input
0068     24062
0069 
0070     $ echo 85 > update_interval
0071     $ cat update_interval
0072     112
0073     $ cat temp1_input
0074     24031
0075 
0076 As shown here, the lm73 driver automatically adjusts any user input for
0077 'update_interval' via a step function.  Reading back the
0078 'update_interval' value after a write operation will confirm the
0079 conversion time actively in use.
0080 
0081 Mathematically, the resolution can be derived from the conversion time
0082 via the following function:
0083 
0084    g(x) = 0.250 * [log(x/14) / log(2)]
0085 
0086 where 'x' is the output from 'update_interval' and 'g(x)' is the
0087 resolution in degrees C per LSB.
0088 
0089 Alarm Support
0090 -------------
0091 
0092 The LM73 features a simple over-temperature alarm mechanism.  This
0093 feature is exposed via the sysfs attributes.
0094 
0095 The attributes 'temp1_max_alarm' and 'temp1_min_alarm' are flags
0096 provided by the LM73 that indicate whether the measured temperature has
0097 passed the 'temp1_max' and 'temp1_min' thresholds, respectively.  These
0098 values _must_ be read to clear the registers on the LM73.