Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220509
b: refs/heads/master
c: 00030af
h: refs/heads/master
i:
  220507: 313b80c
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 28, 2010
1 parent 793c65b commit ef955bc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3760b432d589ddd9bdb8c337539b815125bc7aa
refs/heads/master: 00030af23153f1958f015df8b9fec8c29fcca8b8
17 changes: 17 additions & 0 deletions trunk/drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,23 @@ config SENSORS_W83795
This driver can also be built as a module. If so, the module
will be called w83795.

config SENSORS_W83795_FANCTRL
boolean "Include fan control support (DANGEROUS)"
depends on SENSORS_W83795 && EXPERIMENTAL
default n
help
If you say yes here, support for the both manual and automatic
fan control features will be included in the driver.

This part of the code wasn't carefully reviewed and tested yet,
so enabling this option is strongly discouraged on production
servers. Only developers and testers should enable it for the
time being.

Please also note that this option will create sysfs attribute
files which may change in the future, so you shouldn't rely
on them being stable.

config SENSORS_W83L785TS
tristate "Winbond W83L785TS-S"
depends on I2C && EXPERIMENTAL
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/hwmon/w83795.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
};

/*
Expand Down Expand Up @@ -1872,18 +1876,24 @@ 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);
if (err)
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;
Expand Down

0 comments on commit ef955bc

Please sign in to comment.