#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/jiffies.h>
Go to the source code of this file.
|
| module_param_array (force_subclients, short, NULL, 0) |
|
| MODULE_PARM_DESC (force_subclients,"List of subclient addresses: ""{bus, clientaddr, subclientaddr1, subclientaddr2}") |
|
| module_param (init, bool, 0) |
|
| MODULE_PARM_DESC (init,"Set to one to force chip initialization") |
|
| MODULE_DEVICE_TABLE (i2c, w83792d_id) |
|
| show_in_reg (in_min) |
|
| show_in_reg (in_max) |
|
| store_in_reg (MIN, min) |
|
| store_in_reg (MAX, max) |
|
| show_fan_reg (fan) |
|
| show_fan_reg (fan_min) |
|
| module_i2c_driver (w83792d_driver) |
|
| MODULE_AUTHOR ("Chunhao Huang @ Winbond <[email protected]>") |
|
| MODULE_DESCRIPTION ("W83792AD/D driver for linux-2.6") |
|
| MODULE_LICENSE ("GPL") |
|
#define DIV_FROM_REG |
( |
|
val | ) |
(1 << (val)) |
#define FAN_FROM_REG |
( |
|
val, |
|
|
|
div |
|
) |
| |
#define IN_FROM_REG |
( |
|
nr, |
|
|
|
val |
|
) |
| |
Value:(((
nr) <= 1) ? ((
val) * 2) : \
((((
nr) == 6) || ((
nr) == 7)) ? ((
val) * 6) : ((
val) * 4)))
Definition at line 228 of file w83792d.c.
#define IN_TO_REG |
( |
|
nr, |
|
|
|
val |
|
) |
| |
Value:(((
nr) <= 1) ? ((
val) / 2) : \
((((
nr) == 6) || ((
nr) == 7)) ? ((
val) / 6) : ((
val) / 4)))
Definition at line 230 of file w83792d.c.
#define show_fan_reg |
( |
|
reg | ) |
|
Value:
int
nr = sensor_attr->index - 1;
\
}
Definition at line 410 of file w83792d.c.
#define show_in_reg |
( |
|
reg | ) |
|
Value:
int
nr = sensor_attr->index;
\
}
Definition at line 370 of file w83792d.c.
#define store_in_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:
int
nr = sensor_attr->index;
\
int
err = kstrtoul(
buf, 10, &val); \
if (err) \
mutex_lock(&data->update_lock);
\
w83792d_write_value(client, W83792D_REG_IN_##
REG[nr], \
mutex_unlock(&data->update_lock); \
\
}
Definition at line 385 of file w83792d.c.
#define TEMP1_FROM_REG |
( |
|
val | ) |
(((val) & 0x80 ? (val)-0x100 : (val)) * 1000) |
#define TEMP1_TO_REG |
( |
|
val | ) |
|
Value:(SENSORS_LIMIT(((
val) < 0 ? (
val)+0x100*1000 \
: (
val)) / 1000, 0, 0xff))
Definition at line 247 of file w83792d.c.
#define TEMP_ADD_FROM_REG |
( |
|
val1, |
|
|
|
val2 |
|
) |
| |
Value:((((val1) & 0x80 ? (val1)-0x100 \
: (val1)) * 1000) + ((val2 & 0x80) ? 500 : 0))
Definition at line 251 of file w83792d.c.
#define TEMP_ADD_TO_REG_HIGH |
( |
|
val | ) |
|
Value:(SENSORS_LIMIT(((
val) < 0 ? (
val)+0x100*1000 \
: (
val)) / 1000, 0, 0xff))
Definition at line 254 of file w83792d.c.
#define TEMP_ADD_TO_REG_LOW |
( |
|
val | ) |
((val%1000) ? 0x80 : 0x00) |
#define W83792D_REG_ALARM1 0xA9 /* realtime status register1 */ |
#define W83792D_REG_ALARM2 0xAA /* realtime status register2 */ |
#define W83792D_REG_ALARM3 0xAB /* realtime status register3 */ |
#define W83792D_REG_BANK 0x4E |
#define W83792D_REG_CHASSIS 0x42 /* Bit 5: Case Open status bit */ |
#define W83792D_REG_CHASSIS_CLR 0x44 /* Bit 7: Case Open CLR_CHS/Reset bit */ |
#define W83792D_REG_CHIPID 0x49 |
#define W83792D_REG_CHIPMAN 0x4F |
#define W83792D_REG_CONFIG 0x40 |
#define W83792D_REG_FAN_CFG 0x84 /* FAN Configuration in DataSheet */ |
#define W83792D_REG_GPIO_EN 0x1A |
#define W83792D_REG_I2C_ADDR 0x48 |
#define W83792D_REG_I2C_SUBADDR 0x4A |
#define W83792D_REG_LOW_BITS1 0x3E /* Low Bits I in DataSheet */ |
#define W83792D_REG_LOW_BITS2 0x3F /* Low Bits II in DataSheet */ |
#define W83792D_REG_PIN 0x4B |
#define W83792D_REG_TEMP2_CONFIG 0xC2 |
#define W83792D_REG_TEMP3_CONFIG 0xCA |
#define W83792D_REG_VBAT 0x5D |
#define W83792D_REG_VID_FANDIV 0x47 |
#define W83792D_REG_VID_IN_B 0x17 |
#define W83792D_REG_WCHIPID 0x58 |
MODULE_DESCRIPTION |
( |
"W83792AD/D driver for linux-2.6" |
| ) |
|
MODULE_DEVICE_TABLE |
( |
i2c |
, |
|
|
w83792d_id |
|
|
) |
| |
module_i2c_driver |
( |
w83792d_driver |
| ) |
|
module_param_array |
( |
force_subclients |
, |
|
|
short |
, |
|
|
NULL |
, |
|
|
0 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
force_subclients |
, |
|
|
"List of subclient addresses: ""{bus, clientaddr, subclientaddr1, subclientaddr2}" |
|
|
) |
| |