From 488b99274d4b4e7c072fc31628739a716318460c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 23 May 2004 17:35:37 +0000 Subject: [PATCH] pc87360 fan clock dividers are now read-only. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2562 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/pc87360.c | 26 ++------------------------ lib/chips.c | 12 ++++++------ lib/chips.h | 6 +++--- 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/kernel/chips/pc87360.c b/kernel/chips/pc87360.c index 570a7870..c0bfc802 100644 --- a/kernel/chips/pc87360.c +++ b/kernel/chips/pc87360.c @@ -646,13 +646,10 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, #endif } - /* Fan clock dividers and fan low limits may be needed before any - data is read */ + /* Fan clock dividers may be needed before any data is read */ for (i = 0; i < data->fannr; i++) { data->fan_status[i] = pc87360_read_value(data, LD_FAN, NO_BANK, PC87360_REG_FAN_STATUS(i)); - data->fan_min[i] = pc87360_read_value(data, LD_FAN, - NO_BANK, PC87360_REG_FAN_MIN(i)); } if (init > 0) { @@ -1063,7 +1060,7 @@ void pc87360_fan_div(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results) { struct pc87360_data *data = client->data; - int i, nr; + int i; if (operation == SENSORS_PROC_REAL_INFO) *nrels_mag = 0; @@ -1074,25 +1071,6 @@ void pc87360_fan_div(struct i2c_client *client, int operation, } *nrels_mag = data->fannr; } - /* We ignore National's recommendation */ - else if (operation == SENSORS_PROC_REAL_WRITE) { - nr = data->fannr <= *nrels_mag ? data->fannr : *nrels_mag; - for (i = 0; i < nr; i++) { - /* Preserve fan min */ - int fan_min = FAN_FROM_REG(data->fan_min[i], - FAN_DIV_FROM_REG(data->fan_status[i])); - data->fan_status[i] = (data->fan_status[i] & 0x9F) - | FAN_DIV_TO_REG(results[i]); - pc87360_write_value(data, LD_FAN, NO_BANK, - PC87360_REG_FAN_STATUS(i), - data->fan_status[i]); - data->fan_min[i] = FAN_TO_REG(fan_min, - FAN_DIV_FROM_REG(data->fan_status[i])); - pc87360_write_value(data, LD_FAN, NO_BANK, - PC87360_REG_FAN_MIN(i), - data->fan_min[i]); - } - } } void pc87360_pwm(struct i2c_client *client, int operation, int ctl_name, diff --git a/lib/chips.c b/lib/chips.c index b34f152b..8f8227c9 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -4269,11 +4269,11 @@ static sensors_chip_feature pc87360_features[] = SENSORS_PC87360_FAN3, RW, PC87360_SYSCTL_FAN3, VALUE(1), 0 }, { SENSORS_PC87360_FAN1_DIV, "fan1_div", SENSORS_PC87360_FAN1, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(1), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_DIV, "fan2_div", SENSORS_PC87360_FAN2, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(2), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(2), 0 }, { SENSORS_PC87360_FAN3_DIV, "fan3_div", SENSORS_PC87360_FAN3, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(3), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(3), 0 }, { SENSORS_PC87360_FAN1_STATUS, "fan1_status", SENSORS_PC87360_FAN1, NOMAP, R, PC87360_SYSCTL_FAN1_STATUS, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_STATUS, "fan2_status", SENSORS_PC87360_FAN2, @@ -4305,11 +4305,11 @@ static sensors_chip_feature pc87365_features[] = SENSORS_PC87360_FAN3, RW, PC87360_SYSCTL_FAN3, VALUE(1), 0 }, { SENSORS_PC87360_FAN1_DIV, "fan1_div", SENSORS_PC87360_FAN1, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(1), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_DIV, "fan2_div", SENSORS_PC87360_FAN2, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(2), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(2), 0 }, { SENSORS_PC87360_FAN3_DIV, "fan3_div", SENSORS_PC87360_FAN3, - NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(3), 0 }, + NOMAP, R, PC87360_SYSCTL_FAN_DIV, VALUE(3), 0 }, { SENSORS_PC87360_FAN1_STATUS, "fan1_status", SENSORS_PC87360_FAN1, NOMAP, R, PC87360_SYSCTL_FAN1_STATUS, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_STATUS, "fan2_status", SENSORS_PC87360_FAN2, diff --git a/lib/chips.h b/lib/chips.h index 6eeb36d6..a36bd4a5 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1634,9 +1634,9 @@ #define SENSORS_PC87360_FAN1_MIN 41 /* RW */ #define SENSORS_PC87360_FAN2_MIN 42 /* RW */ #define SENSORS_PC87360_FAN3_MIN 43 /* RW */ -#define SENSORS_PC87360_FAN1_DIV 71 /* RW */ -#define SENSORS_PC87360_FAN2_DIV 72 /* RW */ -#define SENSORS_PC87360_FAN3_DIV 73 /* RW */ +#define SENSORS_PC87360_FAN1_DIV 71 /* R */ +#define SENSORS_PC87360_FAN2_DIV 72 /* R */ +#define SENSORS_PC87360_FAN3_DIV 73 /* R */ #define SENSORS_PC87360_FAN1_STATUS 81 /* R */ #define SENSORS_PC87360_FAN2_STATUS 82 /* R */ #define SENSORS_PC87360_FAN3_STATUS 83 /* R */