aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/f71882fg.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-01-07 10:37:30 -0500
committerJean Delvare <khali@linux-fr.org>2009-01-07 10:37:30 -0500
commit4c82c38ae29a01338b5104b0111cecefaf3a1025 (patch)
tree79136a154f18208209a3b4363aaf9ca04eede9b8 /drivers/hwmon/f71882fg.c
parent754a5907b01687089382e362753dcceaca58ee66 (diff)
hwmon: (f71882fg) Remove the fan_mode module option
Remove the fan_mode module option it was a monstrosity to begin with, and when adding support for the F8000 it becomes a real pain! Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/f71882fg.c')
-rw-r--r--drivers/hwmon/f71882fg.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index 95a279f70264..842592fe5aa9 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -90,12 +90,6 @@ static unsigned short force_id;
90module_param(force_id, ushort, 0); 90module_param(force_id, ushort, 0);
91MODULE_PARM_DESC(force_id, "Override the detected device ID"); 91MODULE_PARM_DESC(force_id, "Override the detected device ID");
92 92
93static int fan_mode[4] = { 0, 0, 0, 0 };
94module_param_array(fan_mode, int, NULL, 0644);
95MODULE_PARM_DESC(fan_mode, "List of fan control modes (f71882fg only) "
96 "(0=don't change, 1=pwm, 2=rpm)\n"
97 "Note: this needs a write to pwm#_enable to take effect");
98
99enum chips { f71862fg, f71882fg }; 93enum chips { f71862fg, f71882fg };
100 94
101static const char *f71882fg_names[] = { 95static const char *f71882fg_names[] = {
@@ -846,15 +840,8 @@ static ssize_t store_fan_full_speed(struct device *dev,
846 val = fan_to_reg(val); 840 val = fan_to_reg(val);
847 841
848 mutex_lock(&data->update_lock); 842 mutex_lock(&data->update_lock);
849 data->pwm_enable = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE); 843 f71882fg_write16(data, F71882FG_REG_FAN_FULL_SPEED(nr), val);
850 if (data->pwm_enable & (1 << (2 * nr))) 844 data->fan_full_speed[nr] = val;
851 /* PWM mode */
852 count = -EINVAL;
853 else {
854 /* RPM mode */
855 f71882fg_write16(data, F71882FG_REG_FAN_FULL_SPEED(nr), val);
856 data->fan_full_speed[nr] = val;
857 }
858 mutex_unlock(&data->update_lock); 845 mutex_unlock(&data->update_lock);
859 846
860 return count; 847 return count;
@@ -1252,16 +1239,6 @@ static ssize_t store_pwm_enable(struct device *dev, struct device_attribute
1252 data->pwm_enable &= ~(2 << (2 * nr)); 1239 data->pwm_enable &= ~(2 << (2 * nr));
1253 break; /* Temperature ctrl */ 1240 break; /* Temperature ctrl */
1254 } 1241 }
1255 if (data->type == f71882fg) {
1256 switch (fan_mode[nr]) {
1257 case 1:
1258 data->pwm_enable |= 1 << (2 * nr);
1259 break; /* Duty cycle mode */
1260 case 2:
1261 data->pwm_enable &= ~(1 << (2 * nr));
1262 break; /* RPM mode */
1263 }
1264 }
1265 f71882fg_write8(data, F71882FG_REG_PWM_ENABLE, data->pwm_enable); 1242 f71882fg_write8(data, F71882FG_REG_PWM_ENABLE, data->pwm_enable);
1266 mutex_unlock(&data->update_lock); 1243 mutex_unlock(&data->update_lock);
1267 1244