#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.
#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
Definition at line 592 of file w83l786ng.c.
#define IN_FROM_REG |
( |
|
val | ) |
((val) * 8) |
#define IN_TO_REG |
( |
|
val | ) |
(SENSORS_LIMIT((((val) + 4) / 8), 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
Definition at line 587 of file w83l786ng.c.
#define PWM_UNIT_ATTRS |
( |
|
X | ) |
|
Value:&sda_pwm[
X].dev_attr.attr, \
&sda_pwm_mode[
X].dev_attr.attr, \
&sda_pwm_enable[
X].dev_attr.attr
Definition at line 602 of file w83l786ng.c.
#define show_fan_reg |
( |
|
reg | ) |
|
#define show_in_reg |
( |
|
reg | ) |
|
#define show_pwm_reg |
( |
|
reg | ) |
|
#define store_in_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:static ssize_t \
{ \
int
err = kstrtoul(
buf, 10, &val); \
if (err) \
mutex_lock(&data->update_lock);
\
w83l786ng_write_value(client, W83L786NG_REG_IN_##
REG(nr), \
mutex_unlock(&data->update_lock); \
}
#define TEMP_FROM_REG |
( |
|
val | ) |
|
#define TEMP_TO_REG |
( |
|
val | ) |
|
Value:(SENSORS_LIMIT(((
val) < 0 ? \
: (
val)) / 1000, 0, 0xff))
Definition at line 98 of file w83l786ng.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
Definition at line 597 of file w83l786ng.c.
#define W83L786NG_REG_ALARM1 0x41 |
#define W83L786NG_REG_ALARM2 0x42 |
#define W83L786NG_REG_CHIP_ID 0x4E |
#define W83L786NG_REG_CONFIG 0x40 |
#define W83L786NG_REG_DIODE 0x53 |
#define W83L786NG_REG_FAN |
( |
|
nr | ) |
((nr) + 0x28) |
#define W83L786NG_REG_FAN_CFG 0x80 |
#define W83L786NG_REG_FAN_DIV 0x54 |
#define W83L786NG_REG_FAN_MIN |
( |
|
nr | ) |
((nr) + 0x3B) |
#define W83L786NG_REG_GPIO_EN 0x47 |
#define W83L786NG_REG_IN |
( |
|
nr | ) |
((nr) + 0x20) |
#define W83L786NG_REG_IN_MAX |
( |
|
nr | ) |
(0x2B + (nr) * 2) |
#define W83L786NG_REG_IN_MIN |
( |
|
nr | ) |
(0x2C + (nr) * 2) |
#define W83L786NG_REG_MAN_ID1 0x4D |
#define W83L786NG_REG_MAN_ID2 0x4C |
#define W83L786NG_REG_TOLERANCE 0x8D |
MODULE_AUTHOR |
( |
"Kevin Lo" |
| ) |
|
MODULE_DESCRIPTION |
( |
"w83l786ng driver" |
| ) |
|
MODULE_DEVICE_TABLE |
( |
i2c |
, |
|
|
w83l786ng_id |
|
|
) |
| |
module_i2c_driver |
( |
w83l786ng_driver |
| ) |
|
MODULE_PARM_DESC |
( |
reset |
, |
|
|
"Set to 1 to reset |
chip, |
|
|
not recommended" |
|
|
) |
| |
show_pwm_reg |
( |
pwm_mode |
| ) |
|