xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/lm87.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver lm87
2*4882a593Smuzhiyun==================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * National Semiconductor LM87
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'lm87'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: I2C 0x2c - 0x2e
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: http://www.national.com/pf/LM/LM87.html
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  * Analog Devices ADM1024
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun    Prefix: 'adm1024'
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Addresses scanned: I2C 0x2c - 0x2e
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    Datasheet: https://www.analog.com/en/prod/0,2877,ADM1024,00.html
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunAuthors:
24*4882a593Smuzhiyun	- Frodo Looijaard <frodol@dds.nl>,
25*4882a593Smuzhiyun	- Philip Edelbrock <phil@netroedge.com>,
26*4882a593Smuzhiyun	- Mark Studebaker <mdsxyz123@yahoo.com>,
27*4882a593Smuzhiyun	- Stephen Rousset <stephen.rousset@rocketlogix.com>,
28*4882a593Smuzhiyun	- Dan Eaton <dan.eaton@rocketlogix.com>,
29*4882a593Smuzhiyun	- Jean Delvare <jdelvare@suse.de>,
30*4882a593Smuzhiyun	- Original 2.6 port Jeff Oliver
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunDescription
33*4882a593Smuzhiyun-----------
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunThis driver implements support for the National Semiconductor LM87
36*4882a593Smuzhiyunand the Analog Devices ADM1024.
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunThe LM87 implements up to three temperature sensors, up to two fan
39*4882a593Smuzhiyunrotation speed sensors, up to seven voltage sensors, alarms, and some
40*4882a593Smuzhiyunmiscellaneous stuff. The ADM1024 is fully compatible.
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunTemperatures are measured in degrees Celsius. Each input has a high
43*4882a593Smuzhiyunand low alarm settings. A high limit produces an alarm when the value
44*4882a593Smuzhiyungoes above it, and an alarm is also produced when the value goes below
45*4882a593Smuzhiyunthe low limit.
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunFan rotation speeds are reported in RPM (rotations per minute). An alarm is
48*4882a593Smuzhiyuntriggered if the rotation speed has dropped below a programmable limit. Fan
49*4882a593Smuzhiyunreadings can be divided by a programmable divider (1, 2, 4 or 8) to give
50*4882a593Smuzhiyunthe readings more range or accuracy. Not all RPM values can accurately be
51*4882a593Smuzhiyunrepresented, so some rounding is done. With a divider of 2, the lowest
52*4882a593Smuzhiyunrepresentable value is around 2600 RPM.
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunVoltage sensors (also known as IN sensors) report their values in
55*4882a593Smuzhiyunvolts. An alarm is triggered if the voltage has crossed a programmable
56*4882a593Smuzhiyunminimum or maximum limit. Note that minimum in this case always means
57*4882a593Smuzhiyun'closest to zero'; this is important for negative voltage measurements.
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunIf an alarm triggers, it will remain triggered until the hardware register
60*4882a593Smuzhiyunis read at least once. This means that the cause for the alarm may
61*4882a593Smuzhiyunalready have disappeared! Note that in the current implementation, all
62*4882a593Smuzhiyunhardware registers are read whenever any data is read (unless it is less
63*4882a593Smuzhiyunthan 1.0 seconds since the last update). This means that you can easily
64*4882a593Smuzhiyunmiss once-only alarms.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe lm87 driver only updates its values each 1.0 seconds; reading it more
67*4882a593Smuzhiyunoften will do no harm, but will return 'old' values.
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunHardware Configurations
71*4882a593Smuzhiyun-----------------------
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunThe LM87 has four pins which can serve one of two possible functions,
74*4882a593Smuzhiyundepending on the hardware configuration.
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunSome functions share pins, so not all functions are available at the same
77*4882a593Smuzhiyuntime. Which are depends on the hardware setup. This driver normally
78*4882a593Smuzhiyunassumes that firmware configured the chip correctly. Where this is not
79*4882a593Smuzhiyunthe case, platform code must set the I2C client's platform_data to point
80*4882a593Smuzhiyunto a u8 value to be written to the channel register.
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunFor reference, here is the list of exclusive functions:
83*4882a593Smuzhiyun - in0+in5 (default) or temp3
84*4882a593Smuzhiyun - fan1 (default) or in6
85*4882a593Smuzhiyun - fan2 (default) or in7
86*4882a593Smuzhiyun - VID lines (default) or IRQ lines (not handled by this driver)
87