Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | Naming and data format standards for sysfs files |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 2 | ================================================ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
| 4 | The libsensors library offers an interface to the raw sensors data |
Jean Delvare | 125ff80 | 2008-02-23 10:57:53 +0100 | [diff] [blame] | 5 | through the sysfs interface. Since lm-sensors 3.0.0, libsensors is |
| 6 | completely chip-independent. It assumes that all the kernel drivers |
| 7 | implement the standard sysfs interface described in this document. |
| 8 | This makes adding or updating support for any given chip very easy, as |
| 9 | libsensors, and applications using it, do not need to be modified. |
| 10 | This is a major improvement compared to lm-sensors 2. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | Note that motherboards vary widely in the connections to sensor chips. |
| 13 | There is no standard that ensures, for example, that the second |
| 14 | temperature sensor is connected to the CPU, or that the second fan is on |
| 15 | the CPU. Also, some values reported by the chips need some computation |
| 16 | before they make full sense. For example, most chips can only measure |
| 17 | voltages between 0 and +4V. Other voltages are scaled back into that |
| 18 | range using external resistors. Since the values of these resistors |
| 19 | can change from motherboard to motherboard, the conversions cannot be |
| 20 | hard coded into the driver and have to be done in user space. |
| 21 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 22 | For this reason, even if we aim at a chip-independent libsensors, it will |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | still require a configuration file (e.g. /etc/sensors.conf) for proper |
| 24 | values conversion, labeling of inputs and hiding of unused inputs. |
| 25 | |
| 26 | An alternative method that some programs use is to access the sysfs |
| 27 | files directly. This document briefly describes the standards that the |
| 28 | drivers follow, so that an application program can scan for entries and |
| 29 | access this data in a simple and consistent way. That said, such programs |
| 30 | will have to implement conversion, labeling and hiding of inputs. For |
| 31 | this reason, it is still not recommended to bypass the library. |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | Each chip gets its own directory in the sysfs /sys/devices tree. To |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 34 | find all sensor chips, it is easier to follow the device symlinks from |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 35 | `/sys/class/hwmon/hwmon*`. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Jean Delvare | 125ff80 | 2008-02-23 10:57:53 +0100 | [diff] [blame] | 37 | Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes |
| 38 | in the "physical" device directory. Since lm-sensors 3.0.1, attributes found |
| 39 | in the hwmon "class" device directory are also supported. Complex drivers |
| 40 | (e.g. drivers for multifunction chips) may want to use this possibility to |
| 41 | avoid namespace pollution. The only drawback will be that older versions of |
| 42 | libsensors won't support the driver in question. |
| 43 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 44 | All sysfs values are fixed point numbers. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | There is only one value per file, unlike the older /proc specification. |
| 47 | The common scheme for files naming is: <type><number>_<item>. Usual |
| 48 | types for sensor chips are "in" (voltage), "temp" (temperature) and |
| 49 | "fan" (fan). Usual items are "input" (measured value), "max" (high |
| 50 | threshold, "min" (low threshold). Numbering usually starts from 1, |
| 51 | except for voltages which start from 0 (because most data sheets use |
| 52 | this). A number is always used for elements that can be present more |
| 53 | than once, even if there is a single element of the given type on the |
| 54 | specific chip. Other files do not refer to a specific element, so |
| 55 | they have a simple name, and no number. |
| 56 | |
| 57 | Alarms are direct indications read from the chips. The drivers do NOT |
| 58 | make comparisons of readings to thresholds. This allows violations |
| 59 | between readings to be caught and alarmed. The exact definition of an |
| 60 | alarm (for example, whether a threshold must be met or must be exceeded |
| 61 | to cause an alarm) is chip-dependent. |
| 62 | |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 63 | When setting values of hwmon sysfs attributes, the string representation of |
| 64 | the desired value must be written, note that strings which are not a number |
| 65 | are 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
| 68 | ------------------------------------------------------------------------- |
| 69 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 70 | ======= =========================================== |
| 71 | `[0-*]` denotes any positive number starting from 0 |
| 72 | `[1-*]` denotes any positive number starting from 1 |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 73 | RO read only value |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 74 | WO write only value |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 75 | RW read/write value |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 76 | ======= =========================================== |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 77 | |
| 78 | Read/write values may be read-only for some chips, depending on the |
| 79 | hardware implementation. |
| 80 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 81 | All entries (except name) are optional, and should only be created in a |
| 82 | given driver if the chip has the feature. |
| 83 | |
| 84 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 85 | ***************** |
| 86 | Global attributes |
| 87 | ***************** |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 88 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 89 | `name` |
| 90 | The chip name. |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 91 | This should be a short, lowercase string, not containing |
Guenter Roeck | f172841 | 2017-01-24 20:24:36 -0800 | [diff] [blame] | 92 | whitespace, dashes, or the wildcard character '*'. |
| 93 | This attribute represents the chip name. It is the only |
| 94 | mandatory attribute. |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 95 | I2C devices get this attribute created automatically. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 96 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 97 | RO |
| 98 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 99 | `update_interval` |
| 100 | The interval at which the chip will update readings. |
Ira W. Snyder | d2b847d | 2010-05-27 19:58:45 +0200 | [diff] [blame] | 101 | Unit: millisecond |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 102 | |
Ira W. Snyder | d2b847d | 2010-05-27 19:58:45 +0200 | [diff] [blame] | 103 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 104 | |
Guenter Roeck | a51b994 | 2010-09-17 17:24:14 +0200 | [diff] [blame] | 105 | Some devices have a variable update rate or interval. |
| 106 | This attribute can be used to change it to the desired value. |
Ira W. Snyder | d2b847d | 2010-05-27 19:58:45 +0200 | [diff] [blame] | 107 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 108 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 109 | ******** |
| 110 | Voltages |
| 111 | ******** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 113 | `in[0-*]_min` |
| 114 | Voltage min value. |
| 115 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 117 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 118 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 119 | |
| 120 | `in[0-*]_lcrit` |
| 121 | Voltage critical min value. |
| 122 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 123 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 124 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 125 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 126 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 127 | 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 Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 131 | `in[0-*]_max` |
| 132 | Voltage max value. |
| 133 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 135 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 136 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 137 | |
| 138 | `in[0-*]_crit` |
| 139 | Voltage critical max value. |
| 140 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 141 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 142 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 143 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 144 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 145 | 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 Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 149 | `in[0-*]_input` |
| 150 | Voltage input value. |
| 151 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 153 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 154 | RO |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 155 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 156 | Voltage measured on the chip pin. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 157 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | Actual voltage depends on the scaling resistors on the |
| 159 | motherboard, as recommended in the chip datasheet. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 160 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | 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 Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 165 | do scale, because of internal resistors built into a chip. |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 166 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 170 | `in[0-*]_average` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 171 | Average voltage |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 172 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 173 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 174 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 175 | RO |
| 176 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 177 | `in[0-*]_lowest` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 178 | Historical minimum voltage |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 179 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 180 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 181 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 182 | RO |
| 183 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 184 | `in[0-*]_highest` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 185 | Historical maximum voltage |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 186 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 187 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 188 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 189 | RO |
| 190 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 191 | `in[0-*]_reset_history` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 192 | Reset inX_lowest and inX_highest |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 193 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 194 | WO |
| 195 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 196 | `in_reset_history` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 197 | Reset inX_lowest and inX_highest for all sensors |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 198 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 199 | WO |
| 200 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 201 | `in[0-*]_label` |
| 202 | Suggested voltage channel label. |
| 203 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 204 | Text string |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 205 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 206 | 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 Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 210 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 211 | RO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 213 | `in[0-*]_enable` |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 214 | Enable or disable the sensors. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 215 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 216 | When disabled the sensor read will return -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 217 | |
| 218 | - 1: Enable |
| 219 | - 0: Disable |
| 220 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 221 | RW |
| 222 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 223 | `cpu[0-*]_vid` |
| 224 | CPU core reference voltage. |
| 225 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | Unit: millivolt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 227 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 228 | RO |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 229 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | Not always correct. |
| 231 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 232 | `vrm` |
| 233 | Voltage Regulator Module version number. |
| 234 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 235 | RW (but changing it should no more be necessary) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 236 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 237 | 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 Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 240 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | Affects the way the driver calculates the CPU core reference |
| 242 | voltage from the vid pins. |
| 243 | |
Zbigniew Lukwinski | e8e61235 | 2020-07-31 21:37:15 +0200 | [diff] [blame^] | 244 | `in[0-*]_rated_min` |
| 245 | Minimum rated voltage. |
| 246 | |
| 247 | Unit: millivolt |
| 248 | |
| 249 | RO |
| 250 | |
| 251 | `in[0-*]_rated_max` |
| 252 | Maximum rated voltage. |
| 253 | |
| 254 | Unit: millivolt |
| 255 | |
| 256 | RO |
| 257 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 258 | Also see the Alarms section for status flags associated with voltages. |
| 259 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 261 | **** |
| 262 | Fans |
| 263 | **** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 265 | `fan[1-*]_min` |
| 266 | Fan minimum value |
| 267 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | Unit: revolution/min (RPM) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 269 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 270 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 272 | `fan[1-*]_max` |
| 273 | Fan maximum value |
| 274 | |
Christian Engelmayer | d54d462 | 2009-06-01 13:46:50 +0200 | [diff] [blame] | 275 | Unit: revolution/min (RPM) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 276 | |
Christian Engelmayer | d54d462 | 2009-06-01 13:46:50 +0200 | [diff] [blame] | 277 | Only rarely supported by the hardware. |
| 278 | RW |
| 279 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 280 | `fan[1-*]_input` |
| 281 | Fan input value. |
| 282 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | Unit: revolution/min (RPM) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 284 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 285 | RO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 287 | `fan[1-*]_div` |
| 288 | Fan divisor. |
| 289 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128). |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 291 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 292 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 293 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | Some chips only support values 1, 2, 4 and 8. |
| 295 | Note that this is actually an internal clock divisor, which |
| 296 | affects the measurable speed range, not the read value. |
| 297 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 298 | `fan[1-*]_pulses` |
| 299 | Number of tachometer pulses per fan revolution. |
| 300 | |
Guenter Roeck | 2d2e148 | 2011-03-02 15:19:35 -0800 | [diff] [blame] | 301 | Integer value, typically between 1 and 4. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 302 | |
Guenter Roeck | 2d2e148 | 2011-03-02 15:19:35 -0800 | [diff] [blame] | 303 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 304 | |
Guenter Roeck | 2d2e148 | 2011-03-02 15:19:35 -0800 | [diff] [blame] | 305 | This value is a characteristic of the fan connected to the |
| 306 | device's input, so it has to be set in accordance with the fan |
| 307 | model. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 308 | |
Guenter Roeck | 2d2e148 | 2011-03-02 15:19:35 -0800 | [diff] [blame] | 309 | Should only be created if the chip has a register to configure |
| 310 | the number of pulses. In the absence of such a register (and |
| 311 | thus attribute) the value assumed by all devices is 2 pulses |
| 312 | per fan revolution. |
| 313 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 314 | `fan[1-*]_target` |
Jean Delvare | 2dbc514 | 2007-05-08 17:22:00 +0200 | [diff] [blame] | 315 | Desired fan speed |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 316 | |
Jean Delvare | 2dbc514 | 2007-05-08 17:22:00 +0200 | [diff] [blame] | 317 | Unit: revolution/min (RPM) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 318 | |
Jean Delvare | 2dbc514 | 2007-05-08 17:22:00 +0200 | [diff] [blame] | 319 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 320 | |
Jean Delvare | 2dbc514 | 2007-05-08 17:22:00 +0200 | [diff] [blame] | 321 | Only makes sense if the chip supports closed-loop fan speed |
| 322 | control based on the measured fan speed. |
| 323 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 324 | `fan[1-*]_label` |
| 325 | Suggested fan channel label. |
| 326 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 327 | Text string |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 328 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 329 | Should only be created if the driver has hints about what |
| 330 | this fan channel is being used for, and user-space doesn't. |
| 331 | In all other cases, the label is provided by user-space. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 332 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 333 | RO |
| 334 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 335 | `fan[1-*]_enable` |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 336 | Enable or disable the sensors. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 337 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 338 | When disabled the sensor read will return -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 339 | |
| 340 | - 1: Enable |
| 341 | - 0: Disable |
| 342 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 343 | RW |
| 344 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 345 | Also see the Alarms section for status flags associated with fans. |
| 346 | |
| 347 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 348 | *** |
| 349 | PWM |
| 350 | *** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 352 | `pwm[1-*]` |
| 353 | Pulse width modulation fan control. |
| 354 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | Integer value in the range 0 to 255 |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 356 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 357 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 358 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | 255 is max or 100%. |
| 360 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 361 | `pwm[1-*]_enable` |
Jean Delvare | 875f25d | 2007-06-27 21:26:08 +0200 | [diff] [blame] | 362 | Fan speed control method: |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 363 | |
| 364 | - 0: no fan speed control (i.e. fan at full speed) |
| 365 | - 1: manual fan speed control enabled (using `pwm[1-*]`) |
| 366 | - 2+: automatic fan speed control enabled |
| 367 | |
Jean Delvare | f8d0c19 | 2007-02-14 21:15:02 +0100 | [diff] [blame] | 368 | Check individual chip documentation files for automatic mode |
| 369 | details. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 370 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 371 | RW |
| 372 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 373 | `pwm[1-*]_mode` |
| 374 | - 0: DC mode (direct current) |
| 375 | - 1: PWM mode (pulse-width modulation) |
| 376 | |
Jean Delvare | f8d0c19 | 2007-02-14 21:15:02 +0100 | [diff] [blame] | 377 | RW |
| 378 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 379 | `pwm[1-*]_freq` |
| 380 | Base PWM frequency in Hz. |
| 381 | |
Jean Delvare | f8d0c19 | 2007-02-14 21:15:02 +0100 | [diff] [blame] | 382 | Only possibly available when pwmN_mode is PWM, but not always |
| 383 | present even then. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 384 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 385 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 387 | `pwm[1-*]_auto_channels_temp` |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | Select which temperature channels affect this PWM output in |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 389 | auto mode. |
| 390 | |
| 391 | Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc... |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 392 | Which values are possible depend on the chip used. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 393 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 394 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 396 | `pwm[1-*]_auto_point[1-*]_pwm` / `pwm[1-*]_auto_point[1-*]_temp` / `pwm[1-*]_auto_point[1-*]_temp_hyst` |
| 397 | Define the PWM vs temperature curve. |
| 398 | |
| 399 | Number of trip points is chip-dependent. Use this for chips |
| 400 | which associate trip points to PWM output channels. |
| 401 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 402 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 403 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 404 | `temp[1-*]_auto_point[1-*]_pwm` / `temp[1-*]_auto_point[1-*]_temp` / `temp[1-*]_auto_point[1-*]_temp_hyst` |
| 405 | Define the PWM vs temperature curve. |
| 406 | |
| 407 | Number of trip points is chip-dependent. Use this for chips |
| 408 | which associate trip points to temperature channels. |
| 409 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 410 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | |
Jean Delvare | f7290e2 | 2009-12-09 20:35:47 +0100 | [diff] [blame] | 412 | There is a third case where trip points are associated to both PWM output |
| 413 | channels and temperature channels: the PWM values are associated to PWM |
| 414 | output channels while the temperature values are associated to temperature |
| 415 | channels. In that case, the result is determined by the mapping between |
| 416 | temperature inputs and PWM outputs. When several temperature inputs are |
| 417 | mapped to a given PWM output, this leads to several candidate PWM values. |
| 418 | The actual result is up to the chip, but in general the highest candidate |
| 419 | value (fastest fan speed) wins. |
| 420 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 422 | ************ |
| 423 | Temperatures |
| 424 | ************ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 425 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 426 | `temp[1-*]_type` |
| 427 | Sensor type selection. |
| 428 | |
Jean Delvare | b26f933 | 2007-08-16 14:30:01 +0200 | [diff] [blame] | 429 | Integers 1 to 6 |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 430 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 431 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 432 | |
| 433 | - 1: CPU embedded diode |
| 434 | - 2: 3904 transistor |
| 435 | - 3: thermal diode |
| 436 | - 4: thermistor |
| 437 | - 5: AMD AMDSI |
| 438 | - 6: Intel PECI |
| 439 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | Not all types are supported by all chips |
| 441 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 442 | `temp[1-*]_max` |
| 443 | Temperature max value. |
| 444 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 445 | Unit: millidegree Celsius (or millivolt, see below) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 446 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 447 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 449 | `temp[1-*]_min` |
| 450 | Temperature min value. |
| 451 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 452 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 453 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 454 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 456 | `temp[1-*]_max_hyst` |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | Temperature hysteresis value for max limit. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 458 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 459 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 460 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | Must be reported as an absolute temperature, NOT a delta |
| 462 | from the max value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 463 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 464 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 466 | `temp[1-*]_min_hyst` |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 467 | Temperature hysteresis value for min limit. |
| 468 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 469 | |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 470 | Must be reported as an absolute temperature, NOT a delta |
| 471 | from the min value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 472 | |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 473 | RW |
| 474 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 475 | `temp[1-*]_input` |
| 476 | Temperature input value. |
| 477 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 478 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 479 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 480 | RO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 482 | `temp[1-*]_crit` |
| 483 | Temperature critical max value, typically greater than |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 484 | corresponding temp_max values. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 485 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 486 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 487 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 488 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 490 | `temp[1-*]_crit_hyst` |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | Temperature hysteresis value for critical limit. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 492 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 493 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 494 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | Must be reported as an absolute temperature, NOT a delta |
| 496 | from the critical value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 497 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 498 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 500 | `temp[1-*]_emergency` |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 501 | Temperature emergency max value, for chips supporting more than |
| 502 | two upper temperature limits. Must be equal or greater than |
| 503 | corresponding temp_crit values. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 504 | |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 505 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 506 | |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 507 | RW |
| 508 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 509 | `temp[1-*]_emergency_hyst` |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 510 | Temperature hysteresis value for emergency limit. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 511 | |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 512 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 513 | |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 514 | Must be reported as an absolute temperature, NOT a delta |
| 515 | from the emergency value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 516 | |
Guenter Roeck | 28e7438f | 2010-10-28 20:31:42 +0200 | [diff] [blame] | 517 | RW |
| 518 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 519 | `temp[1-*]_lcrit` |
| 520 | Temperature critical min value, typically lower than |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 521 | corresponding temp_min values. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 522 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 523 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 524 | |
Guenter Roeck | f46fc8c | 2010-08-14 21:08:52 +0200 | [diff] [blame] | 525 | RW |
| 526 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 527 | `temp[1-*]_lcrit_hyst` |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 528 | Temperature hysteresis value for critical min limit. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 529 | |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 530 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 531 | |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 532 | Must be reported as an absolute temperature, NOT a delta |
| 533 | from the critical min value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 534 | |
Jean Delvare | 0132514 | 2014-05-25 17:23:07 +0200 | [diff] [blame] | 535 | RW |
| 536 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 537 | `temp[1-*]_offset` |
Hartmut Rick | 59ac836 | 2006-03-23 16:37:23 +0100 | [diff] [blame] | 538 | Temperature offset which is added to the temperature reading |
| 539 | by the chip. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 540 | |
Hartmut Rick | 59ac836 | 2006-03-23 16:37:23 +0100 | [diff] [blame] | 541 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 542 | |
Hartmut Rick | 59ac836 | 2006-03-23 16:37:23 +0100 | [diff] [blame] | 543 | Read/Write value. |
| 544 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 545 | `temp[1-*]_label` |
| 546 | Suggested temperature channel label. |
| 547 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 548 | Text string |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 549 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 550 | Should only be created if the driver has hints about what |
| 551 | this temperature channel is being used for, and user-space |
| 552 | doesn't. In all other cases, the label is provided by |
| 553 | user-space. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 554 | |
Jean Delvare | 176544d | 2007-08-20 16:44:44 +0200 | [diff] [blame] | 555 | RO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 556 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 557 | `temp[1-*]_lowest` |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 558 | Historical minimum temperature |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 559 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 560 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 561 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 562 | RO |
| 563 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 564 | `temp[1-*]_highest` |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 565 | Historical maximum temperature |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 566 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 567 | Unit: millidegree Celsius |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 568 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 569 | RO |
| 570 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 571 | `temp[1-*]_reset_history` |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 572 | Reset temp_lowest and temp_highest |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 573 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 574 | WO |
| 575 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 576 | `temp_reset_history` |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 577 | Reset temp_lowest and temp_highest for all sensors |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 578 | |
Andre Prendel | cd4e96c | 2009-06-15 18:39:49 +0200 | [diff] [blame] | 579 | WO |
| 580 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 581 | `temp[1-*]_enable` |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 582 | Enable or disable the sensors. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 583 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 584 | When disabled the sensor read will return -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 585 | |
| 586 | - 1: Enable |
| 587 | - 0: Disable |
| 588 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 589 | RW |
| 590 | |
Zbigniew Lukwinski | e8e61235 | 2020-07-31 21:37:15 +0200 | [diff] [blame^] | 591 | `temp[1-*]_rated_min` |
| 592 | Minimum rated temperature. |
| 593 | |
| 594 | Unit: millidegree Celsius |
| 595 | |
| 596 | RO |
| 597 | |
| 598 | `temp[1-*]_rated_max` |
| 599 | Maximum rated temperature. |
| 600 | |
| 601 | Unit: millidegree Celsius |
| 602 | |
| 603 | RO |
| 604 | |
Jean Delvare | 740e06a | 2006-06-05 20:31:20 +0200 | [diff] [blame] | 605 | Some chips measure temperature using external thermistors and an ADC, and |
| 606 | report the temperature measurement as a voltage. Converting this voltage |
| 607 | back to a temperature (or the other way around for limits) requires |
| 608 | mathematical functions not available in the kernel, so the conversion |
| 609 | must occur in user space. For these chips, all temp* files described |
| 610 | above should contain values expressed in millivolt instead of millidegree |
| 611 | Celsius. In other words, such temperature channels are handled as voltage |
| 612 | channels by the driver. |
| 613 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 614 | Also see the Alarms section for status flags associated with temperatures. |
| 615 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 616 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 617 | ******** |
| 618 | Currents |
| 619 | ******** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 620 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 621 | `curr[1-*]_max` |
| 622 | Current max value |
| 623 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 624 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 625 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 626 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 627 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 628 | `curr[1-*]_min` |
| 629 | Current min value. |
| 630 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 631 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 632 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 633 | RW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 634 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 635 | `curr[1-*]_lcrit` |
| 636 | Current critical low value |
| 637 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 638 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 639 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 640 | RW |
| 641 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 642 | `curr[1-*]_crit` |
| 643 | Current critical high value. |
| 644 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 645 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 646 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 647 | RW |
| 648 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 649 | `curr[1-*]_input` |
| 650 | Current input value |
| 651 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 652 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 653 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 654 | RO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 655 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 656 | `curr[1-*]_average` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 657 | Average current use |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 658 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 659 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 660 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 661 | RO |
| 662 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 663 | `curr[1-*]_lowest` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 664 | Historical minimum current |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 665 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 666 | Unit: milliampere |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 667 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 668 | RO |
| 669 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 670 | `curr[1-*]_highest` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 671 | Historical maximum current |
| 672 | Unit: milliampere |
| 673 | RO |
| 674 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 675 | `curr[1-*]_reset_history` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 676 | Reset currX_lowest and currX_highest |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 677 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 678 | WO |
| 679 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 680 | `curr_reset_history` |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 681 | Reset currX_lowest and currX_highest for all sensors |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 682 | |
Guenter Roeck | 0084e9f | 2011-07-09 10:32:11 -0700 | [diff] [blame] | 683 | WO |
| 684 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 685 | `curr[1-*]_enable` |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 686 | Enable or disable the sensors. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 687 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 688 | When disabled the sensor read will return -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 689 | |
| 690 | - 1: Enable |
| 691 | - 0: Disable |
| 692 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 693 | RW |
| 694 | |
Zbigniew Lukwinski | e8e61235 | 2020-07-31 21:37:15 +0200 | [diff] [blame^] | 695 | `curr[1-*]_rated_min` |
| 696 | Minimum rated current. |
| 697 | |
| 698 | Unit: milliampere |
| 699 | |
| 700 | RO |
| 701 | |
| 702 | `curr[1-*]_rated_max` |
| 703 | Maximum rated current. |
| 704 | |
| 705 | Unit: milliampere |
| 706 | |
| 707 | RO |
| 708 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 709 | Also see the Alarms section for status flags associated with currents. |
| 710 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 711 | ***** |
| 712 | Power |
| 713 | ***** |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 714 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 715 | `power[1-*]_average` |
| 716 | Average power use |
| 717 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 718 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 719 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 720 | RO |
| 721 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 722 | `power[1-*]_average_interval` |
| 723 | Power use averaging interval. A poll |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 724 | notification is sent to this file if the |
| 725 | hardware changes the averaging interval. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 726 | |
Darrick J. Wong | ddedc65 | 2008-10-09 15:33:58 +0200 | [diff] [blame] | 727 | Unit: milliseconds |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 728 | |
Darrick J. Wong | ddedc65 | 2008-10-09 15:33:58 +0200 | [diff] [blame] | 729 | RW |
| 730 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 731 | `power[1-*]_average_interval_max` |
| 732 | Maximum power use averaging interval |
| 733 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 734 | Unit: milliseconds |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 735 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 736 | RO |
| 737 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 738 | `power[1-*]_average_interval_min` |
| 739 | Minimum power use averaging interval |
| 740 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 741 | Unit: milliseconds |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 742 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 743 | RO |
| 744 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 745 | `power[1-*]_average_highest` |
| 746 | Historical average maximum power use |
| 747 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 748 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 749 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 750 | RO |
| 751 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 752 | `power[1-*]_average_lowest` |
| 753 | Historical average minimum power use |
| 754 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 755 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 756 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 757 | RO |
| 758 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 759 | `power[1-*]_average_max` |
| 760 | A poll notification is sent to |
| 761 | `power[1-*]_average` when power use |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 762 | rises above this value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 763 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 764 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 765 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 766 | RW |
| 767 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 768 | `power[1-*]_average_min` |
| 769 | A poll notification is sent to |
| 770 | `power[1-*]_average` when power use |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 771 | sinks below this value. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 772 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 773 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 774 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 775 | RW |
| 776 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 777 | `power[1-*]_input` |
| 778 | Instantaneous power use |
| 779 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 780 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 781 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 782 | RO |
| 783 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 784 | `power[1-*]_input_highest` |
| 785 | Historical maximum power use |
| 786 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 787 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 788 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 789 | RO |
| 790 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 791 | `power[1-*]_input_lowest` |
| 792 | Historical minimum power use |
| 793 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 794 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 795 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 796 | RO |
| 797 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 798 | `power[1-*]_reset_history` |
| 799 | Reset input_highest, input_lowest, |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 800 | average_highest and average_lowest. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 801 | |
Darrick J. Wong | 38fb56a | 2007-10-09 13:39:24 -0700 | [diff] [blame] | 802 | WO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 803 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 804 | `power[1-*]_accuracy` |
| 805 | Accuracy of the power meter. |
| 806 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 807 | Unit: Percent |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 808 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 809 | RO |
| 810 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 811 | `power[1-*]_cap` |
| 812 | If power use rises above this limit, the |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 813 | system should take action to reduce power use. |
| 814 | A poll notification is sent to this file if the |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 815 | cap is changed by the hardware. The `*_cap` |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 816 | files only appear if the cap is known to be |
| 817 | enforced by hardware. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 818 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 819 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 820 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 821 | RW |
| 822 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 823 | `power[1-*]_cap_hyst` |
| 824 | Margin of hysteresis built around capping and |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 825 | notification. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 826 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 827 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 828 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 829 | RW |
| 830 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 831 | `power[1-*]_cap_max` |
| 832 | Maximum cap that can be set. |
| 833 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 834 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 835 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 836 | RO |
| 837 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 838 | `power[1-*]_cap_min` |
| 839 | Minimum cap that can be set. |
| 840 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 841 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 842 | |
Darrick J. Wong | 115a57c | 2009-10-26 16:50:07 -0700 | [diff] [blame] | 843 | RO |
| 844 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 845 | `power[1-*]_max` |
| 846 | Maximum power. |
| 847 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 848 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 849 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 850 | RW |
| 851 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 852 | `power[1-*]_crit` |
| 853 | Critical maximum power. |
| 854 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 855 | If power rises to or above this limit, the |
| 856 | system is expected take drastic action to reduce |
| 857 | power consumption, such as a system shutdown or |
| 858 | a forced powerdown of some devices. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 859 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 860 | Unit: microWatt |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 861 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 862 | RW |
| 863 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 864 | `power[1-*]_enable` |
| 865 | Enable or disable the sensors. |
| 866 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 867 | When disabled the sensor read will return |
| 868 | -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 869 | |
| 870 | - 1: Enable |
| 871 | - 0: Disable |
| 872 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 873 | RW |
| 874 | |
Zbigniew Lukwinski | e8e61235 | 2020-07-31 21:37:15 +0200 | [diff] [blame^] | 875 | `power[1-*]_rated_min` |
| 876 | Minimum rated power. |
| 877 | |
| 878 | Unit: microWatt |
| 879 | |
| 880 | RO |
| 881 | |
| 882 | `power[1-*]_rated_max` |
| 883 | Maximum rated power. |
| 884 | |
| 885 | Unit: microWatt |
| 886 | |
| 887 | RO |
| 888 | |
Guenter Roeck | 581693b | 2010-06-28 13:22:27 -0700 | [diff] [blame] | 889 | Also see the Alarms section for status flags associated with power readings. |
| 890 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 891 | ****** |
| 892 | Energy |
| 893 | ****** |
Darrick J. Wong | ddedc65 | 2008-10-09 15:33:58 +0200 | [diff] [blame] | 894 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 895 | `energy[1-*]_input` |
| 896 | Cumulative energy use |
| 897 | |
Darrick J. Wong | ddedc65 | 2008-10-09 15:33:58 +0200 | [diff] [blame] | 898 | Unit: microJoule |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 899 | |
Darrick J. Wong | ddedc65 | 2008-10-09 15:33:58 +0200 | [diff] [blame] | 900 | RO |
| 901 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 902 | `energy[1-*]_enable` |
| 903 | Enable or disable the sensors. |
| 904 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 905 | When disabled the sensor read will return |
| 906 | -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 907 | |
| 908 | - 1: Enable |
| 909 | - 0: Disable |
| 910 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 911 | RW |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 912 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 913 | ******** |
| 914 | Humidity |
| 915 | ******** |
Guenter Roeck | c6c2c16 | 2011-01-06 07:52:03 -0800 | [diff] [blame] | 916 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 917 | `humidity[1-*]_input` |
| 918 | Humidity |
| 919 | |
Guenter Roeck | c6c2c16 | 2011-01-06 07:52:03 -0800 | [diff] [blame] | 920 | Unit: milli-percent (per cent mille, pcm) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 921 | |
Guenter Roeck | c6c2c16 | 2011-01-06 07:52:03 -0800 | [diff] [blame] | 922 | RO |
| 923 | |
| 924 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 925 | `humidity[1-*]_enable` |
| 926 | Enable or disable the sensors |
| 927 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 928 | When disabled the sensor read will return |
| 929 | -ENODATA. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 930 | |
| 931 | - 1: Enable |
| 932 | - 0: Disable |
| 933 | |
Shilpasri G Bhat | fb41a71 | 2018-07-06 17:26:06 +0530 | [diff] [blame] | 934 | RW |
| 935 | |
Zbigniew Lukwinski | e8e61235 | 2020-07-31 21:37:15 +0200 | [diff] [blame^] | 936 | `humidity[1-*]_rated_min` |
| 937 | Minimum rated humidity. |
| 938 | |
| 939 | Unit: milli-percent (per cent mille, pcm) |
| 940 | |
| 941 | RO |
| 942 | |
| 943 | `humidity[1-*]_rated_max` |
| 944 | Maximum rated humidity. |
| 945 | |
| 946 | Unit: milli-percent (per cent mille, pcm) |
| 947 | |
| 948 | RO |
| 949 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 950 | ****** |
| 951 | Alarms |
| 952 | ****** |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 953 | |
| 954 | Each channel or limit may have an associated alarm file, containing a |
| 955 | boolean value. 1 means than an alarm condition exists, 0 means no alarm. |
| 956 | |
| 957 | Usually a given chip will either use channel-related alarms, or |
| 958 | limit-related alarms, not both. The driver should just reflect the hardware |
| 959 | implementation. |
| 960 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 961 | +-------------------------------+-----------------------+ |
| 962 | | **`in[0-*]_alarm`, | Channel alarm | |
| 963 | | `curr[1-*]_alarm`, | | |
| 964 | | `power[1-*]_alarm`, | - 0: no alarm | |
| 965 | | `fan[1-*]_alarm`, | - 1: alarm | |
| 966 | | `temp[1-*]_alarm`** | | |
| 967 | | | RO | |
| 968 | +-------------------------------+-----------------------+ |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 969 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 970 | **OR** |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 971 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 972 | +-------------------------------+-----------------------+ |
| 973 | | **`in[0-*]_min_alarm`, | Limit alarm | |
| 974 | | `in[0-*]_max_alarm`, | | |
| 975 | | `in[0-*]_lcrit_alarm`, | - 0: no alarm | |
| 976 | | `in[0-*]_crit_alarm`, | - 1: alarm | |
| 977 | | `curr[1-*]_min_alarm`, | | |
| 978 | | `curr[1-*]_max_alarm`, | RO | |
| 979 | | `curr[1-*]_lcrit_alarm`, | | |
| 980 | | `curr[1-*]_crit_alarm`, | | |
| 981 | | `power[1-*]_cap_alarm`, | | |
| 982 | | `power[1-*]_max_alarm`, | | |
| 983 | | `power[1-*]_crit_alarm`, | | |
| 984 | | `fan[1-*]_min_alarm`, | | |
| 985 | | `fan[1-*]_max_alarm`, | | |
| 986 | | `temp[1-*]_min_alarm`, | | |
| 987 | | `temp[1-*]_max_alarm`, | | |
| 988 | | `temp[1-*]_lcrit_alarm`, | | |
| 989 | | `temp[1-*]_crit_alarm`, | | |
| 990 | | `temp[1-*]_emergency_alarm`** | | |
| 991 | +-------------------------------+-----------------------+ |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 992 | |
| 993 | Each input channel may have an associated fault file. This can be used |
| 994 | to notify open diodes, unconnected fans etc. where the hardware |
| 995 | supports it. When this boolean has value 1, the measurement for that |
| 996 | channel should not be trusted. |
| 997 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 998 | `fan[1-*]_fault` / `temp[1-*]_fault` |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 999 | Input fault condition |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1000 | |
| 1001 | - 0: no fault occurred |
| 1002 | - 1: fault condition |
| 1003 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 1004 | RO |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1005 | |
| 1006 | Some chips also offer the possibility to get beeped when an alarm occurs: |
| 1007 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1008 | `beep_enable` |
| 1009 | Master beep enable |
| 1010 | |
| 1011 | - 0: no beeps |
| 1012 | - 1: beeps |
| 1013 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 1014 | RW |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1015 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1016 | `in[0-*]_beep`, `curr[1-*]_beep`, `fan[1-*]_beep`, `temp[1-*]_beep`, |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1017 | Channel beep |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1018 | |
| 1019 | - 0: disable |
| 1020 | - 1: enable |
| 1021 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 1022 | RW |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1023 | |
| 1024 | In theory, a chip could provide per-limit beep masking, but no such chip |
| 1025 | was seen so far. |
| 1026 | |
| 1027 | Old drivers provided a different, non-standard interface to alarms and |
| 1028 | beeps. These interface files are deprecated, but will be kept around |
| 1029 | for compatibility reasons: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1030 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1031 | `alarms` |
| 1032 | Alarm bitmask. |
| 1033 | |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 1034 | RO |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1035 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1036 | Integer representation of one to four bytes. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1037 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1038 | A '1' bit means an alarm. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1039 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1040 | Chips should be programmed for 'comparator' mode so that |
| 1041 | the alarm will 'come back' after you read the register |
| 1042 | if it is still valid. |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1043 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1044 | Generally a direct representation of a chip's internal |
| 1045 | alarm registers; there is no standard for the position |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1046 | of individual bits. For this reason, the use of this |
| 1047 | interface file for new drivers is discouraged. Use |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1048 | `individual *_alarm` and `*_fault` files instead. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1049 | Bits are defined in kernel/include/sensors.h. |
| 1050 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1051 | `beep_mask` |
| 1052 | Bitmask for beep. |
Jean Delvare | 400b48e | 2006-03-23 16:46:47 +0100 | [diff] [blame] | 1053 | Same format as 'alarms' with the same bit locations, |
| 1054 | use discouraged for the same reason. Use individual |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1055 | `*_beep` files instead. |
Rudolf Marek | 057bc35 | 2006-06-04 20:03:39 +0200 | [diff] [blame] | 1056 | RW |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1057 | |
| 1058 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1059 | ******************* |
| 1060 | Intrusion detection |
| 1061 | ******************* |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1062 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1063 | `intrusion[0-*]_alarm` |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1064 | Chassis intrusion detection |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1065 | |
| 1066 | - 0: OK |
| 1067 | - 1: intrusion detected |
| 1068 | |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1069 | RW |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1070 | |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1071 | Contrary to regular alarm flags which clear themselves |
| 1072 | automatically when read, this one sticks until cleared by |
| 1073 | the user. This is done by writing 0 to the file. Writing |
| 1074 | other values is unsupported. |
| 1075 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1076 | `intrusion[0-*]_beep` |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1077 | Chassis intrusion beep |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1078 | |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1079 | 0: disable |
| 1080 | 1: enable |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1081 | |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1082 | RW |
| 1083 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1084 | **************************** |
| 1085 | Average sample configuration |
| 1086 | **************************** |
Adamski, Krzysztof (Nokia - PL/Wroclaw) | bfe033a | 2019-04-14 21:58:40 +0000 | [diff] [blame] | 1087 | |
| 1088 | Devices allowing for reading {in,power,curr,temp}_average values may export |
| 1089 | attributes for controlling number of samples used to compute average. |
| 1090 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1091 | +--------------+---------------------------------------------------------------+ |
| 1092 | | samples | Sets number of average samples for all types of measurements. | |
| 1093 | | | | |
| 1094 | | | RW | |
| 1095 | +--------------+---------------------------------------------------------------+ |
| 1096 | | in_samples | Sets number of average samples for specific type of | |
| 1097 | | power_samples| measurements. | |
| 1098 | | curr_samples | | |
| 1099 | | temp_samples | Note that on some devices it won't be possible to set all of | |
| 1100 | | | them to different values so changing one might also change | |
| 1101 | | | some others. | |
| 1102 | | | | |
| 1103 | | | RW | |
| 1104 | +--------------+---------------------------------------------------------------+ |
Jean Delvare | ec19920 | 2009-03-30 21:46:44 +0200 | [diff] [blame] | 1105 | |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1106 | sysfs attribute writes interpretation |
| 1107 | ------------------------------------- |
| 1108 | |
| 1109 | hwmon sysfs attributes always contain numbers, so the first thing to do is to |
| 1110 | convert the input to a number, there are 2 ways todo this depending whether |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1111 | the number can be negative or not:: |
| 1112 | |
| 1113 | unsigned long u = simple_strtoul(buf, NULL, 10); |
| 1114 | long s = simple_strtol(buf, NULL, 10); |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1115 | |
| 1116 | With buf being the buffer with the user input being passed by the kernel. |
| 1117 | Notice that we do not use the second argument of strto[u]l, and thus cannot |
| 1118 | tell when 0 is returned, if this was really 0 or is caused by invalid input. |
| 1119 | This is done deliberately as checking this everywhere would add a lot of |
| 1120 | code to the kernel. |
| 1121 | |
| 1122 | Notice that it is important to always store the converted value in an |
| 1123 | unsigned long or long, so that no wrap around can happen before any further |
| 1124 | checking. |
| 1125 | |
| 1126 | After the input string is converted to an (unsigned) long, the value should be |
| 1127 | checked if its acceptable. Be careful with further conversions on the value |
| 1128 | before checking it for validity, as these conversions could still cause a wrap |
| 1129 | around before the check. For example do not multiply the result, and only |
| 1130 | add/subtract if it has been divided before the add/subtract. |
| 1131 | |
| 1132 | What to do if a value is found to be invalid, depends on the type of the |
| 1133 | sysfs attribute that is being set. If it is a continuous setting like a |
| 1134 | tempX_max or inX_max attribute, then the value should be clamped to its |
Guenter Roeck | c25fb81 | 2013-01-09 08:12:46 -0800 | [diff] [blame] | 1135 | limits using clamp_val(value, min_limit, max_limit). If it is not continuous |
| 1136 | like for example a tempX_type, then when an invalid value is written, |
| 1137 | -EINVAL should be returned. |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1138 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1139 | Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees):: |
Jean Delvare | 5fbea51 | 2007-10-07 22:44:33 +0200 | [diff] [blame] | 1140 | |
| 1141 | long v = simple_strtol(buf, NULL, 10) / 1000; |
Guenter Roeck | c25fb81 | 2013-01-09 08:12:46 -0800 | [diff] [blame] | 1142 | v = clamp_val(v, -128, 127); |
Jean Delvare | 5fbea51 | 2007-10-07 22:44:33 +0200 | [diff] [blame] | 1143 | /* write v to register */ |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1144 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 1145 | Example2, fan divider setting, valid values 2, 4 and 8:: |
Hans de Goede | 2ed4263 | 2007-09-21 17:03:32 +0200 | [diff] [blame] | 1146 | |
Jean Delvare | 5fbea51 | 2007-10-07 22:44:33 +0200 | [diff] [blame] | 1147 | unsigned long v = simple_strtoul(buf, NULL, 10); |
| 1148 | |
| 1149 | switch (v) { |
| 1150 | case 2: v = 1; break; |
| 1151 | case 4: v = 2; break; |
| 1152 | case 8: v = 3; break; |
| 1153 | default: |
| 1154 | return -EINVAL; |
| 1155 | } |
| 1156 | /* write v to register */ |