aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/f71882fg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index 0ef7265336b..a6dc3c7787f 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -1711,7 +1711,7 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
1711{ 1711{
1712 struct f71882fg_data *data; 1712 struct f71882fg_data *data;
1713 struct f71882fg_sio_data *sio_data = pdev->dev.platform_data; 1713 struct f71882fg_sio_data *sio_data = pdev->dev.platform_data;
1714 int err; 1714 int err, i, nr_fans = (sio_data->type == f71882fg) ? 4 : 3;
1715 u8 start_reg; 1715 u8 start_reg;
1716 1716
1717 data = kzalloc(sizeof(struct f71882fg_data), GFP_KERNEL); 1717 data = kzalloc(sizeof(struct f71882fg_data), GFP_KERNEL);
@@ -1735,14 +1735,14 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
1735 goto exit_free; 1735 goto exit_free;
1736 } 1736 }
1737 1737
1738 data->pwm_enable = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE);
1738 /* If it is a 71862 and the fan / pwm part is enabled sanity check 1739 /* If it is a 71862 and the fan / pwm part is enabled sanity check
1739 the pwm settings */ 1740 the pwm settings */
1740 if (data->type == f71862fg && (start_reg & 0x02)) { 1741 if (data->type == f71862fg && (start_reg & 0x02)) {
1741 u8 reg = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE); 1742 if ((data->pwm_enable & 0x15) != 0x15) {
1742 if ((reg & 0x15) != 0x15) {
1743 dev_err(&pdev->dev, 1743 dev_err(&pdev->dev,
1744 "Invalid (reserved) pwm settings: 0x%02x\n", 1744 "Invalid (reserved) pwm settings: 0x%02x\n",
1745 (unsigned int)reg); 1745 (unsigned int)data->pwm_enable);
1746 err = -ENODEV; 1746 err = -ENODEV;
1747 goto exit_free; 1747 goto exit_free;
1748 } 1748 }
@@ -1802,6 +1802,11 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
1802 } 1802 }
1803 if (err) 1803 if (err)
1804 goto exit_unregister_sysfs; 1804 goto exit_unregister_sysfs;
1805
1806 for (i = 0; i < nr_fans; i++)
1807 dev_info(&pdev->dev, "Fan: %d is in %s mode\n", i + 1,
1808 (data->pwm_enable & (1 << 2 * i)) ?
1809 "duty-cycle" : "RPM");
1805 } 1810 }
1806 1811
1807 data->hwmon_dev = hwmon_device_register(&pdev->dev); 1812 data->hwmon_dev = hwmon_device_register(&pdev->dev);