| 1 | /* |
|---|
| 2 | sensors.h - Part of lm_sensors, Linux kernel modules for hardware |
|---|
| 3 | monitoring |
|---|
| 4 | Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> |
|---|
| 5 | |
|---|
| 6 | This program is free software; you can redistribute it and/or modify |
|---|
| 7 | it under the terms of the GNU General Public License as published by |
|---|
| 8 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | (at your option) any later version. |
|---|
| 10 | |
|---|
| 11 | This program is distributed in the hope that it will be useful, |
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | GNU General Public License for more details. |
|---|
| 15 | |
|---|
| 16 | You should have received a copy of the GNU General Public License |
|---|
| 17 | along with this program; if not, write to the Free Software |
|---|
| 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #ifndef SENSORS_SENSORS_H |
|---|
| 22 | #define SENSORS_SENSORS_H |
|---|
| 23 | |
|---|
| 24 | #ifdef __KERNEL__ |
|---|
| 25 | |
|---|
| 26 | /* Next two must be included before sysctl.h can be included, in 2.0 kernels */ |
|---|
| 27 | #include <linux/types.h> |
|---|
| 28 | #include <linux/fs.h> |
|---|
| 29 | #include <linux/sysctl.h> |
|---|
| 30 | |
|---|
| 31 | /* The type of callback functions used in sensors_{proc,sysctl}_real */ |
|---|
| 32 | typedef void (*sensors_real_callback) (struct i2c_client * client, |
|---|
| 33 | int operation, int ctl_name, |
|---|
| 34 | int *nrels_mag, long *results); |
|---|
| 35 | |
|---|
| 36 | /* Values for the operation field in the above function type */ |
|---|
| 37 | #define SENSORS_PROC_REAL_INFO 1 |
|---|
| 38 | #define SENSORS_PROC_REAL_READ 2 |
|---|
| 39 | #define SENSORS_PROC_REAL_WRITE 3 |
|---|
| 40 | |
|---|
| 41 | /* These funcion reads or writes a 'real' value (encoded by the combination |
|---|
| 42 | of an integer and a magnitude, the last is the power of ten the value |
|---|
| 43 | should be divided with) to a /proc/sys directory. To use these functions, |
|---|
| 44 | you must (before registering the ctl_table) set the extra2 field to the |
|---|
| 45 | client, and the extra1 field to a function of the form: |
|---|
| 46 | void func(struct i2c_client *client, int operation, int ctl_name, |
|---|
| 47 | int *nrels_mag, long *results) |
|---|
| 48 | This last function can be called for three values of operation. If |
|---|
| 49 | operation equals SENSORS_PROC_REAL_INFO, the magnitude should be returned |
|---|
| 50 | in nrels_mag. If operation equals SENSORS_PROC_REAL_READ, values should |
|---|
| 51 | be read into results. nrels_mag should return the number of elements |
|---|
| 52 | read; the maximum number is put in it on entry. Finally, if operation |
|---|
| 53 | equals SENSORS_PROC_REAL_WRITE, the values in results should be |
|---|
| 54 | written to the chip. nrels_mag contains on entry the number of elements |
|---|
| 55 | found. |
|---|
| 56 | In all cases, client points to the client we wish to interact with, |
|---|
| 57 | and ctl_name is the SYSCTL id of the file we are accessing. */ |
|---|
| 58 | extern int sensors_sysctl_real(ctl_table * table, int *name, int nlen, |
|---|
| 59 | void *oldval, size_t * oldlenp, |
|---|
| 60 | void *newval, size_t newlen, |
|---|
| 61 | void **context); |
|---|
| 62 | extern int sensors_proc_real(ctl_table * ctl, int write, struct file *filp, |
|---|
| 63 | void *buffer, size_t * lenp); |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | /* These rather complex functions must be called when you want to add or |
|---|
| 68 | delete an entry in /proc/sys/dev/sensors/chips (not yet implemented). It |
|---|
| 69 | also creates a new directory within /proc/sys/dev/sensors/. |
|---|
| 70 | ctl_template should be a template of the newly created directory. It is |
|---|
| 71 | copied in memory. The extra2 field of each file is set to point to client. |
|---|
| 72 | If any driver wants subdirectories within the newly created directory, |
|---|
| 73 | these functions must be updated! */ |
|---|
| 74 | extern int sensors_register_entry(struct i2c_client *client, |
|---|
| 75 | const char *prefix, |
|---|
| 76 | ctl_table * ctl_template, |
|---|
| 77 | struct module *controlling_mod); |
|---|
| 78 | |
|---|
| 79 | extern void sensors_deregister_entry(int id); |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | /* A structure containing detect information. |
|---|
| 83 | Force variables overrule all other variables; they force a detection on |
|---|
| 84 | that place. If a specific chip is given, the module blindly assumes this |
|---|
| 85 | chip type is present; if a general force (kind == 0) is given, the module |
|---|
| 86 | will still try to figure out what type of chip is present. This is useful |
|---|
| 87 | if for some reasons the detect for SMBus or ISA address space filled |
|---|
| 88 | fails. |
|---|
| 89 | probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. |
|---|
| 90 | A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for |
|---|
| 91 | the ISA bus, -1 for any I2C bus), the second is the address. |
|---|
| 92 | kind: The kind of chip. 0 equals any chip. |
|---|
| 93 | */ |
|---|
| 94 | struct sensors_force_data { |
|---|
| 95 | unsigned short *force; |
|---|
| 96 | unsigned short kind; |
|---|
| 97 | }; |
|---|
| 98 | |
|---|
| 99 | /* A structure containing the detect information. |
|---|
| 100 | normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END. |
|---|
| 101 | A list of I2C addresses which should normally be examined. |
|---|
| 102 | normal_i2c_range: filled in by the module writer. Terminated by |
|---|
| 103 | SENSORS_I2C_END |
|---|
| 104 | A list of pairs of I2C addresses, each pair being an inclusive range of |
|---|
| 105 | addresses which should normally be examined. |
|---|
| 106 | normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. |
|---|
| 107 | A list of ISA addresses which should normally be examined. |
|---|
| 108 | normal_isa_range: filled in by the module writer. Terminated by |
|---|
| 109 | SENSORS_ISA_END |
|---|
| 110 | A list of triples. The first two elements are ISA addresses, being an |
|---|
| 111 | range of addresses which should normally be examined. The third is the |
|---|
| 112 | modulo parameter: only addresses which are 0 module this value relative |
|---|
| 113 | to the first address of the range are actually considered. |
|---|
| 114 | probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. |
|---|
| 115 | A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for |
|---|
| 116 | the ISA bus, -1 for any I2C bus), the second is the address. These |
|---|
| 117 | addresses are also probed, as if they were in the 'normal' list. |
|---|
| 118 | probe_range: insmod parameter. Initialize this list with SENSORS_I2C_END |
|---|
| 119 | values. |
|---|
| 120 | A list of triples. The first value is a bus number (SENSORS_ISA_BUS for |
|---|
| 121 | the ISA bus, -1 for any I2C bus), the second and third are addresses. |
|---|
| 122 | These form an inclusive range of addresses that are also probed, as |
|---|
| 123 | if they were in the 'normal' list. |
|---|
| 124 | ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values. |
|---|
| 125 | A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for |
|---|
| 126 | the ISA bus, -1 for any I2C bus), the second is the I2C address. These |
|---|
| 127 | addresses are never probed. This parameter overrules 'normal' and |
|---|
| 128 | 'probe', but not the 'force' lists. |
|---|
| 129 | ignore_range: insmod parameter. Initialize this list with SENSORS_I2C_END |
|---|
| 130 | values. |
|---|
| 131 | A list of triples. The first value is a bus number (SENSORS_ISA_BUS for |
|---|
| 132 | the ISA bus, -1 for any I2C bus), the second and third are addresses. |
|---|
| 133 | These form an inclusive range of I2C addresses that are never probed. |
|---|
| 134 | This parameter overrules 'normal' and 'probe', but not the 'force' lists. |
|---|
| 135 | force_data: insmod parameters. A list, ending with an element of which |
|---|
| 136 | the force field is NULL. |
|---|
| 137 | */ |
|---|
| 138 | struct sensors_address_data { |
|---|
| 139 | unsigned short *normal_i2c; |
|---|
| 140 | unsigned short *normal_i2c_range; |
|---|
| 141 | unsigned int *normal_isa; |
|---|
| 142 | unsigned int *normal_isa_range; |
|---|
| 143 | unsigned short *probe; |
|---|
| 144 | unsigned short *probe_range; |
|---|
| 145 | unsigned short *ignore; |
|---|
| 146 | unsigned short *ignore_range; |
|---|
| 147 | struct sensors_force_data *forces; |
|---|
| 148 | }; |
|---|
| 149 | |
|---|
| 150 | /* Internal numbers to terminate lists */ |
|---|
| 151 | #define SENSORS_I2C_END 0xfffe |
|---|
| 152 | #define SENSORS_ISA_END 0xfffefffe |
|---|
| 153 | |
|---|
| 154 | /* The numbers to use to set an ISA or I2C bus address */ |
|---|
| 155 | #define SENSORS_ISA_BUS 9191 |
|---|
| 156 | #define SENSORS_ANY_I2C_BUS 0xffff |
|---|
| 157 | |
|---|
| 158 | /* The length of the option lists */ |
|---|
| 159 | #define SENSORS_MAX_OPTS 48 |
|---|
| 160 | |
|---|
| 161 | /* Default fill of many variables */ |
|---|
| 162 | #define SENSORS_DEFAULTS {SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 163 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 164 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 165 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 166 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 167 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 168 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 169 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 170 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 171 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 172 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 173 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 174 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 175 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 176 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ |
|---|
| 177 | SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END} |
|---|
| 178 | |
|---|
| 179 | /* This is ugly. We need to evaluate SENSORS_MAX_OPTS before it is |
|---|
| 180 | stringified */ |
|---|
| 181 | #define SENSORS_MODPARM_AUX1(x) "1-" #x "h" |
|---|
| 182 | #define SENSORS_MODPARM_AUX(x) SENSORS_MODPARM_AUX1(x) |
|---|
| 183 | #define SENSORS_MODPARM SENSORS_MODPARM_AUX(SENSORS_MAX_OPTS) |
|---|
| 184 | |
|---|
| 185 | /* SENSORS_MODULE_PARM creates a module parameter, and puts it in the |
|---|
| 186 | module header */ |
|---|
| 187 | #define SENSORS_MODULE_PARM(var,desc) \ |
|---|
| 188 | static unsigned short var[SENSORS_MAX_OPTS] = SENSORS_DEFAULTS; \ |
|---|
| 189 | MODULE_PARM(var,SENSORS_MODPARM); \ |
|---|
| 190 | MODULE_PARM_DESC(var,desc) |
|---|
| 191 | |
|---|
| 192 | /* SENSORS_MODULE_PARM creates a 'force_*' module parameter, and puts it in |
|---|
| 193 | the module header */ |
|---|
| 194 | #define SENSORS_MODULE_PARM_FORCE(name) \ |
|---|
| 195 | SENSORS_MODULE_PARM(force_ ## name, \ |
|---|
| 196 | "List of adapter,address pairs which are unquestionably" \ |
|---|
| 197 | " assumed to contain a `" # name "' chip") |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | /* This defines several insmod variables, and the addr_data structure */ |
|---|
| 201 | #define SENSORS_INSMOD \ |
|---|
| 202 | SENSORS_MODULE_PARM(probe, \ |
|---|
| 203 | "List of adapter,address pairs to scan additionally"); \ |
|---|
| 204 | SENSORS_MODULE_PARM(probe_range, \ |
|---|
| 205 | "List of adapter,start-addr,end-addr triples to scan " \ |
|---|
| 206 | "additionally"); \ |
|---|
| 207 | SENSORS_MODULE_PARM(ignore, \ |
|---|
| 208 | "List of adapter,address pairs not to scan"); \ |
|---|
| 209 | SENSORS_MODULE_PARM(ignore_range, \ |
|---|
| 210 | "List of adapter,start-addr,end-addr triples not to " \ |
|---|
| 211 | "scan"); \ |
|---|
| 212 | static struct sensors_address_data addr_data = \ |
|---|
| 213 | {normal_i2c, normal_i2c_range, \ |
|---|
| 214 | normal_isa, normal_isa_range, \ |
|---|
| 215 | probe, probe_range, \ |
|---|
| 216 | ignore, ignore_range, \ |
|---|
| 217 | forces} |
|---|
| 218 | |
|---|
| 219 | /* The following functions create an enum with the chip names as elements. |
|---|
| 220 | The first element of the enum is any_chip. These are the only macros |
|---|
| 221 | a module will want to use. */ |
|---|
| 222 | |
|---|
| 223 | #define SENSORS_INSMOD_0 \ |
|---|
| 224 | enum chips { any_chip }; \ |
|---|
| 225 | SENSORS_MODULE_PARM(force, \ |
|---|
| 226 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 227 | "to be present"); \ |
|---|
| 228 | static struct sensors_force_data forces[] = {{force,any_chip},{NULL}}; \ |
|---|
| 229 | SENSORS_INSMOD |
|---|
| 230 | |
|---|
| 231 | #define SENSORS_INSMOD_1(chip1) \ |
|---|
| 232 | enum chips { any_chip, chip1 }; \ |
|---|
| 233 | SENSORS_MODULE_PARM(force, \ |
|---|
| 234 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 235 | "to be present"); \ |
|---|
| 236 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 237 | static struct sensors_force_data forces[] = {{force,any_chip},\ |
|---|
| 238 | {force_ ## chip1,chip1}, \ |
|---|
| 239 | {NULL}}; \ |
|---|
| 240 | SENSORS_INSMOD |
|---|
| 241 | |
|---|
| 242 | #define SENSORS_INSMOD_2(chip1,chip2) \ |
|---|
| 243 | enum chips { any_chip, chip1, chip2 }; \ |
|---|
| 244 | SENSORS_MODULE_PARM(force, \ |
|---|
| 245 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 246 | "to be present"); \ |
|---|
| 247 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 248 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 249 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 250 | {force_ ## chip1,chip1}, \ |
|---|
| 251 | {force_ ## chip2,chip2}, \ |
|---|
| 252 | {NULL}}; \ |
|---|
| 253 | SENSORS_INSMOD |
|---|
| 254 | |
|---|
| 255 | #define SENSORS_INSMOD_3(chip1,chip2,chip3) \ |
|---|
| 256 | enum chips { any_chip, chip1, chip2, chip3 }; \ |
|---|
| 257 | SENSORS_MODULE_PARM(force, \ |
|---|
| 258 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 259 | "to be present"); \ |
|---|
| 260 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 261 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 262 | SENSORS_MODULE_PARM_FORCE(chip3); \ |
|---|
| 263 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 264 | {force_ ## chip1,chip1}, \ |
|---|
| 265 | {force_ ## chip2,chip2}, \ |
|---|
| 266 | {force_ ## chip3,chip3}, \ |
|---|
| 267 | {NULL}}; \ |
|---|
| 268 | SENSORS_INSMOD |
|---|
| 269 | |
|---|
| 270 | #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ |
|---|
| 271 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ |
|---|
| 272 | SENSORS_MODULE_PARM(force, \ |
|---|
| 273 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 274 | "to be present"); \ |
|---|
| 275 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 276 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 277 | SENSORS_MODULE_PARM_FORCE(chip3); \ |
|---|
| 278 | SENSORS_MODULE_PARM_FORCE(chip4); \ |
|---|
| 279 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 280 | {force_ ## chip1,chip1}, \ |
|---|
| 281 | {force_ ## chip2,chip2}, \ |
|---|
| 282 | {force_ ## chip3,chip3}, \ |
|---|
| 283 | {force_ ## chip4,chip4}, \ |
|---|
| 284 | {NULL}}; \ |
|---|
| 285 | SENSORS_INSMOD |
|---|
| 286 | |
|---|
| 287 | #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ |
|---|
| 288 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ |
|---|
| 289 | SENSORS_MODULE_PARM(force, \ |
|---|
| 290 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 291 | "to be present"); \ |
|---|
| 292 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 293 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 294 | SENSORS_MODULE_PARM_FORCE(chip3); \ |
|---|
| 295 | SENSORS_MODULE_PARM_FORCE(chip4); \ |
|---|
| 296 | SENSORS_MODULE_PARM_FORCE(chip5); \ |
|---|
| 297 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 298 | {force_ ## chip1,chip1}, \ |
|---|
| 299 | {force_ ## chip2,chip2}, \ |
|---|
| 300 | {force_ ## chip3,chip3}, \ |
|---|
| 301 | {force_ ## chip4,chip4}, \ |
|---|
| 302 | {force_ ## chip5,chip5}, \ |
|---|
| 303 | {NULL}}; \ |
|---|
| 304 | SENSORS_INSMOD |
|---|
| 305 | |
|---|
| 306 | #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ |
|---|
| 307 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ |
|---|
| 308 | SENSORS_MODULE_PARM(force, \ |
|---|
| 309 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 310 | "to be present"); \ |
|---|
| 311 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 312 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 313 | SENSORS_MODULE_PARM_FORCE(chip3); \ |
|---|
| 314 | SENSORS_MODULE_PARM_FORCE(chip4); \ |
|---|
| 315 | SENSORS_MODULE_PARM_FORCE(chip5); \ |
|---|
| 316 | SENSORS_MODULE_PARM_FORCE(chip6); \ |
|---|
| 317 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 318 | {force_ ## chip1,chip1}, \ |
|---|
| 319 | {force_ ## chip2,chip2}, \ |
|---|
| 320 | {force_ ## chip3,chip3}, \ |
|---|
| 321 | {force_ ## chip4,chip4}, \ |
|---|
| 322 | {force_ ## chip5,chip5}, \ |
|---|
| 323 | {force_ ## chip6,chip6}, \ |
|---|
| 324 | {NULL}}; \ |
|---|
| 325 | SENSORS_INSMOD |
|---|
| 326 | |
|---|
| 327 | #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ |
|---|
| 328 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \ |
|---|
| 329 | SENSORS_MODULE_PARM(force, \ |
|---|
| 330 | "List of adapter,address pairs to boldly assume " \ |
|---|
| 331 | "to be present"); \ |
|---|
| 332 | SENSORS_MODULE_PARM_FORCE(chip1); \ |
|---|
| 333 | SENSORS_MODULE_PARM_FORCE(chip2); \ |
|---|
| 334 | SENSORS_MODULE_PARM_FORCE(chip3); \ |
|---|
| 335 | SENSORS_MODULE_PARM_FORCE(chip4); \ |
|---|
| 336 | SENSORS_MODULE_PARM_FORCE(chip5); \ |
|---|
| 337 | SENSORS_MODULE_PARM_FORCE(chip6); \ |
|---|
| 338 | SENSORS_MODULE_PARM_FORCE(chip7); \ |
|---|
| 339 | static struct sensors_force_data forces[] = {{force,any_chip}, \ |
|---|
| 340 | {force_ ## chip1,chip1}, \ |
|---|
| 341 | {force_ ## chip2,chip2}, \ |
|---|
| 342 | {force_ ## chip3,chip3}, \ |
|---|
| 343 | {force_ ## chip4,chip4}, \ |
|---|
| 344 | {force_ ## chip5,chip5}, \ |
|---|
| 345 | {force_ ## chip6,chip6}, \ |
|---|
| 346 | {force_ ## chip7,chip7}, \ |
|---|
| 347 | {NULL}}; \ |
|---|
| 348 | SENSORS_INSMOD |
|---|
| 349 | |
|---|
| 350 | typedef int sensors_found_addr_proc(struct i2c_adapter *adapter, |
|---|
| 351 | int addr, unsigned short flags, |
|---|
| 352 | int kind); |
|---|
| 353 | |
|---|
| 354 | /* Detect function. It itterates over all possible addresses itself. For |
|---|
| 355 | SMBus addresses, it will only call found_proc if some client is connected |
|---|
| 356 | to the SMBus (unless a 'force' matched); for ISA detections, this is not |
|---|
| 357 | done. */ |
|---|
| 358 | extern int sensors_detect(struct i2c_adapter *adapter, |
|---|
| 359 | struct sensors_address_data *address_data, |
|---|
| 360 | sensors_found_addr_proc * found_proc); |
|---|
| 361 | |
|---|
| 362 | |
|---|
| 363 | /* This macro is used to scale user-input to sensible values in almost all |
|---|
| 364 | chip drivers. */ |
|---|
| 365 | extern inline int SENSORS_LIMIT(long value, long low, long high) |
|---|
| 366 | { |
|---|
| 367 | if (value < low) |
|---|
| 368 | return low; |
|---|
| 369 | else if (value > high) |
|---|
| 370 | return high; |
|---|
| 371 | else |
|---|
| 372 | return value; |
|---|
| 373 | } |
|---|
| 374 | |
|---|
| 375 | #endif /* def __KERNEL__ */ |
|---|
| 376 | |
|---|
| 377 | |
|---|
| 378 | /* The maximum length of the prefix */ |
|---|
| 379 | #define SENSORS_PREFIX_MAX 20 |
|---|
| 380 | |
|---|
| 381 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. |
|---|
| 382 | Other drivers define the id in linux/i2c.h */ |
|---|
| 383 | #define I2C_DRIVERID_LM78 1002 |
|---|
| 384 | #define I2C_DRIVERID_LM75 1003 |
|---|
| 385 | #define I2C_DRIVERID_GL518 1004 |
|---|
| 386 | #define I2C_DRIVERID_EEPROM 1005 |
|---|
| 387 | #define I2C_DRIVERID_W83781D 1006 |
|---|
| 388 | #define I2C_DRIVERID_LM80 1007 |
|---|
| 389 | #define I2C_DRIVERID_ADM1021 1008 |
|---|
| 390 | #define I2C_DRIVERID_ADM9240 1009 |
|---|
| 391 | #define I2C_DRIVERID_LTC1710 1010 |
|---|
| 392 | #define I2C_DRIVERID_SIS5595 1011 |
|---|
| 393 | #define I2C_DRIVERID_ICSPLL 1012 |
|---|
| 394 | #define I2C_DRIVERID_BT869 1013 |
|---|
| 395 | #define I2C_DRIVERID_MAXILIFE 1014 |
|---|
| 396 | #define I2C_DRIVERID_MATORB 1015 |
|---|
| 397 | #define I2C_DRIVERID_GL520 1016 |
|---|
| 398 | #define I2C_DRIVERID_THMC50 1017 |
|---|
| 399 | #define I2C_DRIVERID_DDCMON 1018 |
|---|
| 400 | #define I2C_DRIVERID_VIA686A 1019 |
|---|
| 401 | #define I2C_DRIVERID_ADM1025 1020 |
|---|
| 402 | #define I2C_DRIVERID_LM87 1021 |
|---|
| 403 | #define I2C_DRIVERID_PCF8574 1022 |
|---|
| 404 | #define I2C_DRIVERID_MTP008 1023 |
|---|
| 405 | |
|---|
| 406 | /* Sysctl IDs */ |
|---|
| 407 | #ifdef DEV_HWMON |
|---|
| 408 | #define DEV_SENSORS DEV_HWMON |
|---|
| 409 | #else /* ndef DEV_HWMOM */ |
|---|
| 410 | #define DEV_SENSORS 2 /* The id of the lm_sensors directory within the |
|---|
| 411 | dev table */ |
|---|
| 412 | #endif /* def DEV_HWMON */ |
|---|
| 413 | |
|---|
| 414 | #define SENSORS_CHIPS 1 |
|---|
| 415 | struct sensors_chips_data { |
|---|
| 416 | int sysctl_id; |
|---|
| 417 | char name[SENSORS_PREFIX_MAX + 13]; |
|---|
| 418 | }; |
|---|
| 419 | |
|---|
| 420 | #define LM78_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 421 | #define LM78_SYSCTL_IN1 1001 |
|---|
| 422 | #define LM78_SYSCTL_IN2 1002 |
|---|
| 423 | #define LM78_SYSCTL_IN3 1003 |
|---|
| 424 | #define LM78_SYSCTL_IN4 1004 |
|---|
| 425 | #define LM78_SYSCTL_IN5 1005 |
|---|
| 426 | #define LM78_SYSCTL_IN6 1006 |
|---|
| 427 | #define LM78_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 428 | #define LM78_SYSCTL_FAN2 1102 |
|---|
| 429 | #define LM78_SYSCTL_FAN3 1103 |
|---|
| 430 | #define LM78_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */ |
|---|
| 431 | #define LM78_SYSCTL_VID 1300 /* Volts * 100 */ |
|---|
| 432 | #define LM78_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 433 | #define LM78_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 434 | |
|---|
| 435 | #define LM78_ALARM_IN0 0x0001 |
|---|
| 436 | #define LM78_ALARM_IN1 0x0002 |
|---|
| 437 | #define LM78_ALARM_IN2 0x0004 |
|---|
| 438 | #define LM78_ALARM_IN3 0x0008 |
|---|
| 439 | #define LM78_ALARM_IN4 0x0100 |
|---|
| 440 | #define LM78_ALARM_IN5 0x0200 |
|---|
| 441 | #define LM78_ALARM_IN6 0x0400 |
|---|
| 442 | #define LM78_ALARM_FAN1 0x0040 |
|---|
| 443 | #define LM78_ALARM_FAN2 0x0080 |
|---|
| 444 | #define LM78_ALARM_FAN3 0x0800 |
|---|
| 445 | #define LM78_ALARM_TEMP 0x0010 |
|---|
| 446 | #define LM78_ALARM_BTI 0x0020 |
|---|
| 447 | #define LM78_ALARM_CHAS 0x1000 |
|---|
| 448 | #define LM78_ALARM_FIFO 0x2000 |
|---|
| 449 | #define LM78_ALARM_SMI_IN 0x4000 |
|---|
| 450 | |
|---|
| 451 | #define W83781D_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 452 | #define W83781D_SYSCTL_IN1 1001 |
|---|
| 453 | #define W83781D_SYSCTL_IN2 1002 |
|---|
| 454 | #define W83781D_SYSCTL_IN3 1003 |
|---|
| 455 | #define W83781D_SYSCTL_IN4 1004 |
|---|
| 456 | #define W83781D_SYSCTL_IN5 1005 |
|---|
| 457 | #define W83781D_SYSCTL_IN6 1006 |
|---|
| 458 | #define W83781D_SYSCTL_IN7 1007 |
|---|
| 459 | #define W83781D_SYSCTL_IN8 1008 |
|---|
| 460 | #define W83781D_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 461 | #define W83781D_SYSCTL_FAN2 1102 |
|---|
| 462 | #define W83781D_SYSCTL_FAN3 1103 |
|---|
| 463 | #define W83781D_SYSCTL_TEMP1 1200 /* Degrees Celcius * 10 */ |
|---|
| 464 | #define W83781D_SYSCTL_TEMP2 1201 /* Degrees Celcius * 10 */ |
|---|
| 465 | #define W83781D_SYSCTL_TEMP3 1202 /* Degrees Celcius * 10 */ |
|---|
| 466 | #define W83781D_SYSCTL_VID 1300 /* Volts * 100 */ |
|---|
| 467 | #define W83781D_SYSCTL_PWM1 1401 |
|---|
| 468 | #define W83781D_SYSCTL_PWM2 1402 |
|---|
| 469 | #define W83781D_SYSCTL_PWM3 1403 |
|---|
| 470 | #define W83781D_SYSCTL_PWM4 1404 |
|---|
| 471 | #define W83781D_SYSCTL_SENS1 1501 /* 1, 2, or Beta (3000-5000) */ |
|---|
| 472 | #define W83781D_SYSCTL_SENS2 1502 |
|---|
| 473 | #define W83781D_SYSCTL_SENS3 1503 |
|---|
| 474 | #define W83781D_SYSCTL_RT1 1601 /* 32-entry table */ |
|---|
| 475 | #define W83781D_SYSCTL_RT2 1602 /* 32-entry table */ |
|---|
| 476 | #define W83781D_SYSCTL_RT3 1603 /* 32-entry table */ |
|---|
| 477 | #define W83781D_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 478 | #define W83781D_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 479 | #define W83781D_SYSCTL_BEEP 2002 /* bitvector */ |
|---|
| 480 | |
|---|
| 481 | #define W83781D_ALARM_IN0 0x0001 |
|---|
| 482 | #define W83781D_ALARM_IN1 0x0002 |
|---|
| 483 | #define W83781D_ALARM_IN2 0x0004 |
|---|
| 484 | #define W83781D_ALARM_IN3 0x0008 |
|---|
| 485 | #define W83781D_ALARM_IN4 0x0100 |
|---|
| 486 | #define W83781D_ALARM_IN5 0x0200 |
|---|
| 487 | #define W83781D_ALARM_IN6 0x0400 |
|---|
| 488 | #define W83782D_ALARM_IN7 0x10000 |
|---|
| 489 | #define W83782D_ALARM_IN8 0x20000 |
|---|
| 490 | #define W83781D_ALARM_FAN1 0x0040 |
|---|
| 491 | #define W83781D_ALARM_FAN2 0x0080 |
|---|
| 492 | #define W83781D_ALARM_FAN3 0x0800 |
|---|
| 493 | #define W83781D_ALARM_TEMP1 0x0010 |
|---|
| 494 | #define W83781D_ALARM_TEMP23 0x0020 /* 781D only */ |
|---|
| 495 | #define W83781D_ALARM_TEMP2 0x0020 /* 782D/783S */ |
|---|
| 496 | #define W83781D_ALARM_TEMP3 0x2000 /* 782D only */ |
|---|
| 497 | #define W83781D_ALARM_CHAS 0x1000 |
|---|
| 498 | |
|---|
| 499 | #define LM75_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */ |
|---|
| 500 | |
|---|
| 501 | #define ADM1021_SYSCTL_TEMP 1200 |
|---|
| 502 | #define ADM1021_SYSCTL_REMOTE_TEMP 1201 |
|---|
| 503 | #define ADM1021_SYSCTL_DIE_CODE 1202 |
|---|
| 504 | #define ADM1021_SYSCTL_ALARMS 1203 |
|---|
| 505 | |
|---|
| 506 | #define ADM1021_ALARM_TEMP_HIGH 0x40 |
|---|
| 507 | #define ADM1021_ALARM_TEMP_LOW 0x20 |
|---|
| 508 | #define ADM1021_ALARM_RTEMP_HIGH 0x10 |
|---|
| 509 | #define ADM1021_ALARM_RTEMP_LOW 0x08 |
|---|
| 510 | #define ADM1021_ALARM_RTEMP_NA 0x04 |
|---|
| 511 | |
|---|
| 512 | #define GL518_SYSCTL_VDD 1000 /* Volts * 100 */ |
|---|
| 513 | #define GL518_SYSCTL_VIN1 1001 |
|---|
| 514 | #define GL518_SYSCTL_VIN2 1002 |
|---|
| 515 | #define GL518_SYSCTL_VIN3 1003 |
|---|
| 516 | #define GL518_SYSCTL_FAN1 1101 /* RPM */ |
|---|
| 517 | #define GL518_SYSCTL_FAN2 1102 |
|---|
| 518 | #define GL518_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */ |
|---|
| 519 | #define GL518_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 520 | #define GL518_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 521 | #define GL518_SYSCTL_BEEP 2002 /* bitvector */ |
|---|
| 522 | #define GL518_SYSCTL_FAN1OFF 2003 |
|---|
| 523 | #define GL518_SYSCTL_ITERATE 2004 |
|---|
| 524 | |
|---|
| 525 | #define GL518_ALARM_VDD 0x01 |
|---|
| 526 | #define GL518_ALARM_VIN1 0x02 |
|---|
| 527 | #define GL518_ALARM_VIN2 0x04 |
|---|
| 528 | #define GL518_ALARM_VIN3 0x08 |
|---|
| 529 | #define GL518_ALARM_TEMP 0x10 |
|---|
| 530 | #define GL518_ALARM_FAN1 0x20 |
|---|
| 531 | #define GL518_ALARM_FAN2 0x40 |
|---|
| 532 | |
|---|
| 533 | #define GL520_SYSCTL_VDD 1000 /* Volts * 100 */ |
|---|
| 534 | #define GL520_SYSCTL_VIN1 1001 |
|---|
| 535 | #define GL520_SYSCTL_VIN2 1002 |
|---|
| 536 | #define GL520_SYSCTL_VIN3 1003 |
|---|
| 537 | #define GL520_SYSCTL_VIN4 1004 |
|---|
| 538 | #define GL520_SYSCTL_FAN1 1101 /* RPM */ |
|---|
| 539 | #define GL520_SYSCTL_FAN2 1102 |
|---|
| 540 | #define GL520_SYSCTL_TEMP1 1200 /* Degrees Celcius * 10 */ |
|---|
| 541 | #define GL520_SYSCTL_TEMP2 1201 /* Degrees Celcius * 10 */ |
|---|
| 542 | #define GL520_SYSCTL_VID 1300 |
|---|
| 543 | #define GL520_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 544 | #define GL520_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 545 | #define GL520_SYSCTL_BEEP 2002 /* bitvector */ |
|---|
| 546 | #define GL520_SYSCTL_FAN1OFF 2003 |
|---|
| 547 | #define GL520_SYSCTL_CONFIG 2004 |
|---|
| 548 | |
|---|
| 549 | #define GL520_ALARM_VDD 0x01 |
|---|
| 550 | #define GL520_ALARM_VIN1 0x02 |
|---|
| 551 | #define GL520_ALARM_VIN2 0x04 |
|---|
| 552 | #define GL520_ALARM_VIN3 0x08 |
|---|
| 553 | #define GL520_ALARM_TEMP1 0x10 |
|---|
| 554 | #define GL520_ALARM_FAN1 0x20 |
|---|
| 555 | #define GL520_ALARM_FAN2 0x40 |
|---|
| 556 | #define GL520_ALARM_TEMP2 0x80 |
|---|
| 557 | #define GL520_ALARM_VIN4 0x80 |
|---|
| 558 | |
|---|
| 559 | #define EEPROM_SYSCTL1 1000 |
|---|
| 560 | #define EEPROM_SYSCTL2 1001 |
|---|
| 561 | #define EEPROM_SYSCTL3 1002 |
|---|
| 562 | #define EEPROM_SYSCTL4 1003 |
|---|
| 563 | #define EEPROM_SYSCTL5 1004 |
|---|
| 564 | #define EEPROM_SYSCTL6 1005 |
|---|
| 565 | #define EEPROM_SYSCTL7 1006 |
|---|
| 566 | #define EEPROM_SYSCTL8 1007 |
|---|
| 567 | |
|---|
| 568 | #define LM80_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 569 | #define LM80_SYSCTL_IN1 1001 |
|---|
| 570 | #define LM80_SYSCTL_IN2 1002 |
|---|
| 571 | #define LM80_SYSCTL_IN3 1003 |
|---|
| 572 | #define LM80_SYSCTL_IN4 1004 |
|---|
| 573 | #define LM80_SYSCTL_IN5 1005 |
|---|
| 574 | #define LM80_SYSCTL_IN6 1006 |
|---|
| 575 | #define LM80_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 576 | #define LM80_SYSCTL_FAN2 1102 |
|---|
| 577 | #define LM80_SYSCTL_TEMP 1250 /* Degrees Celcius * 100 */ |
|---|
| 578 | #define LM80_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 579 | #define LM80_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 580 | |
|---|
| 581 | #define ADM9240_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 582 | #define ADM9240_SYSCTL_IN1 1001 |
|---|
| 583 | #define ADM9240_SYSCTL_IN2 1002 |
|---|
| 584 | #define ADM9240_SYSCTL_IN3 1003 |
|---|
| 585 | #define ADM9240_SYSCTL_IN4 1004 |
|---|
| 586 | #define ADM9240_SYSCTL_IN5 1005 |
|---|
| 587 | #define ADM9240_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 588 | #define ADM9240_SYSCTL_FAN2 1102 |
|---|
| 589 | #define ADM9240_SYSCTL_TEMP 1250 /* Degrees Celcius * 100 */ |
|---|
| 590 | #define ADM9240_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 591 | #define ADM9240_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 592 | #define ADM9240_SYSCTL_ANALOG_OUT 2002 |
|---|
| 593 | #define ADM9240_SYSCTL_VID 2003 |
|---|
| 594 | |
|---|
| 595 | #define ADM9240_ALARM_IN0 0x0001 |
|---|
| 596 | #define ADM9240_ALARM_IN1 0x0002 |
|---|
| 597 | #define ADM9240_ALARM_IN2 0x0004 |
|---|
| 598 | #define ADM9240_ALARM_IN3 0x0008 |
|---|
| 599 | #define ADM9240_ALARM_IN4 0x0100 |
|---|
| 600 | #define ADM9240_ALARM_IN5 0x0200 |
|---|
| 601 | #define ADM9240_ALARM_FAN1 0x0040 |
|---|
| 602 | #define ADM9240_ALARM_FAN2 0x0080 |
|---|
| 603 | #define ADM9240_ALARM_TEMP 0x0010 |
|---|
| 604 | #define ADM9240_ALARM_CHAS 0x1000 |
|---|
| 605 | |
|---|
| 606 | #define ADM1025_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 607 | #define ADM1025_SYSCTL_IN1 1001 |
|---|
| 608 | #define ADM1025_SYSCTL_IN2 1002 |
|---|
| 609 | #define ADM1025_SYSCTL_IN3 1003 |
|---|
| 610 | #define ADM1025_SYSCTL_IN4 1004 |
|---|
| 611 | #define ADM1025_SYSCTL_IN5 1005 |
|---|
| 612 | #define ADM1025_SYSCTL_RTEMP 1251 |
|---|
| 613 | #define ADM1025_SYSCTL_TEMP 1250 /* Degrees Celcius * 100 */ |
|---|
| 614 | #define ADM1025_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 615 | #define ADM1025_SYSCTL_ANALOG_OUT 2002 |
|---|
| 616 | #define ADM1025_SYSCTL_VID 2003 |
|---|
| 617 | |
|---|
| 618 | #define ADM1025_ALARM_IN0 0x0001 |
|---|
| 619 | #define ADM1025_ALARM_IN1 0x0002 |
|---|
| 620 | #define ADM1025_ALARM_IN2 0x0004 |
|---|
| 621 | #define ADM1025_ALARM_IN3 0x0008 |
|---|
| 622 | #define ADM1025_ALARM_IN4 0x0100 |
|---|
| 623 | #define ADM1025_ALARM_IN5 0x0200 |
|---|
| 624 | #define ADM1025_ALARM_RTEMP 0x0020 |
|---|
| 625 | #define ADM1025_ALARM_TEMP 0x0010 |
|---|
| 626 | |
|---|
| 627 | #define LTC1710_SYSCTL_SWITCH_1 1000 |
|---|
| 628 | #define LTC1710_SYSCTL_SWITCH_2 1001 |
|---|
| 629 | |
|---|
| 630 | #define LM80_ALARM_IN0 0x0001 |
|---|
| 631 | #define LM80_ALARM_IN1 0x0002 |
|---|
| 632 | #define LM80_ALARM_IN2 0x0004 |
|---|
| 633 | #define LM80_ALARM_IN3 0x0008 |
|---|
| 634 | #define LM80_ALARM_IN4 0x0010 |
|---|
| 635 | #define LM80_ALARM_IN5 0x0020 |
|---|
| 636 | #define LM80_ALARM_IN6 0x0040 |
|---|
| 637 | #define LM80_ALARM_FAN1 0x0400 |
|---|
| 638 | #define LM80_ALARM_FAN2 0x0800 |
|---|
| 639 | #define LM80_ALARM_TEMP_HOT 0x0100 |
|---|
| 640 | #define LM80_ALARM_TEMP_OS 0x2000 |
|---|
| 641 | #define LM80_ALARM_CHAS 0x1000 |
|---|
| 642 | #define LM80_ALARM_BTI 0x0200 |
|---|
| 643 | #define LM80_ALARM_INT_IN 0x0080 |
|---|
| 644 | |
|---|
| 645 | #define MAXI_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 646 | #define MAXI_SYSCTL_FAN2 1102 /* Rotations/min */ |
|---|
| 647 | #define MAXI_SYSCTL_FAN3 1103 /* Rotations/min */ |
|---|
| 648 | #define MAXI_SYSCTL_FAN4 1104 /* Rotations/min */ |
|---|
| 649 | #define MAXI_SYSCTL_TEMP1 1201 /* Degrees Celcius */ |
|---|
| 650 | #define MAXI_SYSCTL_TEMP2 1202 /* Degrees Celcius */ |
|---|
| 651 | #define MAXI_SYSCTL_TEMP3 1203 /* Degrees Celcius */ |
|---|
| 652 | #define MAXI_SYSCTL_TEMP4 1204 /* Degrees Celcius */ |
|---|
| 653 | #define MAXI_SYSCTL_TEMP5 1205 /* Degrees Celcius */ |
|---|
| 654 | #define MAXI_SYSCTL_TEMP6 1206 /* Degrees Celcius */ |
|---|
| 655 | #define MAXI_SYSCTL_PLL 1301 /* MHz */ |
|---|
| 656 | #define MAXI_SYSCTL_VID1 1401 /* Volts / 6.337, for nba just Volts */ |
|---|
| 657 | #define MAXI_SYSCTL_VID2 1402 /* Volts */ |
|---|
| 658 | #define MAXI_SYSCTL_VID3 1403 /* Volts */ |
|---|
| 659 | #define MAXI_SYSCTL_VID4 1404 /* Volts */ |
|---|
| 660 | #define MAXI_SYSCTL_VID5 1405 /* Volts */ |
|---|
| 661 | #define MAXI_SYSCTL_LCD1 1501 /* Line 1 of LCD */ |
|---|
| 662 | #define MAXI_SYSCTL_LCD2 1502 /* Line 2 of LCD */ |
|---|
| 663 | #define MAXI_SYSCTL_LCD3 1503 /* Line 3 of LCD */ |
|---|
| 664 | #define MAXI_SYSCTL_LCD4 1504 /* Line 4 of LCD */ |
|---|
| 665 | #define MAXI_SYSCTL_ALARMS 2001 /* Bitvector (see below) */ |
|---|
| 666 | |
|---|
| 667 | #define MAXI_ALARM_VID4 0x0001 |
|---|
| 668 | #define MAXI_ALARM_TEMP2 0x0002 |
|---|
| 669 | #define MAXI_ALARM_VID1 0x0004 |
|---|
| 670 | #define MAXI_ALARM_VID2 0x0008 |
|---|
| 671 | #define MAXI_ALARM_VID3 0x0010 |
|---|
| 672 | #define MAXI_ALARM_PLL 0x0080 |
|---|
| 673 | #define MAXI_ALARM_TEMP4 0x0100 |
|---|
| 674 | #define MAXI_ALARM_TEMP5 0x0200 |
|---|
| 675 | #define MAXI_ALARM_FAN1 0x1000 |
|---|
| 676 | #define MAXI_ALARM_FAN2 0x2000 |
|---|
| 677 | #define MAXI_ALARM_FAN3 0x4000 |
|---|
| 678 | |
|---|
| 679 | #define MAXI_ALARM_FAN 0x0100 /* To be used with MaxiLife'99 */ |
|---|
| 680 | #define MAXI_ALARM_VID 0x0200 /* The MSB specifies which sensor */ |
|---|
| 681 | #define MAXI_ALARM_TEMP 0x0400 /* in the alarm group failed, i.e.: */ |
|---|
| 682 | #define MAXI_ALARM_VADD 0x0800 /* 0x0402 = TEMP2 failed = CPU2 temp */ |
|---|
| 683 | |
|---|
| 684 | #define SIS5595_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 685 | #define SIS5595_SYSCTL_IN1 1001 |
|---|
| 686 | #define SIS5595_SYSCTL_IN2 1002 |
|---|
| 687 | #define SIS5595_SYSCTL_IN3 1003 |
|---|
| 688 | #define SIS5595_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 689 | #define SIS5595_SYSCTL_FAN2 1102 |
|---|
| 690 | #define SIS5595_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */ |
|---|
| 691 | #define SIS5595_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 692 | #define SIS5595_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 693 | |
|---|
| 694 | #define SIS5595_ALARM_IN0 0x01 |
|---|
| 695 | #define SIS5595_ALARM_IN1 0x02 |
|---|
| 696 | #define SIS5595_ALARM_IN2 0x04 |
|---|
| 697 | #define SIS5595_ALARM_IN3 0x08 |
|---|
| 698 | #define SIS5595_ALARM_TEMP 0x10 |
|---|
| 699 | #define SIS5595_ALARM_BTI 0x20 |
|---|
| 700 | #define SIS5595_ALARM_FAN1 0x40 |
|---|
| 701 | #define SIS5595_ALARM_FAN2 0x80 |
|---|
| 702 | |
|---|
| 703 | #define VIA686A_SYSCTL_IN0 1000 |
|---|
| 704 | #define VIA686A_SYSCTL_IN1 1001 |
|---|
| 705 | #define VIA686A_SYSCTL_IN2 1002 |
|---|
| 706 | #define VIA686A_SYSCTL_IN3 1003 |
|---|
| 707 | #define VIA686A_SYSCTL_IN4 1004 |
|---|
| 708 | #define VIA686A_SYSCTL_FAN1 1101 |
|---|
| 709 | #define VIA686A_SYSCTL_FAN2 1102 |
|---|
| 710 | #define VIA686A_SYSCTL_TEMP 1200 |
|---|
| 711 | #define VIA686A_SYSCTL_TEMP2 1201 |
|---|
| 712 | #define VIA686A_SYSCTL_TEMP3 1202 |
|---|
| 713 | #define VIA686A_SYSCTL_FAN_DIV 2000 |
|---|
| 714 | #define VIA686A_SYSCTL_ALARMS 2001 |
|---|
| 715 | |
|---|
| 716 | #define VIA686A_ALARM_IN0 0x01 |
|---|
| 717 | #define VIA686A_ALARM_IN1 0x02 |
|---|
| 718 | #define VIA686A_ALARM_IN2 0x04 |
|---|
| 719 | #define VIA686A_ALARM_IN3 0x08 |
|---|
| 720 | #define VIA686A_ALARM_TEMP 0x10 |
|---|
| 721 | #define VIA686A_ALARM_FAN1 0x40 |
|---|
| 722 | #define VIA686A_ALARM_FAN2 0x80 |
|---|
| 723 | #define VIA686A_ALARM_IN4 0x100 |
|---|
| 724 | #define VIA686A_ALARM_TEMP2 0x800 |
|---|
| 725 | #define VIA686A_ALARM_CHAS 0x1000 |
|---|
| 726 | #define VIA686A_ALARM_TEMP3 0x8000 |
|---|
| 727 | |
|---|
| 728 | #define ICSPLL_SYSCTL1 1000 |
|---|
| 729 | |
|---|
| 730 | #define BT869_SYSCTL_STATUS 1000 |
|---|
| 731 | #define BT869_SYSCTL_NTSC 1001 |
|---|
| 732 | #define BT869_SYSCTL_HALF 1002 |
|---|
| 733 | #define BT869_SYSCTL_RES 1003 |
|---|
| 734 | #define BT869_SYSCTL_COLORBARS 1004 |
|---|
| 735 | #define BT869_SYSCTL_DEPTH 1005 |
|---|
| 736 | |
|---|
| 737 | #define MATORB_SYSCTL_DISP 1000 |
|---|
| 738 | |
|---|
| 739 | #define THMC50_SYSCTL_TEMP 1200 /* Degrees Celcius */ |
|---|
| 740 | #define THMC50_SYSCTL_REMOTE_TEMP 1201 /* Degrees Celcius */ |
|---|
| 741 | #define THMC50_SYSCTL_INTER 1202 |
|---|
| 742 | #define THMC50_SYSCTL_INTER_MASK 1203 |
|---|
| 743 | #define THMC50_SYSCTL_DIE_CODE 1204 |
|---|
| 744 | #define THMC50_SYSCTL_ANALOG_OUT 1205 |
|---|
| 745 | |
|---|
| 746 | #define DDCMON_SYSCTL_ID 1010 |
|---|
| 747 | #define DDCMON_SYSCTL_SIZE 1011 |
|---|
| 748 | #define DDCMON_SYSCTL_SYNC 1012 |
|---|
| 749 | #define DDCMON_SYSCTL_TIMINGS 1013 |
|---|
| 750 | #define DDCMON_SYSCTL_SERIAL 1014 |
|---|
| 751 | |
|---|
| 752 | #define LM87_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 753 | #define LM87_SYSCTL_IN1 1001 |
|---|
| 754 | #define LM87_SYSCTL_IN2 1002 |
|---|
| 755 | #define LM87_SYSCTL_IN3 1003 |
|---|
| 756 | #define LM87_SYSCTL_IN4 1004 |
|---|
| 757 | #define LM87_SYSCTL_IN5 1005 |
|---|
| 758 | #define LM87_SYSCTL_FAN 1102 |
|---|
| 759 | #define LM87_SYSCTL_FRNT_TEMP 1250 /* Degrees Celcius * 100 */ |
|---|
| 760 | #define LM87_SYSCTL_CPU_TEMP 1251 /* Degrees Celcius * 100 */ |
|---|
| 761 | #define LM87_SYSCTL_INT_TEMP 1252 /* Degrees Celcius * 100 */ |
|---|
| 762 | #define LM87_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 763 | #define LM87_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 764 | #define LM87_SYSCTL_ANALOG_OUT 2002 |
|---|
| 765 | #define LM87_SYSCTL_VID 2003 |
|---|
| 766 | |
|---|
| 767 | #define LM87_ALARM_IN0 0x0001 |
|---|
| 768 | #define LM87_ALARM_IN1 0x0002 |
|---|
| 769 | #define LM87_ALARM_IN2 0x0004 |
|---|
| 770 | #define LM87_ALARM_IN3 0x0008 |
|---|
| 771 | #define LM87_ALARM_IN4 0x0100 |
|---|
| 772 | #define LM87_ALARM_IN5 0x0200 |
|---|
| 773 | #define LM87_ALARM_AMB_TEMP 0x0040 |
|---|
| 774 | #define LM87_ALARM_FAN2 0x0080 |
|---|
| 775 | #define LM87_ALARM_INT_TEMP 0x0010 |
|---|
| 776 | #define LM87_ALARM_CHAS 0x1000 |
|---|
| 777 | |
|---|
| 778 | #define PCF8574_SYSCTL_STAT 1000 |
|---|
| 779 | |
|---|
| 780 | #define MTP008_SYSCTL_IN0 1000 /* Volts * 100 */ |
|---|
| 781 | #define MTP008_SYSCTL_IN1 1001 |
|---|
| 782 | #define MTP008_SYSCTL_IN2 1002 |
|---|
| 783 | #define MTP008_SYSCTL_IN3 1003 |
|---|
| 784 | #define MTP008_SYSCTL_IN4 1004 |
|---|
| 785 | #define MTP008_SYSCTL_IN5 1005 |
|---|
| 786 | #define MTP008_SYSCTL_IN6 1006 |
|---|
| 787 | #define MTP008_SYSCTL_FAN1 1101 /* Rotations/min */ |
|---|
| 788 | #define MTP008_SYSCTL_FAN2 1102 |
|---|
| 789 | #define MTP008_SYSCTL_FAN3 1103 |
|---|
| 790 | #define MTP008_SYSCTL_TEMP1 1200 /* Degrees Celcius * 10 */ |
|---|
| 791 | #define MTP008_SYSCTL_TEMP2 1201 /* Degrees Celcius * 10 */ |
|---|
| 792 | #define MTP008_SYSCTL_TEMP3 1202 /* Degrees Celcius * 10 */ |
|---|
| 793 | #define MTP008_SYSCTL_VID 1300 /* Volts * 100 */ |
|---|
| 794 | #define MTP008_SYSCTL_PWM1 1401 |
|---|
| 795 | #define MTP008_SYSCTL_PWM2 1402 |
|---|
| 796 | #define MTP008_SYSCTL_PWM3 1403 |
|---|
| 797 | #define MTP008_SYSCTL_SENS1 1501 /* 1, 2, or Beta (3000-5000) */ |
|---|
| 798 | #define MTP008_SYSCTL_SENS2 1502 |
|---|
| 799 | #define MTP008_SYSCTL_SENS3 1503 |
|---|
| 800 | #define MTP008_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ |
|---|
| 801 | #define MTP008_SYSCTL_ALARMS 2001 /* bitvector */ |
|---|
| 802 | #define MTP008_SYSCTL_BEEP 2002 /* bitvector */ |
|---|
| 803 | |
|---|
| 804 | #define MTP008_ALARM_IN0 0x0001 |
|---|
| 805 | #define MTP008_ALARM_IN1 0x0002 |
|---|
| 806 | #define MTP008_ALARM_IN2 0x0004 |
|---|
| 807 | #define MTP008_ALARM_IN3 0x0008 |
|---|
| 808 | #define MTP008_ALARM_IN4 0x0100 |
|---|
| 809 | #define MTP008_ALARM_IN5 0x0200 |
|---|
| 810 | #define MTP008_ALARM_IN6 0x0400 |
|---|
| 811 | #define MTP008_ALARM_FAN1 0x0040 |
|---|
| 812 | #define MTP008_ALARM_FAN2 0x0080 |
|---|
| 813 | #define MTP008_ALARM_FAN3 0x0800 |
|---|
| 814 | #define MTP008_ALARM_TEMP1 0x0010 |
|---|
| 815 | #define MTP008_ALARM_TEMP2 0x0100 |
|---|
| 816 | #define MTP008_ALARM_TEMP3 0x0200 |
|---|
| 817 | |
|---|
| 818 | #endif /* def SENSORS_SENSORS_H */ |
|---|
| 819 | |
|---|