blob: 13c5acb72d63fe0b55e602f1fcc1b591c65b1e31 [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
Guenter Roecke1576392021-04-19 10:59:48 -070068Attribute access
69----------------
70
71Hardware monitoring sysfs attributes are displayed by unrestricted userspace
72applications. For this reason, all standard ABI attributes shall be world
73readable. Writeable standard ABI attributes shall be writeable only for
74privileged users.
75
Linus Torvalds1da177e2005-04-16 15:20:36 -070076-------------------------------------------------------------------------
77
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030078======= ===========================================
79`[0-*]` denotes any positive number starting from 0
80`[1-*]` denotes any positive number starting from 1
Rudolf Marek057bc352006-06-04 20:03:39 +020081RO read only value
Andre Prendelcd4e96c2009-06-15 18:39:49 +020082WO write only value
Rudolf Marek057bc352006-06-04 20:03:39 +020083RW read/write value
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030084======= ===========================================
Rudolf Marek057bc352006-06-04 20:03:39 +020085
86Read/write values may be read-only for some chips, depending on the
87hardware implementation.
88
Jean Delvare176544d2007-08-20 16:44:44 +020089All entries (except name) are optional, and should only be created in a
90given driver if the chip has the feature.
91
92
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030093*****************
94Global attributes
95*****************
Jean Delvare176544d2007-08-20 16:44:44 +020096
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030097`name`
98 The chip name.
Jean Delvare176544d2007-08-20 16:44:44 +020099 This should be a short, lowercase string, not containing
Guenter Roeckf1728412017-01-24 20:24:36 -0800100 whitespace, dashes, or the wildcard character '*'.
101 This attribute represents the chip name. It is the only
102 mandatory attribute.
Jean Delvare176544d2007-08-20 16:44:44 +0200103 I2C devices get this attribute created automatically.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300104
Jean Delvare176544d2007-08-20 16:44:44 +0200105 RO
106
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300107`update_interval`
108 The interval at which the chip will update readings.
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200109 Unit: millisecond
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300110
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200111 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300112
Guenter Roecka51b9942010-09-17 17:24:14 +0200113 Some devices have a variable update rate or interval.
114 This attribute can be used to change it to the desired value.
Ira W. Snyderd2b847d2010-05-27 19:58:45 +0200115
Jean Delvare740e06a2006-06-05 20:31:20 +0200116
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300117********
118Voltages
119********
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300121`in[0-*]_min`
122 Voltage min value.
123
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300125
Rudolf Marek057bc352006-06-04 20:03:39 +0200126 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300127
128`in[0-*]_lcrit`
129 Voltage critical min value.
130
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200131 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300132
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200133 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300134
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200135 If voltage drops to or below this limit, the system may
136 take drastic action such as power down or reset. At the very
137 least, it should report a fault.
138
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300139`in[0-*]_max`
140 Voltage max value.
141
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300143
Rudolf Marek057bc352006-06-04 20:03:39 +0200144 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300145
146`in[0-*]_crit`
147 Voltage critical max value.
148
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200149 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300150
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200151 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300152
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200153 If voltage reaches or exceeds this limit, the system may
154 take drastic action such as power down or reset. At the very
155 least, it should report a fault.
156
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300157`in[0-*]_input`
158 Voltage input value.
159
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300161
Rudolf Marek057bc352006-06-04 20:03:39 +0200162 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300163
Rudolf Marek057bc352006-06-04 20:03:39 +0200164 Voltage measured on the chip pin.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300165
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 Actual voltage depends on the scaling resistors on the
167 motherboard, as recommended in the chip datasheet.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300168
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169 This varies by chip and by motherboard.
170 Because of this variation, values are generally NOT scaled
171 by the chip driver, and must be done by the application.
172 However, some drivers (notably lm87 and via686a)
Rudolf Marek057bc352006-06-04 20:03:39 +0200173 do scale, because of internal resistors built into a chip.
Jean Delvare176544d2007-08-20 16:44:44 +0200174 These drivers will output the actual voltage. Rule of
175 thumb: drivers should report the voltage values at the
176 "pins" of the chip.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300178`in[0-*]_average`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700179 Average voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300180
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700181 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300182
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700183 RO
184
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300185`in[0-*]_lowest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700186 Historical minimum voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300187
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700188 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300189
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700190 RO
191
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300192`in[0-*]_highest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700193 Historical maximum voltage
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300194
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700195 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300196
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700197 RO
198
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300199`in[0-*]_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700200 Reset inX_lowest and inX_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300201
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700202 WO
203
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300204`in_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700205 Reset inX_lowest and inX_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300206
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700207 WO
208
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300209`in[0-*]_label`
210 Suggested voltage channel label.
211
Jean Delvare176544d2007-08-20 16:44:44 +0200212 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300213
Jean Delvare176544d2007-08-20 16:44:44 +0200214 Should only be created if the driver has hints about what
215 this voltage channel is being used for, and user-space
216 doesn't. In all other cases, the label is provided by
217 user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300218
Jean Delvare176544d2007-08-20 16:44:44 +0200219 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300221`in[0-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530222 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300223
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530224 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300225
226 - 1: Enable
227 - 0: Disable
228
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530229 RW
230
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300231`cpu[0-*]_vid`
232 CPU core reference voltage.
233
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234 Unit: millivolt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300235
Rudolf Marek057bc352006-06-04 20:03:39 +0200236 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300237
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238 Not always correct.
239
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300240`vrm`
241 Voltage Regulator Module version number.
242
Rudolf Marek057bc352006-06-04 20:03:39 +0200243 RW (but changing it should no more be necessary)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300244
Rudolf Marek057bc352006-06-04 20:03:39 +0200245 Originally the VRM standard version multiplied by 10, but now
246 an arbitrary number, as not all standards have a version
247 number.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300248
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249 Affects the way the driver calculates the CPU core reference
250 voltage from the vid pins.
251
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200252`in[0-*]_rated_min`
253 Minimum rated voltage.
254
255 Unit: millivolt
256
257 RO
258
259`in[0-*]_rated_max`
260 Maximum rated voltage.
261
262 Unit: millivolt
263
264 RO
265
Rudolf Marek057bc352006-06-04 20:03:39 +0200266Also see the Alarms section for status flags associated with voltages.
267
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300269****
270Fans
271****
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300273`fan[1-*]_min`
274 Fan minimum value
275
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300277
Rudolf Marek057bc352006-06-04 20:03:39 +0200278 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300280`fan[1-*]_max`
281 Fan maximum value
282
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200283 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300284
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200285 Only rarely supported by the hardware.
286 RW
287
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300288`fan[1-*]_input`
289 Fan input value.
290
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300292
Rudolf Marek057bc352006-06-04 20:03:39 +0200293 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300295`fan[1-*]_div`
296 Fan divisor.
297
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298 Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128).
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300299
Rudolf Marek057bc352006-06-04 20:03:39 +0200300 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300301
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 Some chips only support values 1, 2, 4 and 8.
303 Note that this is actually an internal clock divisor, which
304 affects the measurable speed range, not the read value.
305
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300306`fan[1-*]_pulses`
307 Number of tachometer pulses per fan revolution.
308
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800309 Integer value, typically between 1 and 4.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300310
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800311 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300312
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800313 This value is a characteristic of the fan connected to the
314 device's input, so it has to be set in accordance with the fan
315 model.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300316
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800317 Should only be created if the chip has a register to configure
318 the number of pulses. In the absence of such a register (and
319 thus attribute) the value assumed by all devices is 2 pulses
320 per fan revolution.
321
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300322`fan[1-*]_target`
Jean Delvare2dbc5142007-05-08 17:22:00 +0200323 Desired fan speed
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300324
Jean Delvare2dbc5142007-05-08 17:22:00 +0200325 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300326
Jean Delvare2dbc5142007-05-08 17:22:00 +0200327 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300328
Jean Delvare2dbc5142007-05-08 17:22:00 +0200329 Only makes sense if the chip supports closed-loop fan speed
330 control based on the measured fan speed.
331
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300332`fan[1-*]_label`
333 Suggested fan channel label.
334
Jean Delvare176544d2007-08-20 16:44:44 +0200335 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300336
Jean Delvare176544d2007-08-20 16:44:44 +0200337 Should only be created if the driver has hints about what
338 this fan channel is being used for, and user-space doesn't.
339 In all other cases, the label is provided by user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300340
Jean Delvare176544d2007-08-20 16:44:44 +0200341 RO
342
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300343`fan[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530344 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300345
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530346 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300347
348 - 1: Enable
349 - 0: Disable
350
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530351 RW
352
Rudolf Marek057bc352006-06-04 20:03:39 +0200353Also see the Alarms section for status flags associated with fans.
354
355
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300356***
357PWM
358***
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300360`pwm[1-*]`
361 Pulse width modulation fan control.
362
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 Integer value in the range 0 to 255
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300364
Rudolf Marek057bc352006-06-04 20:03:39 +0200365 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300366
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367 255 is max or 100%.
368
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300369`pwm[1-*]_enable`
Jean Delvare875f25d2007-06-27 21:26:08 +0200370 Fan speed control method:
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300371
372 - 0: no fan speed control (i.e. fan at full speed)
373 - 1: manual fan speed control enabled (using `pwm[1-*]`)
374 - 2+: automatic fan speed control enabled
375
Jean Delvaref8d0c192007-02-14 21:15:02 +0100376 Check individual chip documentation files for automatic mode
377 details.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300378
Rudolf Marek057bc352006-06-04 20:03:39 +0200379 RW
380
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300381`pwm[1-*]_mode`
382 - 0: DC mode (direct current)
383 - 1: PWM mode (pulse-width modulation)
384
Jean Delvaref8d0c192007-02-14 21:15:02 +0100385 RW
386
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300387`pwm[1-*]_freq`
388 Base PWM frequency in Hz.
389
Jean Delvaref8d0c192007-02-14 21:15:02 +0100390 Only possibly available when pwmN_mode is PWM, but not always
391 present even then.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300392
Rudolf Marek057bc352006-06-04 20:03:39 +0200393 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300395`pwm[1-*]_auto_channels_temp`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 Select which temperature channels affect this PWM output in
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300397 auto mode.
398
399 Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc...
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 Which values are possible depend on the chip used.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300401
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`pwm[1-*]_auto_point[1-*]_pwm` / `pwm[1-*]_auto_point[1-*]_temp` / `pwm[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 PWM output channels.
409
Rudolf Marek057bc352006-06-04 20:03:39 +0200410 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300412`temp[1-*]_auto_point[1-*]_pwm` / `temp[1-*]_auto_point[1-*]_temp` / `temp[1-*]_auto_point[1-*]_temp_hyst`
413 Define the PWM vs temperature curve.
414
415 Number of trip points is chip-dependent. Use this for chips
416 which associate trip points to temperature channels.
417
Rudolf Marek057bc352006-06-04 20:03:39 +0200418 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Jean Delvaref7290e22009-12-09 20:35:47 +0100420There is a third case where trip points are associated to both PWM output
421channels and temperature channels: the PWM values are associated to PWM
422output channels while the temperature values are associated to temperature
423channels. In that case, the result is determined by the mapping between
424temperature inputs and PWM outputs. When several temperature inputs are
425mapped to a given PWM output, this leads to several candidate PWM values.
426The actual result is up to the chip, but in general the highest candidate
427value (fastest fan speed) wins.
428
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300430************
431Temperatures
432************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300434`temp[1-*]_type`
435 Sensor type selection.
436
Jean Delvareb26f9332007-08-16 14:30:01 +0200437 Integers 1 to 6
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300438
Rudolf Marek057bc352006-06-04 20:03:39 +0200439 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300440
441 - 1: CPU embedded diode
442 - 2: 3904 transistor
443 - 3: thermal diode
444 - 4: thermistor
445 - 5: AMD AMDSI
446 - 6: Intel PECI
447
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 Not all types are supported by all chips
449
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300450`temp[1-*]_max`
451 Temperature max value.
452
Jean Delvare740e06a2006-06-05 20:31:20 +0200453 Unit: millidegree Celsius (or millivolt, see below)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300454
Rudolf Marek057bc352006-06-04 20:03:39 +0200455 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300457`temp[1-*]_min`
458 Temperature min value.
459
Jean Delvare740e06a2006-06-05 20:31:20 +0200460 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300461
Rudolf Marek057bc352006-06-04 20:03:39 +0200462 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300464`temp[1-*]_max_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 Temperature hysteresis value for max limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300466
Jean Delvare740e06a2006-06-05 20:31:20 +0200467 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300468
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469 Must be reported as an absolute temperature, NOT a delta
470 from the max value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300471
Rudolf Marek057bc352006-06-04 20:03:39 +0200472 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300474`temp[1-*]_min_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200475 Temperature hysteresis value for min limit.
476 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300477
Jean Delvare01325142014-05-25 17:23:07 +0200478 Must be reported as an absolute temperature, NOT a delta
479 from the min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300480
Jean Delvare01325142014-05-25 17:23:07 +0200481 RW
482
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300483`temp[1-*]_input`
484 Temperature input value.
485
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 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300490`temp[1-*]_crit`
491 Temperature critical max value, typically greater than
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 corresponding temp_max values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300493
Jean Delvare740e06a2006-06-05 20:31:20 +0200494 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300495
Rudolf Marek057bc352006-06-04 20:03:39 +0200496 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300498`temp[1-*]_crit_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 Temperature hysteresis value for critical limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300500
Jean Delvare740e06a2006-06-05 20:31:20 +0200501 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300502
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503 Must be reported as an absolute temperature, NOT a delta
504 from the critical value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300505
Rudolf Marek057bc352006-06-04 20:03:39 +0200506 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300508`temp[1-*]_emergency`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200509 Temperature emergency max value, for chips supporting more than
510 two upper temperature limits. Must be equal or greater than
511 corresponding temp_crit values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300512
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200513 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300514
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200515 RW
516
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300517`temp[1-*]_emergency_hyst`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200518 Temperature hysteresis value for emergency limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300519
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200520 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300521
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200522 Must be reported as an absolute temperature, NOT a delta
523 from the emergency value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300524
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200525 RW
526
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300527`temp[1-*]_lcrit`
528 Temperature critical min value, typically lower than
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200529 corresponding temp_min values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300530
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200531 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300532
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200533 RW
534
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300535`temp[1-*]_lcrit_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200536 Temperature hysteresis value for critical min limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300537
Jean Delvare01325142014-05-25 17:23:07 +0200538 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300539
Jean Delvare01325142014-05-25 17:23:07 +0200540 Must be reported as an absolute temperature, NOT a delta
541 from the critical min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300542
Jean Delvare01325142014-05-25 17:23:07 +0200543 RW
544
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300545`temp[1-*]_offset`
Hartmut Rick59ac8362006-03-23 16:37:23 +0100546 Temperature offset which is added to the temperature reading
547 by the chip.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300548
Hartmut Rick59ac8362006-03-23 16:37:23 +0100549 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300550
Hartmut Rick59ac8362006-03-23 16:37:23 +0100551 Read/Write value.
552
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300553`temp[1-*]_label`
554 Suggested temperature channel label.
555
Jean Delvare176544d2007-08-20 16:44:44 +0200556 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300557
Jean Delvare176544d2007-08-20 16:44:44 +0200558 Should only be created if the driver has hints about what
559 this temperature channel is being used for, and user-space
560 doesn't. In all other cases, the label is provided by
561 user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300562
Jean Delvare176544d2007-08-20 16:44:44 +0200563 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300565`temp[1-*]_lowest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200566 Historical minimum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300567
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200568 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300569
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200570 RO
571
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300572`temp[1-*]_highest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200573 Historical maximum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300574
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200575 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300576
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200577 RO
578
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300579`temp[1-*]_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200580 Reset temp_lowest and temp_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300581
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200582 WO
583
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300584`temp_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200585 Reset temp_lowest and temp_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300586
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200587 WO
588
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300589`temp[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530590 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300591
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530592 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300593
594 - 1: Enable
595 - 0: Disable
596
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530597 RW
598
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200599`temp[1-*]_rated_min`
600 Minimum rated temperature.
601
602 Unit: millidegree Celsius
603
604 RO
605
606`temp[1-*]_rated_max`
607 Maximum rated temperature.
608
609 Unit: millidegree Celsius
610
611 RO
612
Jean Delvare740e06a2006-06-05 20:31:20 +0200613Some chips measure temperature using external thermistors and an ADC, and
614report the temperature measurement as a voltage. Converting this voltage
615back to a temperature (or the other way around for limits) requires
616mathematical functions not available in the kernel, so the conversion
617must occur in user space. For these chips, all temp* files described
618above should contain values expressed in millivolt instead of millidegree
619Celsius. In other words, such temperature channels are handled as voltage
620channels by the driver.
621
Rudolf Marek057bc352006-06-04 20:03:39 +0200622Also see the Alarms section for status flags associated with temperatures.
623
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300625********
626Currents
627********
Linus Torvalds1da177e2005-04-16 15:20:36 -0700628
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300629`curr[1-*]_max`
630 Current max value
631
Linus Torvalds1da177e2005-04-16 15:20:36 -0700632 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300633
Rudolf Marek057bc352006-06-04 20:03:39 +0200634 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700635
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300636`curr[1-*]_min`
637 Current min value.
638
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300640
Rudolf Marek057bc352006-06-04 20:03:39 +0200641 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300643`curr[1-*]_lcrit`
644 Current critical low value
645
Guenter Roeck581693b2010-06-28 13:22:27 -0700646 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300647
Guenter Roeck581693b2010-06-28 13:22:27 -0700648 RW
649
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300650`curr[1-*]_crit`
651 Current critical high value.
652
Guenter Roeck581693b2010-06-28 13:22:27 -0700653 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300654
Guenter Roeck581693b2010-06-28 13:22:27 -0700655 RW
656
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300657`curr[1-*]_input`
658 Current input value
659
Linus Torvalds1da177e2005-04-16 15:20:36 -0700660 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300661
Rudolf Marek057bc352006-06-04 20:03:39 +0200662 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300664`curr[1-*]_average`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700665 Average current use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300666
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700667 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300668
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700669 RO
670
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300671`curr[1-*]_lowest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700672 Historical minimum current
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300673
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700674 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300675
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700676 RO
677
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300678`curr[1-*]_highest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700679 Historical maximum current
680 Unit: milliampere
681 RO
682
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300683`curr[1-*]_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700684 Reset currX_lowest and currX_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300685
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700686 WO
687
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300688`curr_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700689 Reset currX_lowest and currX_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300690
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700691 WO
692
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300693`curr[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530694 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300695
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530696 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300697
698 - 1: Enable
699 - 0: Disable
700
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530701 RW
702
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200703`curr[1-*]_rated_min`
704 Minimum rated current.
705
706 Unit: milliampere
707
708 RO
709
710`curr[1-*]_rated_max`
711 Maximum rated current.
712
713 Unit: milliampere
714
715 RO
716
Guenter Roeck581693b2010-06-28 13:22:27 -0700717Also see the Alarms section for status flags associated with currents.
718
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300719*****
720Power
721*****
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700722
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300723`power[1-*]_average`
724 Average power use
725
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700726 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300727
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700728 RO
729
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300730`power[1-*]_average_interval`
731 Power use averaging interval. A poll
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700732 notification is sent to this file if the
733 hardware changes the averaging interval.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300734
Darrick J. Wongddedc652008-10-09 15:33:58 +0200735 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300736
Darrick J. Wongddedc652008-10-09 15:33:58 +0200737 RW
738
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300739`power[1-*]_average_interval_max`
740 Maximum power use averaging interval
741
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700742 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300743
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700744 RO
745
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300746`power[1-*]_average_interval_min`
747 Minimum power use averaging interval
748
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700749 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300750
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700751 RO
752
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300753`power[1-*]_average_highest`
754 Historical average maximum power use
755
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700756 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300757
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700758 RO
759
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300760`power[1-*]_average_lowest`
761 Historical average minimum power use
762
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700763 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300764
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700765 RO
766
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300767`power[1-*]_average_max`
768 A poll notification is sent to
769 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700770 rises above this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300771
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700772 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300773
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700774 RW
775
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300776`power[1-*]_average_min`
777 A poll notification is sent to
778 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700779 sinks below this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300780
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700781 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300782
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700783 RW
784
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300785`power[1-*]_input`
786 Instantaneous power use
787
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700788 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300789
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700790 RO
791
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300792`power[1-*]_input_highest`
793 Historical maximum power use
794
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700795 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300796
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700797 RO
798
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300799`power[1-*]_input_lowest`
800 Historical minimum power use
801
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700802 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300803
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700804 RO
805
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300806`power[1-*]_reset_history`
807 Reset input_highest, input_lowest,
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700808 average_highest and average_lowest.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300809
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700810 WO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300812`power[1-*]_accuracy`
813 Accuracy of the power meter.
814
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700815 Unit: Percent
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300816
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700817 RO
818
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300819`power[1-*]_cap`
820 If power use rises above this limit, the
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700821 system should take action to reduce power use.
822 A poll notification is sent to this file if the
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300823 cap is changed by the hardware. The `*_cap`
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700824 files only appear if the cap is known to be
825 enforced by hardware.
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_hyst`
832 Margin of hysteresis built around capping and
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700833 notification.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300834
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700835 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300836
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700837 RW
838
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300839`power[1-*]_cap_max`
840 Maximum cap that can be set.
841
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700842 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300843
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700844 RO
845
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300846`power[1-*]_cap_min`
847 Minimum cap that can be set.
848
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700849 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300850
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700851 RO
852
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300853`power[1-*]_max`
854 Maximum power.
855
Guenter Roeck581693b2010-06-28 13:22:27 -0700856 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300857
Guenter Roeck581693b2010-06-28 13:22:27 -0700858 RW
859
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300860`power[1-*]_crit`
861 Critical maximum power.
862
Guenter Roeck581693b2010-06-28 13:22:27 -0700863 If power rises to or above this limit, the
864 system is expected take drastic action to reduce
865 power consumption, such as a system shutdown or
866 a forced powerdown of some devices.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300867
Guenter Roeck581693b2010-06-28 13:22:27 -0700868 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300869
Guenter Roeck581693b2010-06-28 13:22:27 -0700870 RW
871
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300872`power[1-*]_enable`
873 Enable or disable the sensors.
874
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530875 When disabled the sensor read will return
876 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300877
878 - 1: Enable
879 - 0: Disable
880
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530881 RW
882
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200883`power[1-*]_rated_min`
884 Minimum rated power.
885
886 Unit: microWatt
887
888 RO
889
890`power[1-*]_rated_max`
891 Maximum rated power.
892
893 Unit: microWatt
894
895 RO
896
Guenter Roeck581693b2010-06-28 13:22:27 -0700897Also see the Alarms section for status flags associated with power readings.
898
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300899******
900Energy
901******
Darrick J. Wongddedc652008-10-09 15:33:58 +0200902
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300903`energy[1-*]_input`
904 Cumulative energy use
905
Darrick J. Wongddedc652008-10-09 15:33:58 +0200906 Unit: microJoule
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300907
Darrick J. Wongddedc652008-10-09 15:33:58 +0200908 RO
909
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300910`energy[1-*]_enable`
911 Enable or disable the sensors.
912
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530913 When disabled the sensor read will return
914 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300915
916 - 1: Enable
917 - 0: Disable
918
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530919 RW
Jean Delvareec199202009-03-30 21:46:44 +0200920
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300921********
922Humidity
923********
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800924
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300925`humidity[1-*]_input`
926 Humidity
927
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800928 Unit: milli-percent (per cent mille, pcm)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300929
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800930 RO
931
932
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300933`humidity[1-*]_enable`
934 Enable or disable the sensors
935
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530936 When disabled the sensor read will return
937 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300938
939 - 1: Enable
940 - 0: Disable
941
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530942 RW
943
Zbigniew Lukwinskie8e612352020-07-31 21:37:15 +0200944`humidity[1-*]_rated_min`
945 Minimum rated humidity.
946
947 Unit: milli-percent (per cent mille, pcm)
948
949 RO
950
951`humidity[1-*]_rated_max`
952 Maximum rated humidity.
953
954 Unit: milli-percent (per cent mille, pcm)
955
956 RO
957
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300958******
959Alarms
960******
Jean Delvare400b48e2006-03-23 16:46:47 +0100961
962Each channel or limit may have an associated alarm file, containing a
963boolean value. 1 means than an alarm condition exists, 0 means no alarm.
964
965Usually a given chip will either use channel-related alarms, or
966limit-related alarms, not both. The driver should just reflect the hardware
967implementation.
968
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300969+-------------------------------+-----------------------+
970| **`in[0-*]_alarm`, | Channel alarm |
971| `curr[1-*]_alarm`, | |
972| `power[1-*]_alarm`, | - 0: no alarm |
973| `fan[1-*]_alarm`, | - 1: alarm |
974| `temp[1-*]_alarm`** | |
975| | RO |
976+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +0100977
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300978**OR**
Jean Delvare400b48e2006-03-23 16:46:47 +0100979
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300980+-------------------------------+-----------------------+
981| **`in[0-*]_min_alarm`, | Limit alarm |
982| `in[0-*]_max_alarm`, | |
983| `in[0-*]_lcrit_alarm`, | - 0: no alarm |
984| `in[0-*]_crit_alarm`, | - 1: alarm |
985| `curr[1-*]_min_alarm`, | |
986| `curr[1-*]_max_alarm`, | RO |
987| `curr[1-*]_lcrit_alarm`, | |
988| `curr[1-*]_crit_alarm`, | |
989| `power[1-*]_cap_alarm`, | |
990| `power[1-*]_max_alarm`, | |
991| `power[1-*]_crit_alarm`, | |
992| `fan[1-*]_min_alarm`, | |
993| `fan[1-*]_max_alarm`, | |
994| `temp[1-*]_min_alarm`, | |
995| `temp[1-*]_max_alarm`, | |
996| `temp[1-*]_lcrit_alarm`, | |
997| `temp[1-*]_crit_alarm`, | |
998| `temp[1-*]_emergency_alarm`** | |
999+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +01001000
1001Each input channel may have an associated fault file. This can be used
1002to notify open diodes, unconnected fans etc. where the hardware
1003supports it. When this boolean has value 1, the measurement for that
1004channel should not be trusted.
1005
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001006`fan[1-*]_fault` / `temp[1-*]_fault`
Jean Delvare400b48e2006-03-23 16:46:47 +01001007 Input fault condition
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001008
1009 - 0: no fault occurred
1010 - 1: fault condition
1011
Rudolf Marek057bc352006-06-04 20:03:39 +02001012 RO
Jean Delvare400b48e2006-03-23 16:46:47 +01001013
1014Some chips also offer the possibility to get beeped when an alarm occurs:
1015
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001016`beep_enable`
1017 Master beep enable
1018
1019 - 0: no beeps
1020 - 1: beeps
1021
Rudolf Marek057bc352006-06-04 20:03:39 +02001022 RW
Jean Delvare400b48e2006-03-23 16:46:47 +01001023
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001024`in[0-*]_beep`, `curr[1-*]_beep`, `fan[1-*]_beep`, `temp[1-*]_beep`,
Jean Delvare400b48e2006-03-23 16:46:47 +01001025 Channel beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001026
1027 - 0: disable
1028 - 1: enable
1029
Rudolf Marek057bc352006-06-04 20:03:39 +02001030 RW
Jean Delvare400b48e2006-03-23 16:46:47 +01001031
1032In theory, a chip could provide per-limit beep masking, but no such chip
1033was seen so far.
1034
1035Old drivers provided a different, non-standard interface to alarms and
1036beeps. These interface files are deprecated, but will be kept around
1037for compatibility reasons:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001038
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001039`alarms`
1040 Alarm bitmask.
1041
Rudolf Marek057bc352006-06-04 20:03:39 +02001042 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001043
Linus Torvalds1da177e2005-04-16 15:20:36 -07001044 Integer representation of one to four bytes.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001045
Linus Torvalds1da177e2005-04-16 15:20:36 -07001046 A '1' bit means an alarm.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001047
Linus Torvalds1da177e2005-04-16 15:20:36 -07001048 Chips should be programmed for 'comparator' mode so that
1049 the alarm will 'come back' after you read the register
1050 if it is still valid.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001051
Linus Torvalds1da177e2005-04-16 15:20:36 -07001052 Generally a direct representation of a chip's internal
1053 alarm registers; there is no standard for the position
Jean Delvare400b48e2006-03-23 16:46:47 +01001054 of individual bits. For this reason, the use of this
1055 interface file for new drivers is discouraged. Use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001056 `individual *_alarm` and `*_fault` files instead.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001057 Bits are defined in kernel/include/sensors.h.
1058
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001059`beep_mask`
1060 Bitmask for beep.
Jean Delvare400b48e2006-03-23 16:46:47 +01001061 Same format as 'alarms' with the same bit locations,
1062 use discouraged for the same reason. Use individual
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001063 `*_beep` files instead.
Rudolf Marek057bc352006-06-04 20:03:39 +02001064 RW
Hans de Goede2ed42632007-09-21 17:03:32 +02001065
1066
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001067*******************
1068Intrusion detection
1069*******************
Jean Delvareec199202009-03-30 21:46:44 +02001070
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001071`intrusion[0-*]_alarm`
Jean Delvareec199202009-03-30 21:46:44 +02001072 Chassis intrusion detection
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001073
1074 - 0: OK
1075 - 1: intrusion detected
1076
Jean Delvareec199202009-03-30 21:46:44 +02001077 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001078
Jean Delvareec199202009-03-30 21:46:44 +02001079 Contrary to regular alarm flags which clear themselves
1080 automatically when read, this one sticks until cleared by
1081 the user. This is done by writing 0 to the file. Writing
1082 other values is unsupported.
1083
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001084`intrusion[0-*]_beep`
Jean Delvareec199202009-03-30 21:46:44 +02001085 Chassis intrusion beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001086
Jean Delvareec199202009-03-30 21:46:44 +02001087 0: disable
1088 1: enable
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001089
Jean Delvareec199202009-03-30 21:46:44 +02001090 RW
1091
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001092****************************
1093Average sample configuration
1094****************************
Adamski, Krzysztof (Nokia - PL/Wroclaw)bfe033a2019-04-14 21:58:40 +00001095
1096Devices allowing for reading {in,power,curr,temp}_average values may export
1097attributes for controlling number of samples used to compute average.
1098
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001099+--------------+---------------------------------------------------------------+
1100| samples | Sets number of average samples for all types of measurements. |
1101| | |
1102| | RW |
1103+--------------+---------------------------------------------------------------+
1104| in_samples | Sets number of average samples for specific type of |
1105| power_samples| measurements. |
1106| curr_samples | |
1107| temp_samples | Note that on some devices it won't be possible to set all of |
1108| | them to different values so changing one might also change |
1109| | some others. |
1110| | |
1111| | RW |
1112+--------------+---------------------------------------------------------------+
Jean Delvareec199202009-03-30 21:46:44 +02001113
Hans de Goede2ed42632007-09-21 17:03:32 +02001114sysfs attribute writes interpretation
1115-------------------------------------
1116
1117hwmon sysfs attributes always contain numbers, so the first thing to do is to
1118convert the input to a number, there are 2 ways todo this depending whether
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001119the number can be negative or not::
1120
1121 unsigned long u = simple_strtoul(buf, NULL, 10);
1122 long s = simple_strtol(buf, NULL, 10);
Hans de Goede2ed42632007-09-21 17:03:32 +02001123
1124With buf being the buffer with the user input being passed by the kernel.
1125Notice that we do not use the second argument of strto[u]l, and thus cannot
1126tell when 0 is returned, if this was really 0 or is caused by invalid input.
1127This is done deliberately as checking this everywhere would add a lot of
1128code to the kernel.
1129
1130Notice that it is important to always store the converted value in an
1131unsigned long or long, so that no wrap around can happen before any further
1132checking.
1133
1134After the input string is converted to an (unsigned) long, the value should be
1135checked if its acceptable. Be careful with further conversions on the value
1136before checking it for validity, as these conversions could still cause a wrap
1137around before the check. For example do not multiply the result, and only
1138add/subtract if it has been divided before the add/subtract.
1139
1140What to do if a value is found to be invalid, depends on the type of the
1141sysfs attribute that is being set. If it is a continuous setting like a
1142tempX_max or inX_max attribute, then the value should be clamped to its
Guenter Roeckc25fb812013-01-09 08:12:46 -08001143limits using clamp_val(value, min_limit, max_limit). If it is not continuous
1144like for example a tempX_type, then when an invalid value is written,
1145-EINVAL should be returned.
Hans de Goede2ed42632007-09-21 17:03:32 +02001146
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001147Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees)::
Jean Delvare5fbea512007-10-07 22:44:33 +02001148
1149 long v = simple_strtol(buf, NULL, 10) / 1000;
Guenter Roeckc25fb812013-01-09 08:12:46 -08001150 v = clamp_val(v, -128, 127);
Jean Delvare5fbea512007-10-07 22:44:33 +02001151 /* write v to register */
Hans de Goede2ed42632007-09-21 17:03:32 +02001152
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001153Example2, fan divider setting, valid values 2, 4 and 8::
Hans de Goede2ed42632007-09-21 17:03:32 +02001154
Jean Delvare5fbea512007-10-07 22:44:33 +02001155 unsigned long v = simple_strtoul(buf, NULL, 10);
1156
1157 switch (v) {
1158 case 2: v = 1; break;
1159 case 4: v = 2; break;
1160 case 8: v = 3; break;
1161 default:
1162 return -EINVAL;
1163 }
1164 /* write v to register */