mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-03 13:38:25 +00:00
(Kyösti)
* gl518sm document simplified for rev 0x00 & 0x80
* gl518sm & gl520sm libsensors interface updates
BTW: Revision is no longer part of the name, so old sensors.conf
will not work at all with gl518sm.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@511 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
41c6e871a4
commit
c9e71cd9df
6 files changed
+242
-99
No files matched your search
+26
-10
@@ -200,6 +200,8 @@ static void gl520_alarms(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void gl520_beep(struct i2c_client *client, int operation, int ctl_name,
|
||||
int *nrels_mag, long *results);
|
||||
static void gl520_fan1off(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
static void gl520_config(struct i2c_client *client, int operation,
|
||||
int ctl_name, int *nrels_mag, long *results);
|
||||
|
||||
@@ -247,6 +249,8 @@ static ctl_table gl520_dir_table_template[] = {
|
||||
&sensors_sysctl_real, NULL, &gl520_alarms },
|
||||
{ GL520_SYSCTL_BEEP, "beep", NULL, 0, 0644, NULL, &sensors_proc_real,
|
||||
&sensors_sysctl_real, NULL, &gl520_beep },
|
||||
{ GL520_SYSCTL_FAN1OFF, "fan1off", NULL, 0, 0644, NULL, &sensors_proc_real,
|
||||
&sensors_sysctl_real, NULL, &gl520_fan1off },
|
||||
{ GL520_SYSCTL_CONFIG, "config", NULL, 0, 0644, NULL, &sensors_proc_real,
|
||||
&sensors_sysctl_real, NULL, &gl520_config },
|
||||
{ 0 }
|
||||
@@ -742,6 +746,25 @@ void gl520_vid(struct i2c_client *client, int operation, int ctl_name,
|
||||
}
|
||||
}
|
||||
|
||||
void gl520_fan1off(struct i2c_client *client, int operation, int ctl_name,
|
||||
int *nrels_mag, long *results)
|
||||
{
|
||||
int old;
|
||||
if (operation == SENSORS_PROC_REAL_INFO)
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
results[0] = ((gl520_read_value(client, GL520_REG_MISC) & 0x04) !=0);
|
||||
*nrels_mag = 1;
|
||||
} else if (operation == SENSORS_PROC_REAL_WRITE) {
|
||||
if (*nrels_mag >= 1) {
|
||||
old = gl520_read_value(client, GL520_REG_MISC) & 0xfb;
|
||||
if (results[0])
|
||||
old |= 0x04;
|
||||
gl520_write_value(client,GL520_REG_MISC,old);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gl520_config(struct i2c_client *client, int operation, int ctl_name,
|
||||
int *nrels_mag, long *results)
|
||||
{
|
||||
@@ -749,22 +772,15 @@ void gl520_config(struct i2c_client *client, int operation, int ctl_name,
|
||||
if (operation == SENSORS_PROC_REAL_INFO)
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
results[0] = ((gl520_read_value(client, GL520_REG_CONF) & 0x10) !=0);
|
||||
results[1] = ((gl520_read_value(client, GL520_REG_MISC) & 0x08) !=0);
|
||||
*nrels_mag = 2;
|
||||
results[0] = ((gl520_read_value(client, GL520_REG_CONF) & 0x10)==0);
|
||||
*nrels_mag = 1;
|
||||
} else if (operation == SENSORS_PROC_REAL_WRITE) {
|
||||
if (*nrels_mag >= 1) {
|
||||
old = gl520_read_value(client, GL520_REG_CONF) & 0xef;
|
||||
if (results[1])
|
||||
if (! results[1])
|
||||
old |= 0x10;
|
||||
gl520_write_value(client,GL520_REG_CONF,old);
|
||||
}
|
||||
if (*nrels_mag >= 2) {
|
||||
old = gl520_read_value(client, GL520_REG_MISC) & 0xf7;
|
||||
if (results[0])
|
||||
old |= 0x08;
|
||||
gl520_write_value(client,GL520_REG_MISC,old);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,6 @@ struct sensors_chips_data {
|
||||
#define GL518_SYSCTL_FAN1 1101 /* RPM */
|
||||
#define GL518_SYSCTL_FAN2 1102
|
||||
#define GL518_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */
|
||||
#define GL518_SYSCTL_VID 1300
|
||||
#define GL518_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */
|
||||
#define GL518_SYSCTL_ALARMS 2001 /* bitvector */
|
||||
#define GL518_SYSCTL_BEEP 2002 /* bitvector */
|
||||
@@ -453,7 +452,8 @@ struct sensors_chips_data {
|
||||
#define GL520_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */
|
||||
#define GL520_SYSCTL_ALARMS 2001 /* bitvector */
|
||||
#define GL520_SYSCTL_BEEP 2002 /* bitvector */
|
||||
#define GL520_SYSCTL_CONFIG 2003
|
||||
#define GL520_SYSCTL_FAN1OFF 2003
|
||||
#define GL520_SYSCTL_CONFIG 2004
|
||||
|
||||
#define GL520_ALARM_VDD 0x01
|
||||
#define GL520_ALARM_VIN1 0x02
|
||||
|
||||
Reference in new issue
Block a user