blob: 678c9c60b5a3743c0ab8d1f8ead3f789c2d3ab3b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Naming and data format standards for sysfs files
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03002================================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
4The libsensors library offers an interface to the raw sensors data
Jean Delvare125ff802008-02-23 10:57:53 +01005through the sysfs interface. Since lm-sensors 3.0.0, libsensors is
6completely chip-independent. It assumes that all the kernel drivers
7implement the standard sysfs interface described in this document.
8This makes adding or updating support for any given chip very easy, as
9libsensors, and applications using it, do not need to be modified.
10This is a major improvement compared to lm-sensors 2.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12Note that motherboards vary widely in the connections to sensor chips.
13There is no standard that ensures, for example, that the second
14temperature sensor is connected to the CPU, or that the second fan is on
15the CPU. Also, some values reported by the chips need some computation
16before they make full sense. For example, most chips can only measure
17voltages between 0 and +4V. Other voltages are scaled back into that
18range using external resistors. Since the values of these resistors
19can change from motherboard to motherboard, the conversions cannot be
20hard coded into the driver and have to be done in user space.
21
Jean Delvare740e06a2006-06-05 20:31:20 +020022For this reason, even if we aim at a chip-independent libsensors, it will
Linus Torvalds1da177e2005-04-16 15:20:36 -070023still require a configuration file (e.g. /etc/sensors.conf) for proper
24values conversion, labeling of inputs and hiding of unused inputs.
25
26An alternative method that some programs use is to access the sysfs
27files directly. This document briefly describes the standards that the
28drivers follow, so that an application program can scan for entries and
29access this data in a simple and consistent way. That said, such programs
30will have to implement conversion, labeling and hiding of inputs. For
31this reason, it is still not recommended to bypass the library.
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033Each chip gets its own directory in the sysfs /sys/devices tree. To
Jean Delvare740e06a2006-06-05 20:31:20 +020034find all sensor chips, it is easier to follow the device symlinks from
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030035`/sys/class/hwmon/hwmon*`.
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Jean Delvare125ff802008-02-23 10:57:53 +010037Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes
38in the "physical" device directory. Since lm-sensors 3.0.1, attributes found
39in the hwmon "class" device directory are also supported. Complex drivers
40(e.g. drivers for multifunction chips) may want to use this possibility to
41avoid namespace pollution. The only drawback will be that older versions of
42libsensors won't support the driver in question.
43
Jean Delvare740e06a2006-06-05 20:31:20 +020044All sysfs values are fixed point numbers.
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46There is only one value per file, unlike the older /proc specification.
47The common scheme for files naming is: <type><number>_<item>. Usual
48types for sensor chips are "in" (voltage), "temp" (temperature) and
49"fan" (fan). Usual items are "input" (measured value), "max" (high
50threshold, "min" (low threshold). Numbering usually starts from 1,
51except for voltages which start from 0 (because most data sheets use
52this). A number is always used for elements that can be present more
53than once, even if there is a single element of the given type on the
54specific chip. Other files do not refer to a specific element, so
55they have a simple name, and no number.
56
57Alarms are direct indications read from the chips. The drivers do NOT
58make comparisons of readings to thresholds. This allows violations
59between readings to be caught and alarmed. The exact definition of an
60alarm (for example, whether a threshold must be met or must be exceeded
61to cause an alarm) is chip-dependent.
62
Hans de Goede2ed42632007-09-21 17:03:32 +020063When setting values of hwmon sysfs attributes, the string representation of
64the desired value must be written, note that strings which are not a number
65are interpreted as 0! For more on how written strings are interpreted see the
66"sysfs attribute writes interpretation" section at the end of this file.
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68-------------------------------------------------------------------------
69
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030070======= ===========================================
71`[0-*]` denotes any positive number starting from 0
72`[1-*]` denotes any positive number starting from 1
Rudolf Marek057bc352006-06-04 20:03:39 +020073RO read only value
Andre Prendelcd4e96c2009-06-15 18:39:49 +020074WO write only value
Rudolf Marek057bc352006-06-04 20:03:39 +020075RW read/write value
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030076======= ===========================================
Rudolf Marek057bc352006-06-04 20:03:39 +020077
78Read/write values may be read-only for some chips, depending on the
79hardware implementation.
80
Jean Delvare176544d2007-08-20 16:44:44 +020081All entries (except name) are optional, and should only be created in a
82given driver if the chip has the feature.
83
84
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030085*****************
86Global attributes
87*****************
Jean Delvare176544d2007-08-20 16:44:44 +020088
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030089`name`
90 The chip name.
Jean Delvare176544d2007-08-20 16:44:44 +020091 This should be a short, lowercase string, not containing
Guenter Roeckf1728412017-01-24 20:24:36 -080092 whitespace, dashes, or the wildcard character '*'.
93 This attribute represents the chip name. It is the only
94 mandatory attribute.
Jean Delvare176544d2007-08-20 16:44:44 +020095 I2C devices get this attribute created automatically.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030096
Jean Delvare176544d2007-08-20 16:44:44 +020097 RO
98
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030099`update_interval`
100 The interval at which the chip will update readings.
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200101 Unit: millisecond
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300102
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200103 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300104
Guenter Roecka51b9942010-09-17 17:24:14 +0200105 Some devices have a variable update rate or interval.
106 This attribute can be used to change it to the desired value.
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200107
Jean Delvare740e06a2006-06-05 20:31:20 +0200108
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300109********
110Voltages
111********
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300113`in[0-*]_min`
114 Voltage min value.
115
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300117
Rudolf Marek057bc352006-06-04 20:03:39 +0200118 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300119
120`in[0-*]_lcrit`
121 Voltage critical min value.
122
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200123 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300124
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200125 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300126
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200127 If voltage drops to or below this limit, the system may
128 take drastic action such as power down or reset. At the very
129 least, it should report a fault.
130
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300131`in[0-*]_max`
132 Voltage max value.
133
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300135
Rudolf Marek057bc352006-06-04 20:03:39 +0200136 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300137
138`in[0-*]_crit`
139 Voltage critical max value.
140
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200141 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300142
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200143 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300144
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200145 If voltage reaches or exceeds this limit, the system may
146 take drastic action such as power down or reset. At the very
147 least, it should report a fault.
148
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300149`in[0-*]_input`
150 Voltage input value.
151
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300153
Rudolf Marek057bc352006-06-04 20:03:39 +0200154 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300155
Rudolf Marek057bc352006-06-04 20:03:39 +0200156 Voltage measured on the chip pin.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300157
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158 Actual voltage depends on the scaling resistors on the
159 motherboard, as recommended in the chip datasheet.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300160
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 This varies by chip and by motherboard.
162 Because of this variation, values are generally NOT scaled
163 by the chip driver, and must be done by the application.
164 However, some drivers (notably lm87 and via686a)
Rudolf Marek057bc352006-06-04 20:03:39 +0200165 do scale, because of internal resistors built into a chip.
Jean Delvare176544d2007-08-20 16:44:44 +0200166 These drivers will output the actual voltage. Rule of
167 thumb: drivers should report the voltage values at the
168 "pins" of the chip.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300170`in[0-*]_average`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700171 Average voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300172
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700173 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300174
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700175 RO
176
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300177`in[0-*]_lowest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700178 Historical minimum voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300179
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700180 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300181
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700182 RO
183
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300184`in[0-*]_highest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700185 Historical maximum voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300186
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700187 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300188
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700189 RO
190
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300191`in[0-*]_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700192 Reset inX_lowest and inX_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300193
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700194 WO
195
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300196`in_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700197 Reset inX_lowest and inX_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300198
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700199 WO
200
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300201`in[0-*]_label`
202 Suggested voltage channel label.
203
Jean Delvare176544d2007-08-20 16:44:44 +0200204 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300205
Jean Delvare176544d2007-08-20 16:44:44 +0200206 Should only be created if the driver has hints about what
207 this voltage channel is being used for, and user-space
208 doesn't. In all other cases, the label is provided by
209 user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300210
Jean Delvare176544d2007-08-20 16:44:44 +0200211 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300213`in[0-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530214 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300215
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530216 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300217
218 - 1: Enable
219 - 0: Disable
220
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530221 RW
222
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300223`cpu[0-*]_vid`
224 CPU core reference voltage.
225
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300227
Rudolf Marek057bc352006-06-04 20:03:39 +0200228 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300229
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230 Not always correct.
231
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300232`vrm`
233 Voltage Regulator Module version number.
234
Rudolf Marek057bc352006-06-04 20:03:39 +0200235 RW (but changing it should no more be necessary)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300236
Rudolf Marek057bc352006-06-04 20:03:39 +0200237 Originally the VRM standard version multiplied by 10, but now
238 an arbitrary number, as not all standards have a version
239 number.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300240
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241 Affects the way the driver calculates the CPU core reference
242 voltage from the vid pins.
243
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200244`in[0-*]_rated_min`
245 Minimum rated voltage.
246
247 Unit: millivolt
248
249 RO
250
251`in[0-*]_rated_max`
252 Maximum rated voltage.
253
254 Unit: millivolt
255
256 RO
257
Rudolf Marek057bc352006-06-04 20:03:39 +0200258Also see the Alarms section for status flags associated with voltages.
259
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300261****
262Fans
263****
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300265`fan[1-*]_min`
266 Fan minimum value
267
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300269
Rudolf Marek057bc352006-06-04 20:03:39 +0200270 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300272`fan[1-*]_max`
273 Fan maximum value
274
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200275 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300276
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200277 Only rarely supported by the hardware.
278 RW
279
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300280`fan[1-*]_input`
281 Fan input value.
282
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300284
Rudolf Marek057bc352006-06-04 20:03:39 +0200285 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300287`fan[1-*]_div`
288 Fan divisor.
289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290 Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128).
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300291
Rudolf Marek057bc352006-06-04 20:03:39 +0200292 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300293
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 Some chips only support values 1, 2, 4 and 8.
295 Note that this is actually an internal clock divisor, which
296 affects the measurable speed range, not the read value.
297
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300298`fan[1-*]_pulses`
299 Number of tachometer pulses per fan revolution.
300
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800301 Integer value, typically between 1 and 4.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300302
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800303 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300304
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800305 This value is a characteristic of the fan connected to the
306 device's input, so it has to be set in accordance with the fan
307 model.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300308
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800309 Should only be created if the chip has a register to configure
310 the number of pulses. In the absence of such a register (and
311 thus attribute) the value assumed by all devices is 2 pulses
312 per fan revolution.
313
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300314`fan[1-*]_target`
Jean Delvare2dbc5142007-05-08 17:22:00 +0200315 Desired fan speed
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300316
Jean Delvare2dbc5142007-05-08 17:22:00 +0200317 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300318
Jean Delvare2dbc5142007-05-08 17:22:00 +0200319 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300320
Jean Delvare2dbc5142007-05-08 17:22:00 +0200321 Only makes sense if the chip supports closed-loop fan speed
322 control based on the measured fan speed.
323
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300324`fan[1-*]_label`
325 Suggested fan channel label.
326
Jean Delvare176544d2007-08-20 16:44:44 +0200327 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300328
Jean Delvare176544d2007-08-20 16:44:44 +0200329 Should only be created if the driver has hints about what
330 this fan channel is being used for, and user-space doesn't.
331 In all other cases, the label is provided by user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300332
Jean Delvare176544d2007-08-20 16:44:44 +0200333 RO
334
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300335`fan[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530336 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300337
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530338 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300339
340 - 1: Enable
341 - 0: Disable
342
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530343 RW
344
Rudolf Marek057bc352006-06-04 20:03:39 +0200345Also see the Alarms section for status flags associated with fans.
346
347
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300348***
349PWM
350***
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300352`pwm[1-*]`
353 Pulse width modulation fan control.
354
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355 Integer value in the range 0 to 255
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300356
Rudolf Marek057bc352006-06-04 20:03:39 +0200357 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300358
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359 255 is max or 100%.
360
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300361`pwm[1-*]_enable`
Jean Delvare875f25d2007-06-27 21:26:08 +0200362 Fan speed control method:
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300363
364 - 0: no fan speed control (i.e. fan at full speed)
365 - 1: manual fan speed control enabled (using `pwm[1-*]`)
366 - 2+: automatic fan speed control enabled
367
Jean Delvaref8d0c192007-02-14 21:15:02 +0100368 Check individual chip documentation files for automatic mode
369 details.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300370
Rudolf Marek057bc352006-06-04 20:03:39 +0200371 RW
372
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300373`pwm[1-*]_mode`
374 - 0: DC mode (direct current)
375 - 1: PWM mode (pulse-width modulation)
376
Jean Delvaref8d0c192007-02-14 21:15:02 +0100377 RW
378
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300379`pwm[1-*]_freq`
380 Base PWM frequency in Hz.
381
Jean Delvaref8d0c192007-02-14 21:15:02 +0100382 Only possibly available when pwmN_mode is PWM, but not always
383 present even then.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300384
Rudolf Marek057bc352006-06-04 20:03:39 +0200385 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300387`pwm[1-*]_auto_channels_temp`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 Select which temperature channels affect this PWM output in
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300389 auto mode.
390
391 Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc...
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392 Which values are possible depend on the chip used.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300393
Rudolf Marek057bc352006-06-04 20:03:39 +0200394 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300396`pwm[1-*]_auto_point[1-*]_pwm` / `pwm[1-*]_auto_point[1-*]_temp` / `pwm[1-*]_auto_point[1-*]_temp_hyst`
397 Define the PWM vs temperature curve.
398
399 Number of trip points is chip-dependent. Use this for chips
400 which associate trip points to PWM output channels.
401
Rudolf Marek057bc352006-06-04 20:03:39 +0200402 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300404`temp[1-*]_auto_point[1-*]_pwm` / `temp[1-*]_auto_point[1-*]_temp` / `temp[1-*]_auto_point[1-*]_temp_hyst`
405 Define the PWM vs temperature curve.
406
407 Number of trip points is chip-dependent. Use this for chips
408 which associate trip points to temperature channels.
409
Rudolf Marek057bc352006-06-04 20:03:39 +0200410 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Jean Delvaref7290e22009-12-09 20:35:47 +0100412There is a third case where trip points are associated to both PWM output
413channels and temperature channels: the PWM values are associated to PWM
414output channels while the temperature values are associated to temperature
415channels. In that case, the result is determined by the mapping between
416temperature inputs and PWM outputs. When several temperature inputs are
417mapped to a given PWM output, this leads to several candidate PWM values.
418The actual result is up to the chip, but in general the highest candidate
419value (fastest fan speed) wins.
420
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300422************
423Temperatures
424************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300426`temp[1-*]_type`
427 Sensor type selection.
428
Jean Delvareb26f9332007-08-16 14:30:01 +0200429 Integers 1 to 6
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300430
Rudolf Marek057bc352006-06-04 20:03:39 +0200431 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300432
433 - 1: CPU embedded diode
434 - 2: 3904 transistor
435 - 3: thermal diode
436 - 4: thermistor
437 - 5: AMD AMDSI
438 - 6: Intel PECI
439
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 Not all types are supported by all chips
441
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300442`temp[1-*]_max`
443 Temperature max value.
444
Jean Delvare740e06a2006-06-05 20:31:20 +0200445 Unit: millidegree Celsius (or millivolt, see below)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300446
Rudolf Marek057bc352006-06-04 20:03:39 +0200447 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300449`temp[1-*]_min`
450 Temperature min value.
451
Jean Delvare740e06a2006-06-05 20:31:20 +0200452 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300453
Rudolf Marek057bc352006-06-04 20:03:39 +0200454 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300456`temp[1-*]_max_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457 Temperature hysteresis value for max limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300458
Jean Delvare740e06a2006-06-05 20:31:20 +0200459 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300460
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461 Must be reported as an absolute temperature, NOT a delta
462 from the max value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300463
Rudolf Marek057bc352006-06-04 20:03:39 +0200464 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300466`temp[1-*]_min_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200467 Temperature hysteresis value for min limit.
468 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300469
Jean Delvare01325142014-05-25 17:23:07 +0200470 Must be reported as an absolute temperature, NOT a delta
471 from the min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300472
Jean Delvare01325142014-05-25 17:23:07 +0200473 RW
474
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300475`temp[1-*]_input`
476 Temperature input value.
477
Jean Delvare740e06a2006-06-05 20:31:20 +0200478 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300479
Rudolf Marek057bc352006-06-04 20:03:39 +0200480 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300482`temp[1-*]_crit`
483 Temperature critical max value, typically greater than
Linus Torvalds1da177e2005-04-16 15:20:36 -0700484 corresponding temp_max values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300485
Jean Delvare740e06a2006-06-05 20:31:20 +0200486 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300487
Rudolf Marek057bc352006-06-04 20:03:39 +0200488 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300490`temp[1-*]_crit_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491 Temperature hysteresis value for critical limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300492
Jean Delvare740e06a2006-06-05 20:31:20 +0200493 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300494
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 Must be reported as an absolute temperature, NOT a delta
496 from the critical value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300497
Rudolf Marek057bc352006-06-04 20:03:39 +0200498 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300500`temp[1-*]_emergency`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200501 Temperature emergency max value, for chips supporting more than
502 two upper temperature limits. Must be equal or greater than
503 corresponding temp_crit values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300504
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200505 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300506
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200507 RW
508
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300509`temp[1-*]_emergency_hyst`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200510 Temperature hysteresis value for emergency limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300511
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200512 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300513
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200514 Must be reported as an absolute temperature, NOT a delta
515 from the emergency value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300516
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200517 RW
518
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300519`temp[1-*]_lcrit`
520 Temperature critical min value, typically lower than
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200521 corresponding temp_min values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300522
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200523 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300524
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200525 RW
526
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300527`temp[1-*]_lcrit_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200528 Temperature hysteresis value for critical min limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300529
Jean Delvare01325142014-05-25 17:23:07 +0200530 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300531
Jean Delvare01325142014-05-25 17:23:07 +0200532 Must be reported as an absolute temperature, NOT a delta
533 from the critical min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300534
Jean Delvare01325142014-05-25 17:23:07 +0200535 RW
536
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300537`temp[1-*]_offset`
Hartmut Rick59ac8362006-03-23 16:37:23 +0100538 Temperature offset which is added to the temperature reading
539 by the chip.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300540
Hartmut Rick59ac8362006-03-23 16:37:23 +0100541 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300542
Hartmut Rick59ac8362006-03-23 16:37:23 +0100543 Read/Write value.
544
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300545`temp[1-*]_label`
546 Suggested temperature channel label.
547
Jean Delvare176544d2007-08-20 16:44:44 +0200548 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300549
Jean Delvare176544d2007-08-20 16:44:44 +0200550 Should only be created if the driver has hints about what
551 this temperature channel is being used for, and user-space
552 doesn't. In all other cases, the label is provided by
553 user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300554
Jean Delvare176544d2007-08-20 16:44:44 +0200555 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300557`temp[1-*]_lowest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200558 Historical minimum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300559
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200560 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300561
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200562 RO
563
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300564`temp[1-*]_highest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200565 Historical maximum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300566
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200567 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300568
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200569 RO
570
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300571`temp[1-*]_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200572 Reset temp_lowest and temp_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300573
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200574 WO
575
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300576`temp_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200577 Reset temp_lowest and temp_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300578
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200579 WO
580
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300581`temp[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530582 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300583
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530584 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300585
586 - 1: Enable
587 - 0: Disable
588
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530589 RW
590
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200591`temp[1-*]_rated_min`
592 Minimum rated temperature.
593
594 Unit: millidegree Celsius
595
596 RO
597
598`temp[1-*]_rated_max`
599 Maximum rated temperature.
600
601 Unit: millidegree Celsius
602
603 RO
604
Jean Delvare740e06a2006-06-05 20:31:20 +0200605Some chips measure temperature using external thermistors and an ADC, and
606report the temperature measurement as a voltage. Converting this voltage
607back to a temperature (or the other way around for limits) requires
608mathematical functions not available in the kernel, so the conversion
609must occur in user space. For these chips, all temp* files described
610above should contain values expressed in millivolt instead of millidegree
611Celsius. In other words, such temperature channels are handled as voltage
612channels by the driver.
613
Rudolf Marek057bc352006-06-04 20:03:39 +0200614Also see the Alarms section for status flags associated with temperatures.
615
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300617********
618Currents
619********
Linus Torvalds1da177e2005-04-16 15:20:36 -0700620
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300621`curr[1-*]_max`
622 Current max value
623
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300625
Rudolf Marek057bc352006-06-04 20:03:39 +0200626 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700627
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300628`curr[1-*]_min`
629 Current min value.
630
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300632
Rudolf Marek057bc352006-06-04 20:03:39 +0200633 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300635`curr[1-*]_lcrit`
636 Current critical low value
637
Guenter Roeck581693b2010-06-28 13:22:27 -0700638 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300639
Guenter Roeck581693b2010-06-28 13:22:27 -0700640 RW
641
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300642`curr[1-*]_crit`
643 Current critical high value.
644
Guenter Roeck581693b2010-06-28 13:22:27 -0700645 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300646
Guenter Roeck581693b2010-06-28 13:22:27 -0700647 RW
648
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300649`curr[1-*]_input`
650 Current input value
651
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300653
Rudolf Marek057bc352006-06-04 20:03:39 +0200654 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300656`curr[1-*]_average`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700657 Average current use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300658
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700659 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300660
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700661 RO
662
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300663`curr[1-*]_lowest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700664 Historical minimum current
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300665
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700666 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300667
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700668 RO
669
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300670`curr[1-*]_highest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700671 Historical maximum current
672 Unit: milliampere
673 RO
674
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300675`curr[1-*]_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700676 Reset currX_lowest and currX_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300677
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700678 WO
679
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300680`curr_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700681 Reset currX_lowest and currX_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300682
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700683 WO
684
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300685`curr[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530686 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300687
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530688 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300689
690 - 1: Enable
691 - 0: Disable
692
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530693 RW
694
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200695`curr[1-*]_rated_min`
696 Minimum rated current.
697
698 Unit: milliampere
699
700 RO
701
702`curr[1-*]_rated_max`
703 Maximum rated current.
704
705 Unit: milliampere
706
707 RO
708
Guenter Roeck581693b2010-06-28 13:22:27 -0700709Also see the Alarms section for status flags associated with currents.
710
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300711*****
712Power
713*****
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700714
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300715`power[1-*]_average`
716 Average power use
717
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700718 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300719
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700720 RO
721
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300722`power[1-*]_average_interval`
723 Power use averaging interval. A poll
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700724 notification is sent to this file if the
725 hardware changes the averaging interval.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300726
Darrick J. Wongddedc652008-10-09 15:33:58 +0200727 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300728
Darrick J. Wongddedc652008-10-09 15:33:58 +0200729 RW
730
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300731`power[1-*]_average_interval_max`
732 Maximum power use averaging interval
733
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700734 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300735
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700736 RO
737
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300738`power[1-*]_average_interval_min`
739 Minimum power use averaging interval
740
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700741 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300742
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700743 RO
744
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300745`power[1-*]_average_highest`
746 Historical average maximum power use
747
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700748 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300749
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700750 RO
751
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300752`power[1-*]_average_lowest`
753 Historical average minimum power use
754
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700755 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300756
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700757 RO
758
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300759`power[1-*]_average_max`
760 A poll notification is sent to
761 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700762 rises above this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300763
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700764 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300765
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700766 RW
767
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300768`power[1-*]_average_min`
769 A poll notification is sent to
770 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700771 sinks below this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300772
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700773 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300774
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700775 RW
776
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300777`power[1-*]_input`
778 Instantaneous power use
779
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700780 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300781
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700782 RO
783
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300784`power[1-*]_input_highest`
785 Historical maximum power use
786
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700787 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300788
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700789 RO
790
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300791`power[1-*]_input_lowest`
792 Historical minimum power use
793
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700794 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300795
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700796 RO
797
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300798`power[1-*]_reset_history`
799 Reset input_highest, input_lowest,
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700800 average_highest and average_lowest.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300801
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700802 WO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700803
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300804`power[1-*]_accuracy`
805 Accuracy of the power meter.
806
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700807 Unit: Percent
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300808
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700809 RO
810
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300811`power[1-*]_cap`
812 If power use rises above this limit, the
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700813 system should take action to reduce power use.
814 A poll notification is sent to this file if the
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300815 cap is changed by the hardware. The `*_cap`
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700816 files only appear if the cap is known to be
817 enforced by hardware.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300818
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700819 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300820
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700821 RW
822
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300823`power[1-*]_cap_hyst`
824 Margin of hysteresis built around capping and
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700825 notification.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300826
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700827 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300828
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700829 RW
830
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300831`power[1-*]_cap_max`
832 Maximum cap that can be set.
833
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700834 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300835
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700836 RO
837
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300838`power[1-*]_cap_min`
839 Minimum cap that can be set.
840
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700841 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300842
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700843 RO
844
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300845`power[1-*]_max`
846 Maximum power.
847
Guenter Roeck581693b2010-06-28 13:22:27 -0700848 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300849
Guenter Roeck581693b2010-06-28 13:22:27 -0700850 RW
851
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300852`power[1-*]_crit`
853 Critical maximum power.
854
Guenter Roeck581693b2010-06-28 13:22:27 -0700855 If power rises to or above this limit, the
856 system is expected take drastic action to reduce
857 power consumption, such as a system shutdown or
858 a forced powerdown of some devices.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300859
Guenter Roeck581693b2010-06-28 13:22:27 -0700860 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300861
Guenter Roeck581693b2010-06-28 13:22:27 -0700862 RW
863
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300864`power[1-*]_enable`
865 Enable or disable the sensors.
866
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530867 When disabled the sensor read will return
868 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300869
870 - 1: Enable
871 - 0: Disable
872
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530873 RW
874
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200875`power[1-*]_rated_min`
876 Minimum rated power.
877
878 Unit: microWatt
879
880 RO
881
882`power[1-*]_rated_max`
883 Maximum rated power.
884
885 Unit: microWatt
886
887 RO
888
Guenter Roeck581693b2010-06-28 13:22:27 -0700889Also see the Alarms section for status flags associated with power readings.
890
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300891******
892Energy
893******
Darrick J. Wongddedc652008-10-09 15:33:58 +0200894
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300895`energy[1-*]_input`
896 Cumulative energy use
897
Darrick J. Wongddedc652008-10-09 15:33:58 +0200898 Unit: microJoule
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300899
Darrick J. Wongddedc652008-10-09 15:33:58 +0200900 RO
901
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300902`energy[1-*]_enable`
903 Enable or disable the sensors.
904
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530905 When disabled the sensor read will return
906 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300907
908 - 1: Enable
909 - 0: Disable
910
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530911 RW
Jean Delvareec199202009-03-30 21:46:44 +0200912
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300913********
914Humidity
915********
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800916
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300917`humidity[1-*]_input`
918 Humidity
919
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800920 Unit: milli-percent (per cent mille, pcm)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300921
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800922 RO
923
924
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300925`humidity[1-*]_enable`
926 Enable or disable the sensors
927
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530928 When disabled the sensor read will return
929 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300930
931 - 1: Enable
932 - 0: Disable
933
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530934 RW
935
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200936`humidity[1-*]_rated_min`
937 Minimum rated humidity.
938
939 Unit: milli-percent (per cent mille, pcm)
940
941 RO
942
943`humidity[1-*]_rated_max`
944 Maximum rated humidity.
945
946 Unit: milli-percent (per cent mille, pcm)
947
948 RO
949
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300950******
951Alarms
952******
Jean Delvare400b48e2006-03-23 16:46:47 +0100953
954Each channel or limit may have an associated alarm file, containing a
955boolean value. 1 means than an alarm condition exists, 0 means no alarm.
956
957Usually a given chip will either use channel-related alarms, or
958limit-related alarms, not both. The driver should just reflect the hardware
959implementation.
960
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300961+-------------------------------+-----------------------+
962| **`in[0-*]_alarm`, | Channel alarm |
963| `curr[1-*]_alarm`, | |
964| `power[1-*]_alarm`, | - 0: no alarm |
965| `fan[1-*]_alarm`, | - 1: alarm |
966| `temp[1-*]_alarm`** | |
967| | RO |
968+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +0100969
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300970**OR**
Jean Delvare400b48e2006-03-23 16:46:47 +0100971
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300972+-------------------------------+-----------------------+
973| **`in[0-*]_min_alarm`, | Limit alarm |
974| `in[0-*]_max_alarm`, | |
975| `in[0-*]_lcrit_alarm`, | - 0: no alarm |
976| `in[0-*]_crit_alarm`, | - 1: alarm |
977| `curr[1-*]_min_alarm`, | |
978| `curr[1-*]_max_alarm`, | RO |
979| `curr[1-*]_lcrit_alarm`, | |
980| `curr[1-*]_crit_alarm`, | |
981| `power[1-*]_cap_alarm`, | |
982| `power[1-*]_max_alarm`, | |
983| `power[1-*]_crit_alarm`, | |
984| `fan[1-*]_min_alarm`, | |
985| `fan[1-*]_max_alarm`, | |
986| `temp[1-*]_min_alarm`, | |
987| `temp[1-*]_max_alarm`, | |
988| `temp[1-*]_lcrit_alarm`, | |
989| `temp[1-*]_crit_alarm`, | |
990| `temp[1-*]_emergency_alarm`** | |
991+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +0100992
993Each input channel may have an associated fault file. This can be used
994to notify open diodes, unconnected fans etc. where the hardware
995supports it. When this boolean has value 1, the measurement for that
996channel should not be trusted.
997
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300998`fan[1-*]_fault` / `temp[1-*]_fault`
Jean Delvare400b48e2006-03-23 16:46:47 +0100999 Input fault condition
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001000
1001 - 0: no fault occurred
1002 - 1: fault condition
1003
Rudolf Marek057bc352006-06-04 20:03:39 +02001004 RO
Jean Delvare400b48e2006-03-23 16:46:47 +01001005
1006Some chips also offer the possibility to get beeped when an alarm occurs:
1007
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001008`beep_enable`
1009 Master beep enable
1010
1011 - 0: no beeps
1012 - 1: beeps
1013
Rudolf Marek057bc352006-06-04 20:03:39 +02001014 RW
Jean Delvare400b48e2006-03-23 16:46:47 +01001015
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001016`in[0-*]_beep`, `curr[1-*]_beep`, `fan[1-*]_beep`, `temp[1-*]_beep`,
Jean Delvare400b48e2006-03-23 16:46:47 +01001017 Channel beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001018
1019 - 0: disable
1020 - 1: enable
1021
Rudolf Marek057bc352006-06-04 20:03:39 +02001022 RW
Jean Delvare400b48e2006-03-23 16:46:47 +01001023
1024In theory, a chip could provide per-limit beep masking, but no such chip
1025was seen so far.
1026
1027Old drivers provided a different, non-standard interface to alarms and
1028beeps. These interface files are deprecated, but will be kept around
1029for compatibility reasons:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001031`alarms`
1032 Alarm bitmask.
1033
Rudolf Marek057bc352006-06-04 20:03:39 +02001034 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001035
Linus Torvalds1da177e2005-04-16 15:20:36 -07001036 Integer representation of one to four bytes.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001037
Linus Torvalds1da177e2005-04-16 15:20:36 -07001038 A '1' bit means an alarm.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001039
Linus Torvalds1da177e2005-04-16 15:20:36 -07001040 Chips should be programmed for 'comparator' mode so that
1041 the alarm will 'come back' after you read the register
1042 if it is still valid.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001043
Linus Torvalds1da177e2005-04-16 15:20:36 -07001044 Generally a direct representation of a chip's internal
1045 alarm registers; there is no standard for the position
Jean Delvare400b48e2006-03-23 16:46:47 +01001046 of individual bits. For this reason, the use of this
1047 interface file for new drivers is discouraged. Use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001048 `individual *_alarm` and `*_fault` files instead.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001049 Bits are defined in kernel/include/sensors.h.
1050
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001051`beep_mask`
1052 Bitmask for beep.
Jean Delvare400b48e2006-03-23 16:46:47 +01001053 Same format as 'alarms' with the same bit locations,
1054 use discouraged for the same reason. Use individual
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001055 `*_beep` files instead.
Rudolf Marek057bc352006-06-04 20:03:39 +02001056 RW
Hans de Goede2ed42632007-09-21 17:03:32 +02001057
1058
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001059*******************
1060Intrusion detection
1061*******************
Jean Delvareec199202009-03-30 21:46:44 +02001062
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001063`intrusion[0-*]_alarm`
Jean Delvareec199202009-03-30 21:46:44 +02001064 Chassis intrusion detection
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001065
1066 - 0: OK
1067 - 1: intrusion detected
1068
Jean Delvareec199202009-03-30 21:46:44 +02001069 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001070
Jean Delvareec199202009-03-30 21:46:44 +02001071 Contrary to regular alarm flags which clear themselves
1072 automatically when read, this one sticks until cleared by
1073 the user. This is done by writing 0 to the file. Writing
1074 other values is unsupported.
1075
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001076`intrusion[0-*]_beep`
Jean Delvareec199202009-03-30 21:46:44 +02001077 Chassis intrusion beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001078
Jean Delvareec199202009-03-30 21:46:44 +02001079 0: disable
1080 1: enable
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001081
Jean Delvareec199202009-03-30 21:46:44 +02001082 RW
1083
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001084****************************
1085Average sample configuration
1086****************************
Adamski, Krzysztof (Nokia - PL/Wroclaw)bfe033a2019-04-14 21:58:40 +00001087
1088Devices allowing for reading {in,power,curr,temp}_average values may export
1089attributes for controlling number of samples used to compute average.
1090
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001091+--------------+---------------------------------------------------------------+
1092| samples | Sets number of average samples for all types of measurements. |
1093| | |
1094| | RW |
1095+--------------+---------------------------------------------------------------+
1096| in_samples | Sets number of average samples for specific type of |
1097| power_samples| measurements. |
1098| curr_samples | |
1099| temp_samples | Note that on some devices it won't be possible to set all of |
1100| | them to different values so changing one might also change |
1101| | some others. |
1102| | |
1103| | RW |
1104+--------------+---------------------------------------------------------------+
Jean Delvareec199202009-03-30 21:46:44 +02001105
Hans de Goede2ed42632007-09-21 17:03:32 +02001106sysfs attribute writes interpretation
1107-------------------------------------
1108
1109hwmon sysfs attributes always contain numbers, so the first thing to do is to
1110convert the input to a number, there are 2 ways todo this depending whether
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001111the number can be negative or not::
1112
1113 unsigned long u = simple_strtoul(buf, NULL, 10);
1114 long s = simple_strtol(buf, NULL, 10);
Hans de Goede2ed42632007-09-21 17:03:32 +02001115
1116With buf being the buffer with the user input being passed by the kernel.
1117Notice that we do not use the second argument of strto[u]l, and thus cannot
1118tell when 0 is returned, if this was really 0 or is caused by invalid input.
1119This is done deliberately as checking this everywhere would add a lot of
1120code to the kernel.
1121
1122Notice that it is important to always store the converted value in an
1123unsigned long or long, so that no wrap around can happen before any further
1124checking.
1125
1126After the input string is converted to an (unsigned) long, the value should be
1127checked if its acceptable. Be careful with further conversions on the value
1128before checking it for validity, as these conversions could still cause a wrap
1129around before the check. For example do not multiply the result, and only
1130add/subtract if it has been divided before the add/subtract.
1131
1132What to do if a value is found to be invalid, depends on the type of the
1133sysfs attribute that is being set. If it is a continuous setting like a
1134tempX_max or inX_max attribute, then the value should be clamped to its
Guenter Roeckc25fb812013-01-09 08:12:46 -08001135limits using clamp_val(value, min_limit, max_limit). If it is not continuous
1136like for example a tempX_type, then when an invalid value is written,
1137-EINVAL should be returned.
Hans de Goede2ed42632007-09-21 17:03:32 +02001138
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001139Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees)::
Jean Delvare5fbea512007-10-07 22:44:33 +02001140
1141 long v = simple_strtol(buf, NULL, 10) / 1000;
Guenter Roeckc25fb812013-01-09 08:12:46 -08001142 v = clamp_val(v, -128, 127);
Jean Delvare5fbea512007-10-07 22:44:33 +02001143 /* write v to register */
Hans de Goede2ed42632007-09-21 17:03:32 +02001144
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001145Example2, fan divider setting, valid values 2, 4 and 8::
Hans de Goede2ed42632007-09-21 17:03:32 +02001146
Jean Delvare5fbea512007-10-07 22:44:33 +02001147 unsigned long v = simple_strtoul(buf, NULL, 10);
1148
1149 switch (v) {
1150 case 2: v = 1; break;
1151 case 4: v = 2; break;
1152 case 8: v = 3; break;
1153 default:
1154 return -EINVAL;
1155 }
1156 /* write v to register */