#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-vid.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.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 (reset, bool, 0) |
|
| MODULE_PARM_DESC (reset,"Set to one to force a hardware chip reset") |
|
| module_param (init, bool, 0) |
|
| MODULE_PARM_DESC (init,"Set to one to force extra software initialization") |
|
| MODULE_DEVICE_TABLE (i2c, w83791d_id) |
|
| show_in_reg (in) |
|
| 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 (w83791d_driver) |
|
| MODULE_AUTHOR ("Charles Spirakis <[email protected]>") |
|
| MODULE_DESCRIPTION ("W83791D driver") |
|
| MODULE_LICENSE ("GPL") |
|
#define BEEP_MASK_FROM_REG |
( |
|
val | ) |
((val) & 0xffffff) |
#define BEEP_MASK_TO_REG |
( |
|
val | ) |
((val) & 0xffffff) |
#define DIV_FROM_REG |
( |
|
val | ) |
(1 << (val)) |
#define FAN_FROM_REG |
( |
|
val, |
|
|
|
div |
|
) |
| |
#define FAN_UNIT_ATTRS |
( |
|
X | ) |
|
Value:&sda_fan_input[
X].dev_attr.attr, \
&sda_fan_min[
X].dev_attr.attr, \
&sda_fan_div[
X].dev_attr.attr, \
&sda_fan_beep[
X].dev_attr.attr, \
&sda_fan_alarm[
X].dev_attr.attr
Definition at line 1200 of file w83791d.c.
#define GLOBAL_BEEP_ENABLE_SHIFT 15 |
#define IN_FROM_REG |
( |
|
val | ) |
((val) * 16) |
#define IN_TO_REG |
( |
|
val | ) |
(SENSORS_LIMIT((((val) + 8) / 16), 0, 255)) |
#define IN_UNIT_ATTRS |
( |
|
X | ) |
|
Value:&sda_in_input[
X].dev_attr.attr, \
&sda_in_min[
X].dev_attr.attr, \
&sda_in_max[
X].dev_attr.attr, \
&sda_in_beep[
X].dev_attr.attr, \
&sda_in_alarm[
X].dev_attr.attr
Definition at line 1193 of file w83791d.c.
#define NUMBER_OF_FANIN 5 |
#define NUMBER_OF_TEMPIN 3 |
#define show_fan_reg |
( |
|
reg | ) |
|
Value:
to_sensor_dev_attr(
attr);
\
int
nr = sensor_attr->index; \
}
Definition at line 535 of file w83791d.c.
#define show_in_reg |
( |
|
reg | ) |
|
Value:
to_sensor_dev_attr(
attr);
\
int
nr = sensor_attr->index; \
}
Definition at line 369 of file w83791d.c.
#define store_in_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:
to_sensor_dev_attr(
attr);
\
int
nr = sensor_attr->index; \
int
err = kstrtoul(
buf, 10, &val); \
if (err) \
mutex_lock(&data->update_lock);
\
w83791d_write(client, W83791D_REG_IN_##
REG[nr], data->in_##
reg[nr]); \
mutex_unlock(&data->update_lock); \
\
}
Definition at line 384 of file w83791d.c.
#define TARGET_TEMP_TO_REG |
( |
|
val | ) |
|
#define TEMP1_FROM_REG |
( |
|
val | ) |
((val) * 1000) |
#define TEMP1_TO_REG |
( |
|
val | ) |
|
Value:((
val) <= -128000 ? -128 : \
(
val) >= 127000 ? 127 : \
(
val) < 0 ? ((
val) - 500) / 1000 : \
Definition at line 240 of file w83791d.c.
#define TEMP23_FROM_REG |
( |
|
val | ) |
((val) / 128 * 500) |
#define TEMP23_TO_REG |
( |
|
val | ) |
|
Value:((
val) <= -128000 ? 0x8000 : \
(
val) >= 127500 ? 0x7F80 : \
(
val) < 0 ? ((
val) - 250) / 500 * 128 : \
((
val) + 250) / 500 * 128)
Definition at line 252 of file w83791d.c.
#define TEMP_UNIT_ATTRS |
( |
|
X | ) |
|
Value:&sda_temp_input[
X].dev_attr.attr, \
&sda_temp_max[
X].dev_attr.attr, \
&sda_temp_max_hyst[
X].dev_attr.attr, \
&sda_temp_beep[
X].dev_attr.attr, \
&sda_temp_alarm[
X].dev_attr.attr
Definition at line 1207 of file w83791d.c.
#define TOL_TEMP_TO_REG |
( |
|
val | ) |
|
#define W83791D_REG_ALARM1 0xA9 /* realtime status register1 */ |
#define W83791D_REG_ALARM2 0xAA /* realtime status register2 */ |
#define W83791D_REG_ALARM3 0xAB /* realtime status register3 */ |
#define W83791D_REG_BANK 0x4E |
#define W83791D_REG_BEEP_CONFIG 0x4D |
#define W83791D_REG_CHIPMAN 0x4F |
#define W83791D_REG_CONFIG 0x40 |
#define W83791D_REG_DID_VID4 0x49 |
#define W83791D_REG_GPIO 0x15 |
#define W83791D_REG_I2C_ADDR 0x48 |
#define W83791D_REG_I2C_SUBADDR 0x4A |
#define W83791D_REG_PIN 0x4B |
#define W83791D_REG_TEMP2_CONFIG 0xC2 |
#define W83791D_REG_TEMP3_CONFIG 0xCA |
#define W83791D_REG_VBAT 0x5D |
#define W83791D_REG_VID_FANDIV 0x47 |
#define W83791D_REG_WCHIPID 0x58 |
MODULE_DESCRIPTION |
( |
"W83791D driver" |
| ) |
|
MODULE_DEVICE_TABLE |
( |
i2c |
, |
|
|
w83791d_id |
|
|
) |
| |
module_i2c_driver |
( |
w83791d_driver |
| ) |
|
module_param_array |
( |
force_subclients |
, |
|
|
short |
, |
|
|
NULL |
, |
|
|
0 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
force_subclients |
, |
|
|
"List of subclient addresses: ""{bus, clientaddr, subclientaddr1, subclientaddr2}" |
|
|
) |
| |