aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/via686a.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 10:24:29 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 10:24:29 -0800
commit174a86dff2f3c72ef55d994b1e7faa7099d3f844 (patch)
tree0129019c0bf7117b81afd28fc05d3a882088f385 /drivers/hwmon/via686a.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6 (diff)
parenthwmon: (dme1737) Minor cleanups (diff)
downloadlinux-dev-174a86dff2f3c72ef55d994b1e7faa7099d3f844.tar.xz
linux-dev-174a86dff2f3c72ef55d994b1e7faa7099d3f844.zip
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (dme1737) Minor cleanups hwmon: (dme1737) Add support for in7 for SCH5127 hwmon: (emc1403) Add EMC1423 support hwmon: (w83627hf) Document W83627THF voltage pin mapping hwmon: (w83793) Drop useless mutex hwmon: (fschmd) Drop useless mutex hwmon: (w83781d) Use pr_fmt and pr_<level> hwmon: (pc87427) Use pr_fmt and pr_<level> hwmon: (pc87360) Use pr_fmt and pr_<level> hwmon: (lm78) Use pr_fmt and pr_<level> hwmon: (it87) Use pr_fmt and pr_<level> hwmon: Schedule the removal of the old intrusion detection interfaces hwmon: (w83793) Implement the standard intrusion detection interface hwmon: (w83792d) Implement the standard intrusion detection interface hwmon: (adm9240) Implement the standard intrusion detection interface hwmon: (via686a) Initialize fan_div values hwmon: (w83795) Silent false warning from gcc hwmon: (ads7828) Update email contact details
Diffstat (limited to 'drivers/hwmon/via686a.c')
-rw-r--r--drivers/hwmon/via686a.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 13e8d218e495..25e91665a0a2 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -689,6 +689,13 @@ static int __devexit via686a_remove(struct platform_device *pdev)
return 0;
}
+static void via686a_update_fan_div(struct via686a_data *data)
+{
+ int reg = via686a_read_value(data, VIA686A_REG_FANDIV);
+ data->fan_div[0] = (reg >> 4) & 0x03;
+ data->fan_div[1] = reg >> 6;
+}
+
static void __devinit via686a_init_device(struct via686a_data *data)
{
u8 reg;
@@ -702,6 +709,9 @@ static void __devinit via686a_init_device(struct via686a_data *data)
via686a_write_value(data, VIA686A_REG_TEMP_MODE,
(reg & ~VIA686A_TEMP_MODE_MASK)
| VIA686A_TEMP_MODE_CONTINUOUS);
+
+ /* Pre-read fan clock divisor values */
+ via686a_update_fan_div(data);
}
static struct via686a_data *via686a_update_device(struct device *dev)
@@ -753,9 +763,7 @@ static struct via686a_data *via686a_update_device(struct device *dev)
(via686a_read_value(data, VIA686A_REG_TEMP_LOW23) &
0xc0) >> 6;
- i = via686a_read_value(data, VIA686A_REG_FANDIV);
- data->fan_div[0] = (i >> 4) & 0x03;
- data->fan_div[1] = i >> 6;
+ via686a_update_fan_div(data);
data->alarms =
via686a_read_value(data,
VIA686A_REG_ALARM1) |