Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222137
b: refs/heads/master
c: d5ab845
h: refs/heads/master
i:
  222135: c373778
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Nov 15, 2010
1 parent eddce5e commit d102181
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae51cd9bcd9ca841bf45c0ba33823c56ac1ce81e
refs/heads/master: d5ab845a13de7ff2d195917dad8879acfb6d8ff9
19 changes: 18 additions & 1 deletion trunk/drivers/hwmon/w83795.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,21 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
return count;
}

static ssize_t
show_pwm_mode(struct device *dev, struct device_attribute *attr, char *buf)
{
struct w83795_data *data = w83795_update_pwm_config(dev);
int index = to_sensor_dev_attr_2(attr)->index;
unsigned int mode;

if (data->pwm_fomc & (1 << index))
mode = 0; /* DC */
else
mode = 1; /* PWM */

return sprintf(buf, "%u\n", mode);
}

static ssize_t
show_temp_src(struct device *dev, struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -1551,6 +1566,8 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,
show_pwm, store_pwm, PWM_FREQ, index - 1), \
SENSOR_ATTR_2(pwm##index##_enable, S_IWUSR | S_IRUGO, \
show_pwm_enable, store_pwm_enable, NOT_USED, index - 1), \
SENSOR_ATTR_2(pwm##index##_mode, S_IRUGO, \
show_pwm_mode, NULL, NOT_USED, index - 1), \
SENSOR_ATTR_2(fan##index##_target, S_IWUSR | S_IRUGO, \
show_fanin, store_fanin, FANIN_TARGET, index - 1) }

Expand Down Expand Up @@ -1698,7 +1715,7 @@ static const struct sensor_device_attribute_2 w83795_dts[][8] = {
SENSOR_ATTR_DTS(14),
};

static const struct sensor_device_attribute_2 w83795_pwm[][7] = {
static const struct sensor_device_attribute_2 w83795_pwm[][8] = {
SENSOR_ATTR_PWM(1),
SENSOR_ATTR_PWM(2),
SENSOR_ATTR_PWM(3),
Expand Down

0 comments on commit d102181

Please sign in to comment.