aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-05-25 14:43:32 -0400
committerJean Delvare <khali@endymion.delvare>2011-05-25 14:43:32 -0400
commit4d53811a28090b7583bb68fda294e0f009679770 (patch)
tree1b899d11a97adfec493982c866bc28d6263063fd /drivers/hwmon
parent9854f971f2f5ef0c593c8ed7c09f5f999cfeeb5d (diff)
hwmon: (f71882fg) Split has_beep in fan_has_beep and temp_has_beep
Needed for upcoming support of the F71808A. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/f71882fg.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index ca07a32447c2..16330db2bcdc 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -149,7 +149,7 @@ static const char f71882fg_has_in1_alarm[] = {
149 [f81865f] = 1, 149 [f81865f] = 1,
150}; 150};
151 151
152static const char f71882fg_has_beep[] = { 152static const char f71882fg_fan_has_beep[] = {
153 [f71808e] = 0, 153 [f71808e] = 0,
154 [f71858fg] = 0, 154 [f71858fg] = 0,
155 [f71862fg] = 1, 155 [f71862fg] = 1,
@@ -175,6 +175,19 @@ static const char f71882fg_nr_fans[] = {
175 [f81865f] = 2, 175 [f81865f] = 2,
176}; 176};
177 177
178static const char f71882fg_temp_has_beep[] = {
179 [f71808e] = 0,
180 [f71858fg] = 0,
181 [f71862fg] = 1,
182 [f71869] = 1,
183 [f71882fg] = 1,
184 [f71889fg] = 1,
185 [f71889ed] = 1,
186 [f71889a] = 1,
187 [f8000] = 0,
188 [f81865f] = 1,
189};
190
178static const char f71882fg_nr_temps[] = { 191static const char f71882fg_nr_temps[] = {
179 [f71808e] = 2, 192 [f71808e] = 2,
180 [f71858fg] = 3, 193 [f71858fg] = 3,
@@ -1146,12 +1159,13 @@ static struct f71882fg_data *f71882fg_update_device(struct device *dev)
1146 data->temp_type[3] = (reg & 0x08) ? 2 : 4; 1159 data->temp_type[3] = (reg & 0x08) ? 2 : 4;
1147 } 1160 }
1148 1161
1149 if (f71882fg_has_beep[data->type]) { 1162 if (f71882fg_fan_has_beep[data->type])
1150 data->fan_beep = f71882fg_read8(data, 1163 data->fan_beep = f71882fg_read8(data,
1151 F71882FG_REG_FAN_BEEP); 1164 F71882FG_REG_FAN_BEEP);
1165
1166 if (f71882fg_temp_has_beep[data->type])
1152 data->temp_beep = f71882fg_read8(data, 1167 data->temp_beep = f71882fg_read8(data,
1153 F71882FG_REG_TEMP_BEEP); 1168 F71882FG_REG_TEMP_BEEP);
1154 }
1155 1169
1156 data->pwm_enable = f71882fg_read8(data, 1170 data->pwm_enable = f71882fg_read8(data,
1157 F71882FG_REG_PWM_ENABLE); 1171 F71882FG_REG_PWM_ENABLE);
@@ -2140,7 +2154,7 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
2140 if (err) 2154 if (err)
2141 goto exit_unregister_sysfs; 2155 goto exit_unregister_sysfs;
2142 2156
2143 if (f71882fg_has_beep[data->type]) { 2157 if (f71882fg_temp_has_beep[data->type]) {
2144 err = f71882fg_create_sysfs_files(pdev, 2158 err = f71882fg_create_sysfs_files(pdev,
2145 &fxxxx_temp_beep_attr[0][0], 2159 &fxxxx_temp_beep_attr[0][0],
2146 ARRAY_SIZE(fxxxx_temp_beep_attr[0]) 2160 ARRAY_SIZE(fxxxx_temp_beep_attr[0])
@@ -2221,7 +2235,7 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
2221 if (err) 2235 if (err)
2222 goto exit_unregister_sysfs; 2236 goto exit_unregister_sysfs;
2223 2237
2224 if (f71882fg_has_beep[data->type]) { 2238 if (f71882fg_fan_has_beep[data->type]) {
2225 err = f71882fg_create_sysfs_files(pdev, 2239 err = f71882fg_create_sysfs_files(pdev,
2226 fxxxx_fan_beep_attr, nr_fans); 2240 fxxxx_fan_beep_attr, nr_fans);
2227 if (err) 2241 if (err)
@@ -2343,7 +2357,7 @@ static int f71882fg_remove(struct platform_device *pdev)
2343 &fxxxx_temp_attr[0][0], 2357 &fxxxx_temp_attr[0][0],
2344 ARRAY_SIZE(fxxxx_temp_attr[0]) * nr_temps); 2358 ARRAY_SIZE(fxxxx_temp_attr[0]) * nr_temps);
2345 } 2359 }
2346 if (f71882fg_has_beep[data->type]) { 2360 if (f71882fg_temp_has_beep[data->type]) {
2347 f71882fg_remove_sysfs_files(pdev, 2361 f71882fg_remove_sysfs_files(pdev,
2348 &fxxxx_temp_beep_attr[0][0], 2362 &fxxxx_temp_beep_attr[0][0],
2349 ARRAY_SIZE(fxxxx_temp_beep_attr[0]) * nr_temps); 2363 ARRAY_SIZE(fxxxx_temp_beep_attr[0]) * nr_temps);
@@ -2366,7 +2380,7 @@ static int f71882fg_remove(struct platform_device *pdev)
2366 f71882fg_remove_sysfs_files(pdev, &fxxxx_fan_attr[0][0], 2380 f71882fg_remove_sysfs_files(pdev, &fxxxx_fan_attr[0][0],
2367 ARRAY_SIZE(fxxxx_fan_attr[0]) * nr_fans); 2381 ARRAY_SIZE(fxxxx_fan_attr[0]) * nr_fans);
2368 2382
2369 if (f71882fg_has_beep[data->type]) { 2383 if (f71882fg_fan_has_beep[data->type]) {
2370 f71882fg_remove_sysfs_files(pdev, 2384 f71882fg_remove_sysfs_files(pdev,
2371 fxxxx_fan_beep_attr, nr_fans); 2385 fxxxx_fan_beep_attr, nr_fans);
2372 } 2386 }