xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/ltc4245.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver ltc4245
2*4882a593Smuzhiyun=====================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * Linear Technology LTC4245
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'ltc4245'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: 0x20-0x3f
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet:
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun	http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunAuthor: Ira W. Snyder <iws@ovro.caltech.edu>
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunDescription
20*4882a593Smuzhiyun-----------
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunThe LTC4245 controller allows a board to be safely inserted and removed
23*4882a593Smuzhiyunfrom a live backplane in multiple supply systems such as CompactPCI and
24*4882a593SmuzhiyunPCI Express.
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunUsage Notes
28*4882a593Smuzhiyun-----------
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunThis driver does not probe for LTC4245 devices, due to the fact that some
31*4882a593Smuzhiyunof the possible addresses are unfriendly to probing. You will have to
32*4882a593Smuzhiyuninstantiate the devices explicitly.
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunExample: the following will load the driver for an LTC4245 at address 0x23
35*4882a593Smuzhiyunon I2C bus #1::
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun	$ modprobe ltc4245
38*4882a593Smuzhiyun	$ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunSysfs entries
42*4882a593Smuzhiyun-------------
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunThe LTC4245 has built-in limits for over and under current warnings. This
45*4882a593Smuzhiyunmakes it very likely that the reference circuit will be used.
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunThis driver uses the values in the datasheet to change the register values
48*4882a593Smuzhiyuninto the values specified in the sysfs-interface document. The current readings
49*4882a593Smuzhiyunrely on the sense resistors listed in Table 2: "Sense Resistor Values".
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun======================= =======================================================
52*4882a593Smuzhiyunin1_input		12v input voltage (mV)
53*4882a593Smuzhiyunin2_input		5v  input voltage (mV)
54*4882a593Smuzhiyunin3_input		3v  input voltage (mV)
55*4882a593Smuzhiyunin4_input		Vee (-12v) input voltage (mV)
56*4882a593Smuzhiyun
57*4882a593Smuzhiyunin1_min_alarm		12v input undervoltage alarm
58*4882a593Smuzhiyunin2_min_alarm		5v  input undervoltage alarm
59*4882a593Smuzhiyunin3_min_alarm		3v  input undervoltage alarm
60*4882a593Smuzhiyunin4_min_alarm		Vee (-12v) input undervoltage alarm
61*4882a593Smuzhiyun
62*4882a593Smuzhiyuncurr1_input		12v current (mA)
63*4882a593Smuzhiyuncurr2_input		5v  current (mA)
64*4882a593Smuzhiyuncurr3_input		3v  current (mA)
65*4882a593Smuzhiyuncurr4_input		Vee (-12v) current (mA)
66*4882a593Smuzhiyun
67*4882a593Smuzhiyuncurr1_max_alarm		12v overcurrent alarm
68*4882a593Smuzhiyuncurr2_max_alarm		5v  overcurrent alarm
69*4882a593Smuzhiyuncurr3_max_alarm		3v  overcurrent alarm
70*4882a593Smuzhiyuncurr4_max_alarm		Vee (-12v) overcurrent alarm
71*4882a593Smuzhiyun
72*4882a593Smuzhiyunin5_input		12v output voltage (mV)
73*4882a593Smuzhiyunin6_input		5v  output voltage (mV)
74*4882a593Smuzhiyunin7_input		3v  output voltage (mV)
75*4882a593Smuzhiyunin8_input		Vee (-12v) output voltage (mV)
76*4882a593Smuzhiyun
77*4882a593Smuzhiyunin5_min_alarm		12v output undervoltage alarm
78*4882a593Smuzhiyunin6_min_alarm		5v  output undervoltage alarm
79*4882a593Smuzhiyunin7_min_alarm		3v  output undervoltage alarm
80*4882a593Smuzhiyunin8_min_alarm		Vee (-12v) output undervoltage alarm
81*4882a593Smuzhiyun
82*4882a593Smuzhiyunin9_input		GPIO voltage data (see note 1)
83*4882a593Smuzhiyunin10_input		GPIO voltage data (see note 1)
84*4882a593Smuzhiyunin11_input		GPIO voltage data (see note 1)
85*4882a593Smuzhiyun
86*4882a593Smuzhiyunpower1_input		12v power usage (mW)
87*4882a593Smuzhiyunpower2_input		5v  power usage (mW)
88*4882a593Smuzhiyunpower3_input		3v  power usage (mW)
89*4882a593Smuzhiyunpower4_input		Vee (-12v) power usage (mW)
90*4882a593Smuzhiyun======================= =======================================================
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun
93*4882a593SmuzhiyunNote 1
94*4882a593Smuzhiyun------
95*4882a593Smuzhiyun
96*4882a593SmuzhiyunIf you have NOT configured the driver to sample all GPIO pins as analog
97*4882a593Smuzhiyunvoltages, then the in10_input and in11_input sysfs attributes will not be
98*4882a593Smuzhiyuncreated. The driver will sample the GPIO pin that is currently connected to the
99*4882a593SmuzhiyunADC as an analog voltage, and report the value in in9_input.
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunIf you have configured the driver to sample all GPIO pins as analog voltages,
102*4882a593Smuzhiyunthen they will be sampled in round-robin fashion. If userspace reads too
103*4882a593Smuzhiyunslowly, -EAGAIN will be returned when you read the sysfs attribute containing
104*4882a593Smuzhiyunthe sensor reading.
105*4882a593Smuzhiyun
106*4882a593SmuzhiyunThe LTC4245 chip can be configured to sample all GPIO pins with two methods:
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun1) platform data -- see include/linux/platform_data/ltc4245.h
109*4882a593Smuzhiyun2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunThe default mode of operation is to sample a single GPIO pin.
112