#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/acpi.h>
#include <linux/io.h>
#include "lm75.h"
Go to the source code of this file.
|
| | module_param (force_id, ushort, 0) |
| |
| | MODULE_PARM_DESC (force_id,"Override the detected device ID") |
| |
| | module_param (fan_debounce, ushort, 0) |
| |
| | MODULE_PARM_DESC (fan_debounce,"Enable debouncing for fan RPM signal") |
| |
| | show_in_reg (in) |
| |
| | show_temp_reg (reg_temp, temp) |
| |
| | show_temp_reg (reg_temp_over, temp_max) |
| |
| | show_temp_reg (reg_temp_hyst, temp_max_hyst) |
| |
| | store_temp_reg (reg_temp_over, temp_max) |
| |
| | store_temp_reg (reg_temp_hyst, temp_max_hyst) |
| |
| | show_pwm_reg (pwm_mode) |
| |
| | show_tol_temp (tolerance) |
| |
| | fan_functions (fan_start_output, FAN_START_OUTPUT) |
| |
| | MODULE_AUTHOR ("Jean Delvare <[email protected]>") |
| |
| | MODULE_DESCRIPTION ("W83627EHF driver") |
| |
| | MODULE_LICENSE ("GPL") |
| |
| | module_init (sensors_w83627ehf_init) |
| |
| | module_exit (sensors_w83627ehf_exit) |
| |
| #define ADDR_REG_OFFSET 0 |
| #define DATA_REG_OFFSET 1 |
| #define DRVNAME "w83627ehf" |
| #define fan_functions |
( |
|
reg, |
|
|
|
REG |
|
) |
| |
Value:
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
} \
static ssize_t \
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
err = kstrtoul(
buf, 10, &val); \
if (err < 0) \
val = SENSORS_LIMIT(val, 1, 255); \
mutex_lock(&data->update_lock);
\
w83627ehf_write_value(data, data->REG_##
REG[nr], val); \
mutex_unlock(&data->update_lock); \
}
Definition at line 1610 of file w83627ehf.c.
| #define fan_time_functions |
( |
|
reg, |
|
|
|
REG |
|
) |
| |
| #define IOREGION_ALIGNMENT (~7) |
| #define IOREGION_LENGTH 2 |
| #define IOREGION_OFFSET 5 |
| #define NCT6775_REG_FAN_DEBOUNCE 0xf0 |
| #define NCT6775_REG_FANDIV1 0x506 |
| #define NCT6775_REG_FANDIV2 0x507 |
| #define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
| #define show_in_reg |
( |
|
reg | ) |
|
Value:static ssize_t \
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
return
sprintf(
buf,
"%ld\n", in_from_reg(data->reg[nr], nr, \
data->scale_in)); \
}
Definition at line 928 of file w83627ehf.c.
| #define show_pwm_reg |
( |
|
reg | ) |
|
Value:
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
}
Definition at line 1366 of file w83627ehf.c.
| #define show_temp_reg |
( |
|
addr, |
|
|
|
reg |
|
) |
| |
Value:static ssize_t \
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
return
sprintf(
buf,
"%d\n", LM75_TEMP_FROM_REG(data->reg[nr])); \
}
Definition at line 1199 of file w83627ehf.c.
| #define show_tol_temp |
( |
|
reg | ) |
|
Value:
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
return
sprintf(
buf,
"%d\n", data->reg[nr] * 1000); \
}
Definition at line 1480 of file w83627ehf.c.
| #define SIO_ID_MASK 0xFFF0 |
| #define SIO_NCT6775_ID 0xb470 |
| #define SIO_NCT6776_ID 0xc330 |
| #define SIO_REG_ADDR 0x60 /* Logical device address (2 bytes) */ |
| #define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */ |
| #define SIO_REG_EN_VRM10 0x2C /* GPIO3, GPIO4 selection */ |
| #define SIO_REG_ENABLE 0x30 /* Logical device enable */ |
| #define SIO_REG_LDSEL 0x07 /* Logical device select */ |
| #define SIO_REG_VID_CTRL 0xF0 /* VID control */ |
| #define SIO_REG_VID_DATA 0xF1 /* VID data */ |
| #define SIO_W83627DHG_ID 0xa020 |
| #define SIO_W83627DHG_P_ID 0xb070 |
| #define SIO_W83627EHF_ID 0x8850 |
| #define SIO_W83627EHG_ID 0x8860 |
| #define SIO_W83627UHG_ID 0xa230 |
| #define SIO_W83667HG_B_ID 0xb350 |
| #define SIO_W83667HG_ID 0xa510 |
| #define store_in_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:static ssize_t \
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
err = kstrtoul(
buf, 10, &val); \
if (err < 0) \
mutex_lock(&data->update_lock);
\
data->in_##
reg[
nr] = in_to_reg(val, nr, data->scale_in); \
w83627ehf_write_value(data, W83627EHF_REG_IN_##
REG(nr), \
mutex_unlock(&data->update_lock); \
}
| #define store_temp_reg |
( |
|
addr, |
|
|
|
reg |
|
) |
| |
Value:static ssize_t \
to_sensor_dev_attr(
attr); \
int
nr = sensor_attr->index; \
err = kstrtol(
buf, 10, &val); \
if (err < 0) \
mutex_lock(&data->update_lock);
\
data->reg[
nr] = LM75_TEMP_TO_REG(val); \
w83627ehf_write_temp(data, data->addr[nr], data->reg[nr]); \
mutex_unlock(&data->update_lock); \
}
Definition at line 1214 of file w83627ehf.c.
| #define W83627EHF_LD_HWM 0x0b |
| #define W83627EHF_REG_ALARM1 0x459 |
| #define W83627EHF_REG_ALARM2 0x45A |
| #define W83627EHF_REG_ALARM3 0x45B |
| #define W83627EHF_REG_BANK 0x4E |
| #define W83627EHF_REG_CASEOPEN_CLR 0x46 /* SMI MASK #3 */ |
| #define W83627EHF_REG_CASEOPEN_DET 0x42 /* SMI STATUS #2 */ |
| #define W83627EHF_REG_CONFIG 0x40 |
| #define W83627EHF_REG_DIODE 0x59 |
| #define W83627EHF_REG_FAN_STEPDOWN_TIME 0x0e |
| #define W83627EHF_REG_FAN_STEPUP_TIME 0x0f |
| #define W83627EHF_REG_FANDIV1 0x47 |
| #define W83627EHF_REG_FANDIV2 0x4B |
| #define W83627EHF_REG_IN |
( |
|
nr | ) |
|
| #define W83627EHF_REG_IN_MAX |
( |
|
nr | ) |
|
Value:((
nr < 7) ? (0x2b + (
nr) * 2) : \
(0x554 + (((
nr) - 7) * 2)))
Definition at line 178 of file w83627ehf.c.
| #define W83627EHF_REG_IN_MIN |
( |
|
nr | ) |
|
Value:((
nr < 7) ? (0x2c + (
nr) * 2) : \
(0x555 + (((
nr) - 7) * 2)))
Definition at line 180 of file w83627ehf.c.
| #define W83627EHF_REG_SMI_OVT 0x4C |
| #define W83627EHF_REG_VBAT 0x5D |
| #define W83667HG_LD_VID 0x0d |
- Enumerator:
| f71805f |
|
| f71872f |
|
| w83627ehf |
|
| w83627dhg |
|
| w83627dhg_p |
|
| w83627uhg |
|
| w83667hg |
|
| w83667hg_b |
|
| nct6775 |
|
| nct6776 |
|
Definition at line 64 of file w83627ehf.c.
| fan_functions |
( |
fan_start_output |
, |
|
|
FAN_START_OUTPUT |
|
|
) |
| |
| MODULE_DESCRIPTION |
( |
"W83627EHF driver" |
| ) |
|
| module_exit |
( |
sensors_w83627ehf_exit |
| ) |
|
| module_init |
( |
sensors_w83627ehf_init |
| ) |
|
| module_param |
( |
force_id |
, |
|
|
ushort |
, |
|
|
0 |
|
|
) |
| |
| module_param |
( |
fan_debounce |
, |
|
|
ushort |
, |
|
|
0 |
|
|
) |
| |
| MODULE_PARM_DESC |
( |
force_id |
, |
|
|
"Override the detected device ID" |
|
|
) |
| |
| MODULE_PARM_DESC |
( |
fan_debounce |
, |
|
|
"Enable debouncing for fan RPM signal" |
|
|
) |
| |
| show_pwm_reg |
( |
pwm_mode |
| ) |
|
| show_temp_reg |
( |
reg_temp |
, |
|
|
temp |
|
|
) |
| |
| show_temp_reg |
( |
reg_temp_over |
, |
|
|
temp_max |
|
|
) |
| |
| show_temp_reg |
( |
reg_temp_hyst |
, |
|
|
temp_max_hyst |
|
|
) |
| |
| show_tol_temp |
( |
tolerance |
| ) |
|
| store_temp_reg |
( |
reg_temp_over |
, |
|
|
temp_max |
|
|
) |
| |
| store_temp_reg |
( |
reg_temp_hyst |
, |
|
|
temp_max_hyst |
|
|
) |
| |