blob: fd590633bb14b394d6045d8dbc85b6d503d57a5b [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
Rudolf Marek057bc352006-06-04 20:03:39 +0200244Also see the Alarms section for status flags associated with voltages.
245
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300247****
248Fans
249****
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300251`fan[1-*]_min`
252 Fan minimum value
253
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300255
Rudolf Marek057bc352006-06-04 20:03:39 +0200256 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300258`fan[1-*]_max`
259 Fan maximum value
260
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200261 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300262
Christian Engelmayerd54d4622009-06-01 13:46:50 +0200263 Only rarely supported by the hardware.
264 RW
265
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300266`fan[1-*]_input`
267 Fan input value.
268
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300270
Rudolf Marek057bc352006-06-04 20:03:39 +0200271 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300273`fan[1-*]_div`
274 Fan divisor.
275
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128).
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300277
Rudolf Marek057bc352006-06-04 20:03:39 +0200278 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300279
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280 Some chips only support values 1, 2, 4 and 8.
281 Note that this is actually an internal clock divisor, which
282 affects the measurable speed range, not the read value.
283
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300284`fan[1-*]_pulses`
285 Number of tachometer pulses per fan revolution.
286
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800287 Integer value, typically between 1 and 4.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300288
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800289 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300290
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800291 This value is a characteristic of the fan connected to the
292 device's input, so it has to be set in accordance with the fan
293 model.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300294
Guenter Roeck2d2e1482011-03-02 15:19:35 -0800295 Should only be created if the chip has a register to configure
296 the number of pulses. In the absence of such a register (and
297 thus attribute) the value assumed by all devices is 2 pulses
298 per fan revolution.
299
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300300`fan[1-*]_target`
Jean Delvare2dbc5142007-05-08 17:22:00 +0200301 Desired fan speed
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300302
Jean Delvare2dbc5142007-05-08 17:22:00 +0200303 Unit: revolution/min (RPM)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300304
Jean Delvare2dbc5142007-05-08 17:22:00 +0200305 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300306
Jean Delvare2dbc5142007-05-08 17:22:00 +0200307 Only makes sense if the chip supports closed-loop fan speed
308 control based on the measured fan speed.
309
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300310`fan[1-*]_label`
311 Suggested fan channel label.
312
Jean Delvare176544d2007-08-20 16:44:44 +0200313 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300314
Jean Delvare176544d2007-08-20 16:44:44 +0200315 Should only be created if the driver has hints about what
316 this fan channel is being used for, and user-space doesn't.
317 In all other cases, the label is provided by user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300318
Jean Delvare176544d2007-08-20 16:44:44 +0200319 RO
320
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300321`fan[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530322 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300323
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530324 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300325
326 - 1: Enable
327 - 0: Disable
328
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530329 RW
330
Rudolf Marek057bc352006-06-04 20:03:39 +0200331Also see the Alarms section for status flags associated with fans.
332
333
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300334***
335PWM
336***
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300338`pwm[1-*]`
339 Pulse width modulation fan control.
340
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 Integer value in the range 0 to 255
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300342
Rudolf Marek057bc352006-06-04 20:03:39 +0200343 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300344
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345 255 is max or 100%.
346
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300347`pwm[1-*]_enable`
Jean Delvare875f25d2007-06-27 21:26:08 +0200348 Fan speed control method:
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300349
350 - 0: no fan speed control (i.e. fan at full speed)
351 - 1: manual fan speed control enabled (using `pwm[1-*]`)
352 - 2+: automatic fan speed control enabled
353
Jean Delvaref8d0c192007-02-14 21:15:02 +0100354 Check individual chip documentation files for automatic mode
355 details.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300356
Rudolf Marek057bc352006-06-04 20:03:39 +0200357 RW
358
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300359`pwm[1-*]_mode`
360 - 0: DC mode (direct current)
361 - 1: PWM mode (pulse-width modulation)
362
Jean Delvaref8d0c192007-02-14 21:15:02 +0100363 RW
364
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300365`pwm[1-*]_freq`
366 Base PWM frequency in Hz.
367
Jean Delvaref8d0c192007-02-14 21:15:02 +0100368 Only possibly available when pwmN_mode is PWM, but not always
369 present even then.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300370
Rudolf Marek057bc352006-06-04 20:03:39 +0200371 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300373`pwm[1-*]_auto_channels_temp`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374 Select which temperature channels affect this PWM output in
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300375 auto mode.
376
377 Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc...
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378 Which values are possible depend on the chip used.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300379
Rudolf Marek057bc352006-06-04 20:03:39 +0200380 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300382`pwm[1-*]_auto_point[1-*]_pwm` / `pwm[1-*]_auto_point[1-*]_temp` / `pwm[1-*]_auto_point[1-*]_temp_hyst`
383 Define the PWM vs temperature curve.
384
385 Number of trip points is chip-dependent. Use this for chips
386 which associate trip points to PWM output channels.
387
Rudolf Marek057bc352006-06-04 20:03:39 +0200388 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300390`temp[1-*]_auto_point[1-*]_pwm` / `temp[1-*]_auto_point[1-*]_temp` / `temp[1-*]_auto_point[1-*]_temp_hyst`
391 Define the PWM vs temperature curve.
392
393 Number of trip points is chip-dependent. Use this for chips
394 which associate trip points to temperature channels.
395
Rudolf Marek057bc352006-06-04 20:03:39 +0200396 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397
Jean Delvaref7290e22009-12-09 20:35:47 +0100398There is a third case where trip points are associated to both PWM output
399channels and temperature channels: the PWM values are associated to PWM
400output channels while the temperature values are associated to temperature
401channels. In that case, the result is determined by the mapping between
402temperature inputs and PWM outputs. When several temperature inputs are
403mapped to a given PWM output, this leads to several candidate PWM values.
404The actual result is up to the chip, but in general the highest candidate
405value (fastest fan speed) wins.
406
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300408************
409Temperatures
410************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300412`temp[1-*]_type`
413 Sensor type selection.
414
Jean Delvareb26f9332007-08-16 14:30:01 +0200415 Integers 1 to 6
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300416
Rudolf Marek057bc352006-06-04 20:03:39 +0200417 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300418
419 - 1: CPU embedded diode
420 - 2: 3904 transistor
421 - 3: thermal diode
422 - 4: thermistor
423 - 5: AMD AMDSI
424 - 6: Intel PECI
425
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426 Not all types are supported by all chips
427
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300428`temp[1-*]_max`
429 Temperature max value.
430
Jean Delvare740e06a2006-06-05 20:31:20 +0200431 Unit: millidegree Celsius (or millivolt, see below)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300432
Rudolf Marek057bc352006-06-04 20:03:39 +0200433 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300435`temp[1-*]_min`
436 Temperature min value.
437
Jean Delvare740e06a2006-06-05 20:31:20 +0200438 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300439
Rudolf Marek057bc352006-06-04 20:03:39 +0200440 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300442`temp[1-*]_max_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443 Temperature hysteresis value for max limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300444
Jean Delvare740e06a2006-06-05 20:31:20 +0200445 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300446
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 Must be reported as an absolute temperature, NOT a delta
448 from the max value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300449
Rudolf Marek057bc352006-06-04 20:03:39 +0200450 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300452`temp[1-*]_min_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200453 Temperature hysteresis value for min limit.
454 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300455
Jean Delvare01325142014-05-25 17:23:07 +0200456 Must be reported as an absolute temperature, NOT a delta
457 from the min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300458
Jean Delvare01325142014-05-25 17:23:07 +0200459 RW
460
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300461`temp[1-*]_input`
462 Temperature input value.
463
Jean Delvare740e06a2006-06-05 20:31:20 +0200464 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300465
Rudolf Marek057bc352006-06-04 20:03:39 +0200466 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300468`temp[1-*]_crit`
469 Temperature critical max value, typically greater than
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470 corresponding temp_max values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300471
Jean Delvare740e06a2006-06-05 20:31:20 +0200472 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300473
Rudolf Marek057bc352006-06-04 20:03:39 +0200474 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300476`temp[1-*]_crit_hyst`
Linus Torvalds1da177e2005-04-16 15:20:36 -0700477 Temperature hysteresis value for critical limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300478
Jean Delvare740e06a2006-06-05 20:31:20 +0200479 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300480
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481 Must be reported as an absolute temperature, NOT a delta
482 from the critical value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300483
Rudolf Marek057bc352006-06-04 20:03:39 +0200484 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300486`temp[1-*]_emergency`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200487 Temperature emergency max value, for chips supporting more than
488 two upper temperature limits. Must be equal or greater than
489 corresponding temp_crit values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300490
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200491 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300492
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200493 RW
494
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300495`temp[1-*]_emergency_hyst`
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200496 Temperature hysteresis value for emergency limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300497
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200498 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300499
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200500 Must be reported as an absolute temperature, NOT a delta
501 from the emergency value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300502
Guenter Roeck28e7438f2010-10-28 20:31:42 +0200503 RW
504
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300505`temp[1-*]_lcrit`
506 Temperature critical min value, typically lower than
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200507 corresponding temp_min values.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300508
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200509 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300510
Guenter Roeckf46fc8c2010-08-14 21:08:52 +0200511 RW
512
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300513`temp[1-*]_lcrit_hyst`
Jean Delvare01325142014-05-25 17:23:07 +0200514 Temperature hysteresis value for critical min limit.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300515
Jean Delvare01325142014-05-25 17:23:07 +0200516 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300517
Jean Delvare01325142014-05-25 17:23:07 +0200518 Must be reported as an absolute temperature, NOT a delta
519 from the critical min value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300520
Jean Delvare01325142014-05-25 17:23:07 +0200521 RW
522
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300523`temp[1-*]_offset`
Hartmut Rick59ac8362006-03-23 16:37:23 +0100524 Temperature offset which is added to the temperature reading
525 by the chip.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300526
Hartmut Rick59ac8362006-03-23 16:37:23 +0100527 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300528
Hartmut Rick59ac8362006-03-23 16:37:23 +0100529 Read/Write value.
530
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300531`temp[1-*]_label`
532 Suggested temperature channel label.
533
Jean Delvare176544d2007-08-20 16:44:44 +0200534 Text string
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300535
Jean Delvare176544d2007-08-20 16:44:44 +0200536 Should only be created if the driver has hints about what
537 this temperature channel is being used for, and user-space
538 doesn't. In all other cases, the label is provided by
539 user-space.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300540
Jean Delvare176544d2007-08-20 16:44:44 +0200541 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300543`temp[1-*]_lowest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200544 Historical minimum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300545
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200546 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300547
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200548 RO
549
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300550`temp[1-*]_highest`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200551 Historical maximum temperature
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300552
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200553 Unit: millidegree Celsius
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300554
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200555 RO
556
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300557`temp[1-*]_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200558 Reset temp_lowest and temp_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300559
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200560 WO
561
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300562`temp_reset_history`
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200563 Reset temp_lowest and temp_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300564
Andre Prendelcd4e96c2009-06-15 18:39:49 +0200565 WO
566
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300567`temp[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530568 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300569
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530570 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300571
572 - 1: Enable
573 - 0: Disable
574
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530575 RW
576
Jean Delvare740e06a2006-06-05 20:31:20 +0200577Some chips measure temperature using external thermistors and an ADC, and
578report the temperature measurement as a voltage. Converting this voltage
579back to a temperature (or the other way around for limits) requires
580mathematical functions not available in the kernel, so the conversion
581must occur in user space. For these chips, all temp* files described
582above should contain values expressed in millivolt instead of millidegree
583Celsius. In other words, such temperature channels are handled as voltage
584channels by the driver.
585
Rudolf Marek057bc352006-06-04 20:03:39 +0200586Also see the Alarms section for status flags associated with temperatures.
587
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300589********
590Currents
591********
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300593`curr[1-*]_max`
594 Current max value
595
Linus Torvalds1da177e2005-04-16 15:20:36 -0700596 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300597
Rudolf Marek057bc352006-06-04 20:03:39 +0200598 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300600`curr[1-*]_min`
601 Current min value.
602
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300604
Rudolf Marek057bc352006-06-04 20:03:39 +0200605 RW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300607`curr[1-*]_lcrit`
608 Current critical low value
609
Guenter Roeck581693b2010-06-28 13:22:27 -0700610 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300611
Guenter Roeck581693b2010-06-28 13:22:27 -0700612 RW
613
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300614`curr[1-*]_crit`
615 Current critical high value.
616
Guenter Roeck581693b2010-06-28 13:22:27 -0700617 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300618
Guenter Roeck581693b2010-06-28 13:22:27 -0700619 RW
620
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300621`curr[1-*]_input`
622 Current input 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 RO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700627
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300628`curr[1-*]_average`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700629 Average current use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300630
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700631 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300632
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700633 RO
634
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300635`curr[1-*]_lowest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700636 Historical minimum current
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300637
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700638 Unit: milliampere
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300639
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700640 RO
641
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300642`curr[1-*]_highest`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700643 Historical maximum current
644 Unit: milliampere
645 RO
646
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300647`curr[1-*]_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700648 Reset currX_lowest and currX_highest
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300649
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700650 WO
651
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300652`curr_reset_history`
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700653 Reset currX_lowest and currX_highest for all sensors
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300654
Guenter Roeck0084e9f2011-07-09 10:32:11 -0700655 WO
656
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300657`curr[1-*]_enable`
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530658 Enable or disable the sensors.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300659
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530660 When disabled the sensor read will return -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300661
662 - 1: Enable
663 - 0: Disable
664
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530665 RW
666
Guenter Roeck581693b2010-06-28 13:22:27 -0700667Also see the Alarms section for status flags associated with currents.
668
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300669*****
670Power
671*****
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700672
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300673`power[1-*]_average`
674 Average power use
675
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700676 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300677
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700678 RO
679
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300680`power[1-*]_average_interval`
681 Power use averaging interval. A poll
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700682 notification is sent to this file if the
683 hardware changes the averaging interval.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300684
Darrick J. Wongddedc652008-10-09 15:33:58 +0200685 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300686
Darrick J. Wongddedc652008-10-09 15:33:58 +0200687 RW
688
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300689`power[1-*]_average_interval_max`
690 Maximum power use averaging interval
691
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700692 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300693
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700694 RO
695
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300696`power[1-*]_average_interval_min`
697 Minimum power use averaging interval
698
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700699 Unit: milliseconds
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300700
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700701 RO
702
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300703`power[1-*]_average_highest`
704 Historical average maximum power use
705
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700706 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300707
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700708 RO
709
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300710`power[1-*]_average_lowest`
711 Historical average minimum power use
712
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700713 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300714
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700715 RO
716
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300717`power[1-*]_average_max`
718 A poll notification is sent to
719 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700720 rises above this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300721
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700722 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300723
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700724 RW
725
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300726`power[1-*]_average_min`
727 A poll notification is sent to
728 `power[1-*]_average` when power use
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700729 sinks below this value.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300730
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700731 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300732
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700733 RW
734
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300735`power[1-*]_input`
736 Instantaneous power use
737
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700738 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300739
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700740 RO
741
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300742`power[1-*]_input_highest`
743 Historical maximum power use
744
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700745 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300746
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700747 RO
748
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300749`power[1-*]_input_lowest`
750 Historical minimum power use
751
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700752 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300753
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700754 RO
755
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300756`power[1-*]_reset_history`
757 Reset input_highest, input_lowest,
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700758 average_highest and average_lowest.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300759
Darrick J. Wong38fb56a2007-10-09 13:39:24 -0700760 WO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300762`power[1-*]_accuracy`
763 Accuracy of the power meter.
764
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700765 Unit: Percent
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300766
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700767 RO
768
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300769`power[1-*]_cap`
770 If power use rises above this limit, the
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700771 system should take action to reduce power use.
772 A poll notification is sent to this file if the
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300773 cap is changed by the hardware. The `*_cap`
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700774 files only appear if the cap is known to be
775 enforced by hardware.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300776
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700777 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300778
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700779 RW
780
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300781`power[1-*]_cap_hyst`
782 Margin of hysteresis built around capping and
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700783 notification.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300784
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700785 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300786
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700787 RW
788
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300789`power[1-*]_cap_max`
790 Maximum cap that can be set.
791
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700792 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300793
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700794 RO
795
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300796`power[1-*]_cap_min`
797 Minimum cap that can be set.
798
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700799 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300800
Darrick J. Wong115a57c2009-10-26 16:50:07 -0700801 RO
802
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300803`power[1-*]_max`
804 Maximum power.
805
Guenter Roeck581693b2010-06-28 13:22:27 -0700806 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300807
Guenter Roeck581693b2010-06-28 13:22:27 -0700808 RW
809
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300810`power[1-*]_crit`
811 Critical maximum power.
812
Guenter Roeck581693b2010-06-28 13:22:27 -0700813 If power rises to or above this limit, the
814 system is expected take drastic action to reduce
815 power consumption, such as a system shutdown or
816 a forced powerdown of some devices.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300817
Guenter Roeck581693b2010-06-28 13:22:27 -0700818 Unit: microWatt
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300819
Guenter Roeck581693b2010-06-28 13:22:27 -0700820 RW
821
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300822`power[1-*]_enable`
823 Enable or disable the sensors.
824
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530825 When disabled the sensor read will return
826 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300827
828 - 1: Enable
829 - 0: Disable
830
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530831 RW
832
Guenter Roeck581693b2010-06-28 13:22:27 -0700833Also see the Alarms section for status flags associated with power readings.
834
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300835******
836Energy
837******
Darrick J. Wongddedc652008-10-09 15:33:58 +0200838
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300839`energy[1-*]_input`
840 Cumulative energy use
841
Darrick J. Wongddedc652008-10-09 15:33:58 +0200842 Unit: microJoule
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300843
Darrick J. Wongddedc652008-10-09 15:33:58 +0200844 RO
845
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300846`energy[1-*]_enable`
847 Enable or disable the sensors.
848
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530849 When disabled the sensor read will return
850 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300851
852 - 1: Enable
853 - 0: Disable
854
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530855 RW
Jean Delvareec199202009-03-30 21:46:44 +0200856
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300857********
858Humidity
859********
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800860
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300861`humidity[1-*]_input`
862 Humidity
863
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800864 Unit: milli-percent (per cent mille, pcm)
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300865
Guenter Roeckc6c2c162011-01-06 07:52:03 -0800866 RO
867
868
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300869`humidity[1-*]_enable`
870 Enable or disable the sensors
871
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530872 When disabled the sensor read will return
873 -ENODATA.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300874
875 - 1: Enable
876 - 0: Disable
877
Shilpasri G Bhatfb41a712018-07-06 17:26:06 +0530878 RW
879
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300880******
881Alarms
882******
Jean Delvare400b48e2006-03-23 16:46:47 +0100883
884Each channel or limit may have an associated alarm file, containing a
885boolean value. 1 means than an alarm condition exists, 0 means no alarm.
886
887Usually a given chip will either use channel-related alarms, or
888limit-related alarms, not both. The driver should just reflect the hardware
889implementation.
890
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300891+-------------------------------+-----------------------+
892| **`in[0-*]_alarm`, | Channel alarm |
893| `curr[1-*]_alarm`, | |
894| `power[1-*]_alarm`, | - 0: no alarm |
895| `fan[1-*]_alarm`, | - 1: alarm |
896| `temp[1-*]_alarm`** | |
897| | RO |
898+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +0100899
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300900**OR**
Jean Delvare400b48e2006-03-23 16:46:47 +0100901
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300902+-------------------------------+-----------------------+
903| **`in[0-*]_min_alarm`, | Limit alarm |
904| `in[0-*]_max_alarm`, | |
905| `in[0-*]_lcrit_alarm`, | - 0: no alarm |
906| `in[0-*]_crit_alarm`, | - 1: alarm |
907| `curr[1-*]_min_alarm`, | |
908| `curr[1-*]_max_alarm`, | RO |
909| `curr[1-*]_lcrit_alarm`, | |
910| `curr[1-*]_crit_alarm`, | |
911| `power[1-*]_cap_alarm`, | |
912| `power[1-*]_max_alarm`, | |
913| `power[1-*]_crit_alarm`, | |
914| `fan[1-*]_min_alarm`, | |
915| `fan[1-*]_max_alarm`, | |
916| `temp[1-*]_min_alarm`, | |
917| `temp[1-*]_max_alarm`, | |
918| `temp[1-*]_lcrit_alarm`, | |
919| `temp[1-*]_crit_alarm`, | |
920| `temp[1-*]_emergency_alarm`** | |
921+-------------------------------+-----------------------+
Jean Delvare400b48e2006-03-23 16:46:47 +0100922
923Each input channel may have an associated fault file. This can be used
924to notify open diodes, unconnected fans etc. where the hardware
925supports it. When this boolean has value 1, the measurement for that
926channel should not be trusted.
927
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300928`fan[1-*]_fault` / `temp[1-*]_fault`
Jean Delvare400b48e2006-03-23 16:46:47 +0100929 Input fault condition
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300930
931 - 0: no fault occurred
932 - 1: fault condition
933
Rudolf Marek057bc352006-06-04 20:03:39 +0200934 RO
Jean Delvare400b48e2006-03-23 16:46:47 +0100935
936Some chips also offer the possibility to get beeped when an alarm occurs:
937
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300938`beep_enable`
939 Master beep enable
940
941 - 0: no beeps
942 - 1: beeps
943
Rudolf Marek057bc352006-06-04 20:03:39 +0200944 RW
Jean Delvare400b48e2006-03-23 16:46:47 +0100945
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300946`in[0-*]_beep`, `curr[1-*]_beep`, `fan[1-*]_beep`, `temp[1-*]_beep`,
Jean Delvare400b48e2006-03-23 16:46:47 +0100947 Channel beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300948
949 - 0: disable
950 - 1: enable
951
Rudolf Marek057bc352006-06-04 20:03:39 +0200952 RW
Jean Delvare400b48e2006-03-23 16:46:47 +0100953
954In theory, a chip could provide per-limit beep masking, but no such chip
955was seen so far.
956
957Old drivers provided a different, non-standard interface to alarms and
958beeps. These interface files are deprecated, but will be kept around
959for compatibility reasons:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300961`alarms`
962 Alarm bitmask.
963
Rudolf Marek057bc352006-06-04 20:03:39 +0200964 RO
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300965
Linus Torvalds1da177e2005-04-16 15:20:36 -0700966 Integer representation of one to four bytes.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300967
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968 A '1' bit means an alarm.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300969
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970 Chips should be programmed for 'comparator' mode so that
971 the alarm will 'come back' after you read the register
972 if it is still valid.
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300973
Linus Torvalds1da177e2005-04-16 15:20:36 -0700974 Generally a direct representation of a chip's internal
975 alarm registers; there is no standard for the position
Jean Delvare400b48e2006-03-23 16:46:47 +0100976 of individual bits. For this reason, the use of this
977 interface file for new drivers is discouraged. Use
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300978 `individual *_alarm` and `*_fault` files instead.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700979 Bits are defined in kernel/include/sensors.h.
980
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300981`beep_mask`
982 Bitmask for beep.
Jean Delvare400b48e2006-03-23 16:46:47 +0100983 Same format as 'alarms' with the same bit locations,
984 use discouraged for the same reason. Use individual
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300985 `*_beep` files instead.
Rudolf Marek057bc352006-06-04 20:03:39 +0200986 RW
Hans de Goede2ed42632007-09-21 17:03:32 +0200987
988
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300989*******************
990Intrusion detection
991*******************
Jean Delvareec199202009-03-30 21:46:44 +0200992
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300993`intrusion[0-*]_alarm`
Jean Delvareec199202009-03-30 21:46:44 +0200994 Chassis intrusion detection
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -0300995
996 - 0: OK
997 - 1: intrusion detected
998
Jean Delvareec199202009-03-30 21:46:44 +0200999 RW
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001000
Jean Delvareec199202009-03-30 21:46:44 +02001001 Contrary to regular alarm flags which clear themselves
1002 automatically when read, this one sticks until cleared by
1003 the user. This is done by writing 0 to the file. Writing
1004 other values is unsupported.
1005
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001006`intrusion[0-*]_beep`
Jean Delvareec199202009-03-30 21:46:44 +02001007 Chassis intrusion beep
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001008
Jean Delvareec199202009-03-30 21:46:44 +02001009 0: disable
1010 1: enable
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001011
Jean Delvareec199202009-03-30 21:46:44 +02001012 RW
1013
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001014****************************
1015Average sample configuration
1016****************************
Adamski, Krzysztof (Nokia - PL/Wroclaw)bfe033a2019-04-14 21:58:40 +00001017
1018Devices allowing for reading {in,power,curr,temp}_average values may export
1019attributes for controlling number of samples used to compute average.
1020
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001021+--------------+---------------------------------------------------------------+
1022| samples | Sets number of average samples for all types of measurements. |
1023| | |
1024| | RW |
1025+--------------+---------------------------------------------------------------+
1026| in_samples | Sets number of average samples for specific type of |
1027| power_samples| measurements. |
1028| curr_samples | |
1029| temp_samples | Note that on some devices it won't be possible to set all of |
1030| | them to different values so changing one might also change |
1031| | some others. |
1032| | |
1033| | RW |
1034+--------------+---------------------------------------------------------------+
Jean Delvareec199202009-03-30 21:46:44 +02001035
Hans de Goede2ed42632007-09-21 17:03:32 +02001036sysfs attribute writes interpretation
1037-------------------------------------
1038
1039hwmon sysfs attributes always contain numbers, so the first thing to do is to
1040convert the input to a number, there are 2 ways todo this depending whether
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001041the number can be negative or not::
1042
1043 unsigned long u = simple_strtoul(buf, NULL, 10);
1044 long s = simple_strtol(buf, NULL, 10);
Hans de Goede2ed42632007-09-21 17:03:32 +02001045
1046With buf being the buffer with the user input being passed by the kernel.
1047Notice that we do not use the second argument of strto[u]l, and thus cannot
1048tell when 0 is returned, if this was really 0 or is caused by invalid input.
1049This is done deliberately as checking this everywhere would add a lot of
1050code to the kernel.
1051
1052Notice that it is important to always store the converted value in an
1053unsigned long or long, so that no wrap around can happen before any further
1054checking.
1055
1056After the input string is converted to an (unsigned) long, the value should be
1057checked if its acceptable. Be careful with further conversions on the value
1058before checking it for validity, as these conversions could still cause a wrap
1059around before the check. For example do not multiply the result, and only
1060add/subtract if it has been divided before the add/subtract.
1061
1062What to do if a value is found to be invalid, depends on the type of the
1063sysfs attribute that is being set. If it is a continuous setting like a
1064tempX_max or inX_max attribute, then the value should be clamped to its
Guenter Roeckc25fb812013-01-09 08:12:46 -08001065limits using clamp_val(value, min_limit, max_limit). If it is not continuous
1066like for example a tempX_type, then when an invalid value is written,
1067-EINVAL should be returned.
Hans de Goede2ed42632007-09-21 17:03:32 +02001068
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001069Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees)::
Jean Delvare5fbea512007-10-07 22:44:33 +02001070
1071 long v = simple_strtol(buf, NULL, 10) / 1000;
Guenter Roeckc25fb812013-01-09 08:12:46 -08001072 v = clamp_val(v, -128, 127);
Jean Delvare5fbea512007-10-07 22:44:33 +02001073 /* write v to register */
Hans de Goede2ed42632007-09-21 17:03:32 +02001074
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001075Example2, fan divider setting, valid values 2, 4 and 8::
Hans de Goede2ed42632007-09-21 17:03:32 +02001076
Jean Delvare5fbea512007-10-07 22:44:33 +02001077 unsigned long v = simple_strtoul(buf, NULL, 10);
1078
1079 switch (v) {
1080 case 2: v = 1; break;
1081 case 4: v = 2; break;
1082 case 8: v = 3; break;
1083 default:
1084 return -EINVAL;
1085 }
1086 /* write v to register */