aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83795.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-10-28 20:31:49 +0200
committerJean Delvare <khali@endymion.delvare>2010-10-28 20:31:49 +0200
commit00030af23153f1958f015df8b9fec8c29fcca8b8 (patch)
tree32ea0e1f4e7e5a37c89b286bef76aebae6c3e17c /drivers/hwmon/w83795.c
parente3760b432d589ddd9bdb8c337539b815125bc7aa (diff)
downloadkernel_samsung_smdk4412-00030af23153f1958f015df8b9fec8c29fcca8b8.zip
kernel_samsung_smdk4412-00030af23153f1958f015df8b9fec8c29fcca8b8.tar.gz
kernel_samsung_smdk4412-00030af23153f1958f015df8b9fec8c29fcca8b8.tar.bz2
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/hwmon/w83795.c')
-rw-r--r--drivers/hwmon/w83795.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c
index a9116ad..c461e75 100644
--- a/drivers/hwmon/w83795.c
+++ b/drivers/hwmon/w83795.c
@@ -1455,6 +1455,7 @@ store_in(struct device *dev, struct device_attribute *attr,
}
+#ifdef CONFIG_SENSORS_W83795_FANCTRL
static ssize_t
show_sf_setup(struct device *dev, struct device_attribute *attr, char *buf)
{
@@ -1506,6 +1507,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,
mutex_unlock(&data->update_lock);
return count;
}
+#endif
#define NOT_USED -1
@@ -1711,6 +1713,7 @@ static const struct sensor_device_attribute_2 sda_single_files[] = {
store_chassis_clear, ALARM_STATUS, 46),
SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep,
store_beep, BEEP_ENABLE, 47),
+#ifdef CONFIG_SENSORS_W83795_FANCTRL
SENSOR_ATTR_2(speed_cruise_tolerance, S_IWUSR | S_IRUGO, show_fanin,
store_fanin, FANIN_TOL, NOT_USED),
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[] = {
store_sf_setup, SETUP_PWM_UPTIME, NOT_USED),
SENSOR_ATTR_2(pwm_downtime, S_IWUSR | S_IRUGO, show_sf_setup,
store_sf_setup, SETUP_PWM_DOWNTIME, NOT_USED),
+#endif
};
/*
@@ -1872,6 +1876,7 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *,
return err;
}
+#ifdef CONFIG_SENSORS_W83795_FANCTRL
for (i = 0; i < data->has_pwm; i++) {
for (j = 0; j < ARRAY_SIZE(w83795_pwm[0]); j++) {
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 *,
return err;
}
}
+#endif
for (i = 0; i < ARRAY_SIZE(w83795_temp); i++) {
if (!(data->has_temp & (1 << i)))
continue;
+#ifdef CONFIG_SENSORS_W83795_FANCTRL
for (j = 0; j < ARRAY_SIZE(w83795_temp[0]); j++) {
+#else
+ for (j = 0; j < 8; j++) {
+#endif
err = fn(dev, &w83795_temp[i][j].dev_attr);
if (err)
return err;