aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-10-28 14:31:49 -0400
committerJean Delvare <khali@endymion.delvare>2010-10-28 14:31:49 -0400
commit00030af23153f1958f015df8b9fec8c29fcca8b8 (patch)
tree32ea0e1f4e7e5a37c89b286bef76aebae6c3e17c /drivers
parente3760b432d589ddd9bdb8c337539b815125bc7aa (diff)
hwmon: (w83795) Exclude fan control feature by default
The fan control feature of the w83795 driver is insufficiently reviewed and tested for public consumption at this time, so make it optional and disabled by default. We will change the default when review and testing is deemed sufficient. Ultimately the option will go away. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/Kconfig17
-rw-r--r--drivers/hwmon/w83795.c10
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index d229f4592845..a06ac97229d9 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1041,6 +1041,23 @@ config SENSORS_W83795
1041 This driver can also be built as a module. If so, the module 1041 This driver can also be built as a module. If so, the module
1042 will be called w83795. 1042 will be called w83795.
1043 1043
1044config SENSORS_W83795_FANCTRL
1045 boolean "Include fan control support (DANGEROUS)"
1046 depends on SENSORS_W83795 && EXPERIMENTAL
1047 default n
1048 help
1049 If you say yes here, support for the both manual and automatic
1050 fan control features will be included in the driver.
1051
1052 This part of the code wasn't carefully reviewed and tested yet,
1053 so enabling this option is strongly discouraged on production
1054 servers. Only developers and testers should enable it for the
1055 time being.
1056
1057 Please also note that this option will create sysfs attribute
1058 files which may change in the future, so you shouldn't rely
1059 on them being stable.
1060
1044config SENSORS_W83L785TS 1061config SENSORS_W83L785TS
1045 tristate "Winbond W83L785TS-S" 1062 tristate "Winbond W83L785TS-S"
1046 depends on I2C && EXPERIMENTAL 1063 depends on I2C && EXPERIMENTAL
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c
index a9116ad747f2..c461e753f9bf 100644
--- a/drivers/hwmon/w83795.c
+++ b/drivers/hwmon/w83795.c
@@ -1455,6 +1455,7 @@ store_in(struct device *dev, struct device_attribute *attr,
1455} 1455}
1456 1456
1457 1457
1458#ifdef CONFIG_SENSORS_W83795_FANCTRL
1458static ssize_t 1459static ssize_t
1459show_sf_setup(struct device *dev, struct device_attribute *attr, char *buf) 1460show_sf_setup(struct device *dev, struct device_attribute *attr, char *buf)
1460{ 1461{
@@ -1506,6 +1507,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,
1506 mutex_unlock(&data->update_lock); 1507 mutex_unlock(&data->update_lock);
1507 return count; 1508 return count;
1508} 1509}
1510#endif
1509 1511
1510 1512
1511#define NOT_USED -1 1513#define NOT_USED -1
@@ -1711,6 +1713,7 @@ static const struct sensor_device_attribute_2 sda_single_files[] = {
1711 store_chassis_clear, ALARM_STATUS, 46), 1713 store_chassis_clear, ALARM_STATUS, 46),
1712 SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep, 1714 SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep,
1713 store_beep, BEEP_ENABLE, 47), 1715 store_beep, BEEP_ENABLE, 47),
1716#ifdef CONFIG_SENSORS_W83795_FANCTRL
1714 SENSOR_ATTR_2(speed_cruise_tolerance, S_IWUSR | S_IRUGO, show_fanin, 1717 SENSOR_ATTR_2(speed_cruise_tolerance, S_IWUSR | S_IRUGO, show_fanin,
1715 store_fanin, FANIN_TOL, NOT_USED), 1718 store_fanin, FANIN_TOL, NOT_USED),
1716 SENSOR_ATTR_2(pwm_default, S_IWUSR | S_IRUGO, show_sf_setup, 1719 SENSOR_ATTR_2(pwm_default, S_IWUSR | S_IRUGO, show_sf_setup,
@@ -1719,6 +1722,7 @@ static const struct sensor_device_attribute_2 sda_single_files[] = {
1719 store_sf_setup, SETUP_PWM_UPTIME, NOT_USED), 1722 store_sf_setup, SETUP_PWM_UPTIME, NOT_USED),
1720 SENSOR_ATTR_2(pwm_downtime, S_IWUSR | S_IRUGO, show_sf_setup, 1723 SENSOR_ATTR_2(pwm_downtime, S_IWUSR | S_IRUGO, show_sf_setup,
1721 store_sf_setup, SETUP_PWM_DOWNTIME, NOT_USED), 1724 store_sf_setup, SETUP_PWM_DOWNTIME, NOT_USED),
1725#endif
1722}; 1726};
1723 1727
1724/* 1728/*
@@ -1872,6 +1876,7 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *,
1872 return err; 1876 return err;
1873 } 1877 }
1874 1878
1879#ifdef CONFIG_SENSORS_W83795_FANCTRL
1875 for (i = 0; i < data->has_pwm; i++) { 1880 for (i = 0; i < data->has_pwm; i++) {
1876 for (j = 0; j < ARRAY_SIZE(w83795_pwm[0]); j++) { 1881 for (j = 0; j < ARRAY_SIZE(w83795_pwm[0]); j++) {
1877 err = fn(dev, &w83795_pwm[i][j].dev_attr); 1882 err = fn(dev, &w83795_pwm[i][j].dev_attr);
@@ -1879,11 +1884,16 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *,
1879 return err; 1884 return err;
1880 } 1885 }
1881 } 1886 }
1887#endif
1882 1888
1883 for (i = 0; i < ARRAY_SIZE(w83795_temp); i++) { 1889 for (i = 0; i < ARRAY_SIZE(w83795_temp); i++) {
1884 if (!(data->has_temp & (1 << i))) 1890 if (!(data->has_temp & (1 << i)))
1885 continue; 1891 continue;
1892#ifdef CONFIG_SENSORS_W83795_FANCTRL
1886 for (j = 0; j < ARRAY_SIZE(w83795_temp[0]); j++) { 1893 for (j = 0; j < ARRAY_SIZE(w83795_temp[0]); j++) {
1894#else
1895 for (j = 0; j < 8; j++) {
1896#endif
1887 err = fn(dev, &w83795_temp[i][j].dev_attr); 1897 err = fn(dev, &w83795_temp[i][j].dev_attr);
1888 if (err) 1898 if (err)
1889 return err; 1899 return err;