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