aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/via686a.c
diff options
context:
space:
mode:
authorJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
committerJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
commita215aa7b9ab3759c047201199fba64d3042d7f13 (patch)
treebca37493d9b2233450e6d3ffced1261d0e4f71fe /drivers/hwmon/via686a.c
parentd31199a77ef606f1d06894385f1852181ba6136b (diff)
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
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 f397ce7ad598..b2074e3ba2f1 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -687,6 +687,13 @@ static int __devexit via686a_remove(struct platform_device *pdev)
687 return 0; 687 return 0;
688} 688}
689 689
690static void via686a_update_fan_div(struct via686a_data *data)
691{
692 int reg = via686a_read_value(data, VIA686A_REG_FANDIV);
693 data->fan_div[0] = (reg >> 4) & 0x03;
694 data->fan_div[1] = reg >> 6;
695}
696
690static void __devinit via686a_init_device(struct via686a_data *data) 697static void __devinit via686a_init_device(struct via686a_data *data)
691{ 698{
692 u8 reg; 699 u8 reg;
@@ -700,6 +707,9 @@ static void __devinit via686a_init_device(struct via686a_data *data)
700 via686a_write_value(data, VIA686A_REG_TEMP_MODE, 707 via686a_write_value(data, VIA686A_REG_TEMP_MODE,
701 (reg & ~VIA686A_TEMP_MODE_MASK) 708 (reg & ~VIA686A_TEMP_MODE_MASK)
702 | VIA686A_TEMP_MODE_CONTINUOUS); 709 | VIA686A_TEMP_MODE_CONTINUOUS);
710
711 /* Pre-read fan clock divisor values */
712 via686a_update_fan_div(data);
703} 713}
704 714
705static struct via686a_data *via686a_update_device(struct device *dev) 715static struct via686a_data *via686a_update_device(struct device *dev)
@@ -751,9 +761,7 @@ static struct via686a_data *via686a_update_device(struct device *dev)
751 (via686a_read_value(data, VIA686A_REG_TEMP_LOW23) & 761 (via686a_read_value(data, VIA686A_REG_TEMP_LOW23) &
752 0xc0) >> 6; 762 0xc0) >> 6;
753 763
754 i = via686a_read_value(data, VIA686A_REG_FANDIV); 764 via686a_update_fan_div(data);
755 data->fan_div[0] = (i >> 4) & 0x03;
756 data->fan_div[1] = i >> 6;
757 data->alarms = 765 data->alarms =
758 via686a_read_value(data, 766 via686a_read_value(data,
759 VIA686A_REG_ALARM1) | 767 VIA686A_REG_ALARM1) |