]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
hwmon/w83627ehf: Enable VBAT monitoring
authorJean Delvare <khali@linux-fr.org>
Sun, 24 Jun 2007 09:20:13 +0000 (11:20 +0200)
committerMark M. Hoffman <mhoffman@lightlink.com>
Thu, 19 Jul 2007 18:22:17 +0000 (14:22 -0400)
If VBAT monitoring is disabled, enable it. Original patch from
an anonymous contributor on the lm-sensors trac system:
http://lm-sensors.org/ticket/2218

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
drivers/hwmon/w83627ehf.c

index a336793c1caf087f1d55df71b9ae91b91dc91ec9..e87fcf87a6e2d458139278194e39050e7ad0f25a 100644 (file)
@@ -1205,6 +1205,11 @@ static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data)
                                              W83627EHF_REG_TEMP_CONFIG[i],
                                              tmp & 0xfe);
        }
+
+       /* Enable VBAT monitoring if needed */
+       tmp = w83627ehf_read_value(data, W83627EHF_REG_VBAT);
+       if (!(tmp & 0x01))
+               w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01);
 }
 
 static int __devinit w83627ehf_probe(struct platform_device *pdev)