#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include "lm75.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_DEVICE_TABLE (i2c, asb100_id) |
|
| show_in_reg (in) |
|
| sysfs_fan (1) |
|
| sysfs_fan (2) |
|
| sysfs_fan (3) |
|
| show_temp_reg (temp) |
|
| show_temp_reg (temp_max) |
|
| show_temp_reg (temp_hyst) |
|
| set_temp_reg (MAX, temp_max) |
|
| set_temp_reg (HYST, temp_hyst) |
|
| sysfs_temp (1) |
|
| sysfs_temp (2) |
|
| sysfs_temp (3) |
|
| sysfs_temp (4) |
|
| module_i2c_driver (asb100_driver) |
|
| MODULE_AUTHOR ("Mark M. Hoffman <[email protected]>") |
|
| MODULE_DESCRIPTION ("ASB100 Bach driver") |
|
| MODULE_LICENSE ("GPL") |
|
#define ASB100_IN_MAX 4080 |
#define ASB100_REG_ALARM1 0x41 |
#define ASB100_REG_ALARM2 0x42 |
#define ASB100_REG_BANK 0x4e |
#define ASB100_REG_CHIPID 0x49 |
#define ASB100_REG_CHIPMAN 0x4f |
#define ASB100_REG_CONFIG 0x40 |
#define ASB100_REG_FAN |
( |
|
nr | ) |
(0x28 + (nr)) |
#define ASB100_REG_FAN_MIN |
( |
|
nr | ) |
(0x3b + (nr)) |
#define ASB100_REG_I2C_ADDR 0x48 |
#define ASB100_REG_I2C_SUBADDR 0x4a |
#define ASB100_REG_IN |
( |
|
nr | ) |
(0x20 + (nr)) |
#define ASB100_REG_IN_MAX |
( |
|
nr | ) |
(0x2b + (nr * 2)) |
#define ASB100_REG_IN_MIN |
( |
|
nr | ) |
(0x2c + (nr * 2)) |
#define ASB100_REG_IRQ 0x4c |
#define ASB100_REG_PIN 0x4b |
#define ASB100_REG_PWM1 0x59 |
#define ASB100_REG_SMIM1 0x43 |
#define ASB100_REG_SMIM2 0x44 |
#define ASB100_REG_TEMP |
( |
|
nr | ) |
(asb100_reg_temp[nr]) |
#define ASB100_REG_TEMP2_CONFIG 0x0152 |
#define ASB100_REG_TEMP3_CONFIG 0x0252 |
#define ASB100_REG_TEMP_HYST |
( |
|
nr | ) |
(asb100_reg_temp_hyst[nr]) |
#define ASB100_REG_TEMP_MAX |
( |
|
nr | ) |
(asb100_reg_temp_max[nr]) |
#define ASB100_REG_VID_FANDIV 0x47 |
#define ASB100_REG_WCHIPID 0x58 |
#define ASB100_TEMP_MAX 127000 |
#define ASB100_TEMP_MIN -128000 |
#define DIV_FROM_REG |
( |
|
val | ) |
(1 << (val)) |
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
#define set_in_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:
{ \
int
err = kstrtoul(
buf, 10, &val); \
if (err) \
mutex_lock(&data->update_lock);
\
asb100_write_value(client, ASB100_REG_IN_##
REG(nr), \
mutex_unlock(&data->update_lock); \
}
#define set_temp_reg |
( |
|
REG, |
|
|
|
reg |
|
) |
| |
Value:
{ \
int
err = kstrtol(
buf, 10, &val); \
if (err) \
mutex_lock(&data->update_lock); \
switch (nr) { \
data->reg[
nr] = LM75_TEMP_TO_REG(val); \
break; \
case 0:
case 3:
default:
\
break; \
} \
asb100_write_value(client, ASB100_REG_TEMP_##
REG(nr+1), \
data->reg[nr]); \
mutex_unlock(&data->update_lock); \
}
Definition at line 443 of file asb100.c.
#define show_in_reg |
( |
|
reg | ) |
|
#define show_temp_reg |
( |
|
reg | ) |
|
Value:
{ \
return sprintf_temp_from_reg(data->reg[nr],
buf, nr); \
}
Definition at line 430 of file asb100.c.
Value:
show_fan_min, set_fan_min,
offset - 1); \
show_fan_div, set_fan_div,
offset - 1)
Definition at line 402 of file asb100.c.
Value:
show_in_min, set_in_min,
offset); \
show_in_max, set_in_max,
offset)
#define sysfs_temp |
( |
|
num | ) |
|
Value:
show_temp_max, set_temp_max, num - 1); \
show_temp_hyst, set_temp_hyst, num - 1)
Definition at line 472 of file asb100.c.
MODULE_DESCRIPTION |
( |
"ASB100 Bach driver" |
| ) |
|
MODULE_DEVICE_TABLE |
( |
i2c |
, |
|
|
asb100_id |
|
|
) |
| |
module_i2c_driver |
( |
asb100_driver |
| ) |
|
module_param_array |
( |
force_subclients |
, |
|
|
short |
, |
|
|
NULL |
, |
|
|
0 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
force_subclients |
, |
|
|
"List of subclient addresses: ""{bus, clientaddr, subclientaddr1, subclientaddr2}" |
|
|
) |
| |
set_temp_reg |
( |
MAX |
, |
|
|
temp_max |
|
|
) |
| |
set_temp_reg |
( |
HYST |
, |
|
|
temp_hyst |
|
|
) |
| |
show_temp_reg |
( |
temp_max |
| ) |
|
show_temp_reg |
( |
temp_hyst |
| ) |
|