xref: /linux/Documentation/hwmon/mcp9982.rst (revision 7a0e692a0381254b2f77c54dec100cd3325a6fdf)
1*e2fe950fSVictor Duicu.. SPDX-License-Identifier: GPL-2.0+
2*e2fe950fSVictor Duicu
3*e2fe950fSVictor DuicuKernel driver MCP998X
4*e2fe950fSVictor Duicu=====================
5*e2fe950fSVictor Duicu
6*e2fe950fSVictor DuicuSupported chips:
7*e2fe950fSVictor Duicu
8*e2fe950fSVictor Duicu  * Microchip Technology MCP998X/MCP9933 and MCP998XD/MCP9933D
9*e2fe950fSVictor Duicu
10*e2fe950fSVictor Duicu    Prefix: 'mcp9982'
11*e2fe950fSVictor Duicu
12*e2fe950fSVictor Duicu    Datasheet:
13*e2fe950fSVictor Duicu    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP998X-Family-Data-Sheet-DS20006827.pdf
14*e2fe950fSVictor Duicu
15*e2fe950fSVictor DuicuAuthors:
16*e2fe950fSVictor Duicu
17*e2fe950fSVictor Duicu   - Victor Duicu <victor.duicu@microchip.com>
18*e2fe950fSVictor Duicu
19*e2fe950fSVictor DuicuDescription
20*e2fe950fSVictor Duicu-----------
21*e2fe950fSVictor Duicu
22*e2fe950fSVictor DuicuThis driver implements support for the MCP998X family containing: MCP9982,
23*e2fe950fSVictor DuicuMCP9982D, MCP9983, MCP9983D, MCP9984, MCP9984D, MCP9985, MCP9985D,
24*e2fe950fSVictor DuicuMCP9933 and MCP9933D.
25*e2fe950fSVictor Duicu
26*e2fe950fSVictor DuicuThe MCP998X Family is a high accuracy 2-wire multichannel automotive
27*e2fe950fSVictor Duicutemperature monitor.
28*e2fe950fSVictor Duicu
29*e2fe950fSVictor DuicuThe chips in the family have different numbers of external channels,
30*e2fe950fSVictor Duicuranging from 1 (MCP9982) to 4 channels (MCP9985). Reading diodes in
31*e2fe950fSVictor Duicuanti-parallel connection is supported by MCP9984/85/33 and
32*e2fe950fSVictor DuicuMCP9984D/85D/33D. Dedicated hardware shutdown circuitry is present
33*e2fe950fSVictor Duicuonly in MCP998XD and MCP9933D.
34*e2fe950fSVictor Duicu
35*e2fe950fSVictor DuicuTemperatures are read in millidegrees Celsius, ranging from -64 to
36*e2fe950fSVictor Duicu191.875 with 0.125 precision.
37*e2fe950fSVictor Duicu
38*e2fe950fSVictor DuicuEach channel has a minimum, maximum, and critical limit alongside associated alarms.
39*e2fe950fSVictor DuicuThe chips also implement a hysteresis mechanism which applies only to the maximum
40*e2fe950fSVictor Duicuand critical limits. The relative difference between a limit and its hysteresis
41*e2fe950fSVictor Duicuis the same for both and the value is kept in a single register.
42*e2fe950fSVictor Duicu
43*e2fe950fSVictor DuicuThe chips measure temperatures with a variable conversion rate.
44*e2fe950fSVictor DuicuUpdate_interval = Conversion/Second, so the available options are:
45*e2fe950fSVictor Duicu- 16000 (ms) = 1 conv/16 sec
46*e2fe950fSVictor Duicu- 8000 (ms) = 1 conv/8 sec
47*e2fe950fSVictor Duicu- 4000 (ms) = 1 conv/4 sec
48*e2fe950fSVictor Duicu- 2000 (ms) = 1 conv/2 sec
49*e2fe950fSVictor Duicu- 1000 (ms) = 1 conv/sec
50*e2fe950fSVictor Duicu- 500 (ms) = 2 conv/sec
51*e2fe950fSVictor Duicu- 250 (ms) = 4 conv/sec
52*e2fe950fSVictor Duicu- 125 (ms) = 8 conv/sec
53*e2fe950fSVictor Duicu- 64 (ms) = 16 conv/sec
54*e2fe950fSVictor Duicu- 32 (ms) = 32 conv/sec
55*e2fe950fSVictor Duicu- 16 (ms) = 64 conv/sec
56*e2fe950fSVictor Duicu
57*e2fe950fSVictor DuicuUsage Notes
58*e2fe950fSVictor Duicu-----------
59*e2fe950fSVictor Duicu
60*e2fe950fSVictor DuicuParameters that can be configured in devicetree:
61*e2fe950fSVictor Duicu- anti-parallel diode mode operation
62*e2fe950fSVictor Duicu- resistance error correction on channels 1 and 2
63*e2fe950fSVictor Duicu- resistance error correction on channels 3 and 4
64*e2fe950fSVictor Duicu- power state
65*e2fe950fSVictor Duicu
66*e2fe950fSVictor DuicuChips 82/83 and 82D/83D do not support anti-parallel diode mode.
67*e2fe950fSVictor DuicuFor chips with "D" in the name resistance error correction must be on.
68*e2fe950fSVictor DuicuPlease see Documentation/devicetree/bindings/hwmon/microchip,mcp9982.yaml
69*e2fe950fSVictor Duicufor details.
70*e2fe950fSVictor Duicu
71*e2fe950fSVictor DuicuThere are two power states:
72*e2fe950fSVictor Duicu- Active state: in which the chip is converting on all channels at the
73*e2fe950fSVictor Duicuprogrammed rate.
74*e2fe950fSVictor Duicu
75*e2fe950fSVictor Duicu- Standby state: in which the host must initiate a conversion cycle.
76*e2fe950fSVictor Duicu
77*e2fe950fSVictor DuicuChips with "D" in the name work in Active state only and those without
78*e2fe950fSVictor Duicucan work in either state.
79*e2fe950fSVictor Duicu
80*e2fe950fSVictor DuicuChips with "D" in the name can't set update interval slower than 1 second.
81*e2fe950fSVictor Duicu
82*e2fe950fSVictor DuicuAmong the hysteresis attributes, only the tempX_crit_hyst ones are writeable
83*e2fe950fSVictor Duicuwhile the others are read only. Setting tempX_crit_hyst writes the difference
84*e2fe950fSVictor Duicubetween tempX_crit and tempX_crit_hyst in the hysteresis register. The new value
85*e2fe950fSVictor Duicuapplies automatically  to the other limits. At power up the device starts with
86*e2fe950fSVictor Duicua 10 degree hysteresis.
87*e2fe950fSVictor Duicu
88*e2fe950fSVictor DuicuSysfs entries
89*e2fe950fSVictor Duicu-------------
90*e2fe950fSVictor Duicu
91*e2fe950fSVictor DuicuThe following attributes are supported. The temperature limits and
92*e2fe950fSVictor Duicuupdate_interval are read-write. The attribute tempX_crit_hyst is read-write,
93*e2fe950fSVictor Duicuwhile tempX_max_hyst is read only. All other attributes are read only.
94*e2fe950fSVictor Duicu
95*e2fe950fSVictor Duicu======================= ==================================================
96*e2fe950fSVictor Duicutemp[1-5]_label		User name for channel.
97*e2fe950fSVictor Duicutemp[1-5]_input		Measured temperature for channel.
98*e2fe950fSVictor Duicu
99*e2fe950fSVictor Duicutemp[1-5]_crit		Critical temperature limit.
100*e2fe950fSVictor Duicutemp[1-5]_crit_alarm	Critical temperature limit alarm.
101*e2fe950fSVictor Duicutemp[1-5]_crit_hyst	Critical temperature limit hysteresis.
102*e2fe950fSVictor Duicu
103*e2fe950fSVictor Duicutemp[1-5]_max		High temperature limit.
104*e2fe950fSVictor Duicutemp[1-5]_max_alarm	High temperature limit alarm.
105*e2fe950fSVictor Duicutemp[1-5]_max_hyst	High temperature limit hysteresis.
106*e2fe950fSVictor Duicu
107*e2fe950fSVictor Duicutemp[1-5]_min		Low temperature limit.
108*e2fe950fSVictor Duicutemp[1-5]_min_alarm	Low temperature limit alarm.
109*e2fe950fSVictor Duicu
110*e2fe950fSVictor Duicuupdate_interval		The interval at which the chip will update readings.
111*e2fe950fSVictor Duicu======================= ==================================================
112