mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-24 20:21:43 +00:00
merge it87 separate alarms_* /proc entries to single alarms entry to standardize
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1202 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7bd97f4667
commit
e836047a83
5 files changed
+45
-105
No files matched your search
+11
-49
@@ -65,7 +65,7 @@ static unsigned int normal_isa[] = { 0x0290, SENSORS_ISA_END };
|
||||
static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
|
||||
|
||||
/* Insmod parameters */
|
||||
SENSORS_INSMOD_1(it87);
|
||||
SENSORS_INSMOD_4(it87, it8705, it8712, sis950);
|
||||
|
||||
|
||||
/* Update battery voltage after every reading if true */
|
||||
@@ -232,9 +232,7 @@ struct it87_data {
|
||||
u8 temp_low[3]; /* Register value */
|
||||
u8 fan_div[3]; /* Register encoding, shifted right */
|
||||
u8 vid; /* Register encoding, combined */
|
||||
u8 alarms_fan; /* Register value */
|
||||
u8 alarms_vin; /* Register value */
|
||||
u8 alarms_temp; /* Register value */
|
||||
u32 alarms; /* Register encoding, combined */
|
||||
};
|
||||
|
||||
|
||||
@@ -270,11 +268,7 @@ static void it87_temp(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void it87_vid(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void it87_alarms_fan(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void it87_alarms_vin(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void it87_alarms_temp(struct i2c_client *client, int operation,
|
||||
static void it87_alarms(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void it87_fan_div(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
@@ -336,12 +330,8 @@ static ctl_table it87_dir_table_template[] = {
|
||||
&i2c_sysctl_real, NULL, &it87_vid},
|
||||
{IT87_SYSCTL_FAN_DIV, "fan_div", NULL, 0, 0644, NULL, &i2c_proc_real,
|
||||
&i2c_sysctl_real, NULL, &it87_fan_div},
|
||||
{IT87_SYSCTL_ALARMS_FAN, "alarms_fan", NULL, 0, 0444, NULL, &i2c_proc_real,
|
||||
&i2c_sysctl_real, NULL, &it87_alarms_fan},
|
||||
{IT87_SYSCTL_ALARMS_VIN, "alarms_vin", NULL, 0, 0444, NULL, &i2c_proc_real,
|
||||
&i2c_sysctl_real, NULL, &it87_alarms_vin},
|
||||
{IT87_SYSCTL_ALARMS_TEMP, "alarms_temp", NULL, 0, 0444, NULL, &i2c_proc_real,
|
||||
&i2c_sysctl_real, NULL, &it87_alarms_temp},
|
||||
{IT87_SYSCTL_ALARMS, "alarms", NULL, 0, 0444, NULL, &i2c_proc_real,
|
||||
&i2c_sysctl_real, NULL, &it87_alarms},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -727,12 +717,10 @@ void it87_update_client(struct i2c_client *client)
|
||||
data->fan_div[1] = (i >> 3) & 0x07;
|
||||
data->fan_div[2] = 1;
|
||||
|
||||
data->alarms_fan =
|
||||
it87_read_value(client, IT87_REG_ALARM1) & 0x7;
|
||||
data->alarms_vin =
|
||||
it87_read_value(client, IT87_REG_ALARM2) & 0xff;
|
||||
data->alarms_temp =
|
||||
it87_read_value(client, IT87_REG_ALARM3) & 0x7;
|
||||
data->alarms =
|
||||
it87_read_value(client, IT87_REG_ALARM1) |
|
||||
(it87_read_value(client, IT87_REG_ALARM2) << 8) |
|
||||
(it87_read_value(client, IT87_REG_ALARM3) << 16);
|
||||
|
||||
data->last_updated = jiffies;
|
||||
data->valid = 1;
|
||||
@@ -855,7 +843,7 @@ void it87_vid(struct i2c_client *client, int operation, int ctl_name,
|
||||
}
|
||||
}
|
||||
|
||||
void it87_alarms_fan(struct i2c_client *client, int operation,
|
||||
void it87_alarms(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results)
|
||||
{
|
||||
struct it87_data *data = client->data;
|
||||
@@ -863,33 +851,7 @@ void it87_alarms_fan(struct i2c_client *client, int operation,
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
it87_update_client(client);
|
||||
results[0] = ALARMS_FROM_REG(data->alarms_fan);
|
||||
*nrels_mag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void it87_alarms_vin(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results)
|
||||
{
|
||||
struct it87_data *data = client->data;
|
||||
if (operation == SENSORS_PROC_REAL_INFO)
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
it87_update_client(client);
|
||||
results[0] = ALARMS_FROM_REG(data->alarms_vin);
|
||||
*nrels_mag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void it87_alarms_temp(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results)
|
||||
{
|
||||
struct it87_data *data = client->data;
|
||||
if (operation == SENSORS_PROC_REAL_INFO)
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
it87_update_client(client);
|
||||
results[0] = ALARMS_FROM_REG(data->alarms_temp);
|
||||
results[0] = ALARMS_FROM_REG(data->alarms);
|
||||
*nrels_mag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-14
@@ -487,24 +487,22 @@
|
||||
#define IT87_SYSCTL_TEMP3 1202 /* Degrees Celcius * 10 */
|
||||
#define IT87_SYSCTL_VID 1300 /* Volts * 100 */
|
||||
#define IT87_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */
|
||||
#define IT87_SYSCTL_ALARMS_FAN 2001 /* bitvector */
|
||||
#define IT87_SYSCTL_ALARMS_VIN 2002 /* bitvector */
|
||||
#define IT87_SYSCTL_ALARMS_TEMP 2003 /* bitvector */
|
||||
#define IT87_SYSCTL_ALARMS 2004 /* bitvector */
|
||||
|
||||
#define IT87_ALARM_IN0 0x0001
|
||||
#define IT87_ALARM_IN1 0x0002
|
||||
#define IT87_ALARM_IN2 0x0004
|
||||
#define IT87_ALARM_IN3 0x0008
|
||||
#define IT87_ALARM_IN4 0x0010
|
||||
#define IT87_ALARM_IN5 0x0020
|
||||
#define IT87_ALARM_IN6 0x0040
|
||||
#define IT87_ALARM_IN7 0x0080
|
||||
#define IT87_ALARM_IN0 0x000100
|
||||
#define IT87_ALARM_IN1 0x000200
|
||||
#define IT87_ALARM_IN2 0x000400
|
||||
#define IT87_ALARM_IN3 0x000800
|
||||
#define IT87_ALARM_IN4 0x001000
|
||||
#define IT87_ALARM_IN5 0x002000
|
||||
#define IT87_ALARM_IN6 0x004000
|
||||
#define IT87_ALARM_IN7 0x008000
|
||||
#define IT87_ALARM_FAN1 0x0001
|
||||
#define IT87_ALARM_FAN2 0x0002
|
||||
#define IT87_ALARM_FAN3 0x0004
|
||||
#define IT87_ALARM_TEMP1 0x0001
|
||||
#define IT87_ALARM_TEMP2 0x0002
|
||||
#define IT87_ALARM_TEMP3 0x0004
|
||||
#define IT87_ALARM_TEMP1 0x00010000
|
||||
#define IT87_ALARM_TEMP2 0x00020000
|
||||
#define IT87_ALARM_TEMP3 0x00040000
|
||||
|
||||
#define FSCPOS_SYSCTL_VOLT0 1000 /* 12 volt supply */
|
||||
#define FSCPOS_SYSCTL_VOLT1 1001 /* 5 volt supply */
|
||||
|
||||
Reference in new issue
Block a user