Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167830
b: refs/heads/master
c: 9d09144
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Oct 24, 2009
1 parent 7c77b34 commit f6a3751
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 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: c7702c31340f84cfd5e5df22293578b7ae1e9370
refs/heads/master: 9d0914468fdf66d61a57e7c074b17a28eed4d3dd
29 changes: 24 additions & 5 deletions trunk/drivers/hwmon/dme1737.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static struct dme1737_data *dme1737_update_device(struct device *dev)

/* Sample register contents every 1 sec */
if (time_after(jiffies, data->last_update + HZ) || !data->valid) {
if (data->type != sch5027) {
if (data->type == dme1737) {
data->vid = dme1737_read(data, DME1737_REG_VID) &
0x3f;
}
Expand Down Expand Up @@ -1621,16 +1621,25 @@ static struct attribute *dme1737_misc_attr[] = {
&sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr,
&sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr,
&sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr,
/* Misc */
&dev_attr_vrm.attr,
&dev_attr_cpu0_vid.attr,
NULL
};

static const struct attribute_group dme1737_misc_group = {
.attrs = dme1737_misc_attr,
};

/* The following struct holds VID-related attributes. Their creation
depends on the chip type which is determined during module load. */
static struct attribute *dme1737_vid_attr[] = {
&dev_attr_vrm.attr,
&dev_attr_cpu0_vid.attr,
NULL
};

static const struct attribute_group dme1737_vid_group = {
.attrs = dme1737_vid_attr,
};

/* The following structs hold the PWM attributes, some of which are optional.
* Their creation depends on the chip configuration which is determined during
* module load. */
Expand Down Expand Up @@ -1902,6 +1911,9 @@ static void dme1737_remove_files(struct device *dev)
if (data->type != sch5027) {
sysfs_remove_group(&dev->kobj, &dme1737_misc_group);
}
if (data->type == dme1737) {
sysfs_remove_group(&dev->kobj, &dme1737_vid_group);
}

sysfs_remove_group(&dev->kobj, &dme1737_group);

Expand Down Expand Up @@ -1933,6 +1945,13 @@ static int dme1737_create_files(struct device *dev)
goto exit_remove;
}

/* Create VID-related sysfs attributes */
if ((data->type == dme1737) &&
(err = sysfs_create_group(&dev->kobj,
&dme1737_vid_group))) {
goto exit_remove;
}

/* Create fan sysfs attributes */
for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) {
if (data->has_fan & (1 << ix)) {
Expand Down Expand Up @@ -2127,7 +2146,7 @@ static int dme1737_init_device(struct device *dev)
data->pwm_acz[2] = 4; /* pwm3 -> zone3 */

/* Set VRM */
if (data->type != sch5027) {
if (data->type == dme1737) {
data->vrm = vid_which_vrm();
}

Expand Down

0 comments on commit f6a3751

Please sign in to comment.