diff options
Diffstat (limited to 'drivers/hwmon/via686a.c')
-rw-r--r-- | drivers/hwmon/via686a.c | 14 |
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 | ||
690 | static 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 | |||
690 | static void __devinit via686a_init_device(struct via686a_data *data) | 697 | static 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 | ||
705 | static struct via686a_data *via686a_update_device(struct device *dev) | 715 | static 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) | |