Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36739
b: refs/heads/master
c: 941c5c0
h: refs/heads/master
i:
  36737: 31857f4
  36735: 350989c
v: v3
  • Loading branch information
Jim Cromie authored and Greg Kroah-Hartman committed Sep 28, 2006
1 parent 4318e41 commit fcb1001
Show file tree
Hide file tree
Showing 2 changed files with 88 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: 44646c19b41e40d81f5e4863466914e8ce060cc0
refs/heads/master: 941c5c05cf38da5e12d70edc5d0fec5c24bce8b6
87 changes: 87 additions & 0 deletions trunk/drivers/hwmon/pc87360.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ static struct sensor_device_attribute fan_min[] = {
SENSOR_ATTR(fan3_min, S_IWUSR | S_IRUGO, show_fan_min, set_fan_min, 2),
};

#define FAN_UNIT_ATTRS(X) \
&fan_input[X].dev_attr.attr, \
&fan_status[X].dev_attr.attr, \
&fan_div[X].dev_attr.attr, \
&fan_min[X].dev_attr.attr

static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
Expand Down Expand Up @@ -360,6 +366,19 @@ static struct sensor_device_attribute pwm[] = {
SENSOR_ATTR(pwm3, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 2),
};

static struct attribute * pc8736x_fan_attr_array[] = {
FAN_UNIT_ATTRS(0),
FAN_UNIT_ATTRS(1),
FAN_UNIT_ATTRS(2),
&pwm[0].dev_attr.attr,
&pwm[1].dev_attr.attr,
&pwm[2].dev_attr.attr,
NULL
};
static const struct attribute_group pc8736x_fan_group = {
.attrs = pc8736x_fan_attr_array,
};

static ssize_t show_in_input(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
Expand Down Expand Up @@ -472,6 +491,12 @@ static struct sensor_device_attribute in_max[] = {
SENSOR_ATTR(in10_max, S_IWUSR | S_IRUGO, show_in_max, set_in_max, 10),
};

#define VIN_UNIT_ATTRS(X) \
&in_input[X].dev_attr.attr, \
&in_status[X].dev_attr.attr, \
&in_min[X].dev_attr.attr, \
&in_max[X].dev_attr.attr

static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
{
struct pc87360_data *data = pc87360_update_device(dev);
Expand Down Expand Up @@ -500,6 +525,27 @@ static ssize_t show_in_alarms(struct device *dev, struct device_attribute *attr,
}
static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL);

static struct attribute *pc8736x_vin_attr_array[] = {
VIN_UNIT_ATTRS(0),
VIN_UNIT_ATTRS(1),
VIN_UNIT_ATTRS(2),
VIN_UNIT_ATTRS(3),
VIN_UNIT_ATTRS(4),
VIN_UNIT_ATTRS(5),
VIN_UNIT_ATTRS(6),
VIN_UNIT_ATTRS(7),
VIN_UNIT_ATTRS(8),
VIN_UNIT_ATTRS(9),
VIN_UNIT_ATTRS(10),
&dev_attr_cpu0_vid.attr,
&dev_attr_vrm.attr,
&dev_attr_alarms_in.attr,
NULL
};
static const struct attribute_group pc8736x_vin_group = {
.attrs = pc8736x_vin_attr_array,
};

static ssize_t show_therm_input(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
Expand Down Expand Up @@ -618,6 +664,23 @@ static struct sensor_device_attribute therm_crit[] = {
show_therm_crit, set_therm_crit, 2+11),
};

#define THERM_UNIT_ATTRS(X) \
&therm_input[X].dev_attr.attr, \
&therm_status[X].dev_attr.attr, \
&therm_min[X].dev_attr.attr, \
&therm_max[X].dev_attr.attr, \
&therm_crit[X].dev_attr.attr

static struct attribute * pc8736x_therm_attr_array[] = {
THERM_UNIT_ATTRS(0),
THERM_UNIT_ATTRS(1),
THERM_UNIT_ATTRS(2),
NULL
};
static const struct attribute_group pc8736x_therm_group = {
.attrs = pc8736x_therm_attr_array,
};

static ssize_t show_temp_input(struct device *dev, struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
Expand Down Expand Up @@ -736,6 +799,25 @@ static ssize_t show_temp_alarms(struct device *dev, struct device_attribute *att
}
static DEVICE_ATTR(alarms_temp, S_IRUGO, show_temp_alarms, NULL);

#define TEMP_UNIT_ATTRS(X) \
&temp_input[X].dev_attr.attr, \
&temp_status[X].dev_attr.attr, \
&temp_min[X].dev_attr.attr, \
&temp_max[X].dev_attr.attr, \
&temp_crit[X].dev_attr.attr

static struct attribute * pc8736x_temp_attr_array[] = {
TEMP_UNIT_ATTRS(0),
TEMP_UNIT_ATTRS(1),
TEMP_UNIT_ATTRS(2),
/* include the few miscellaneous atts here */
&dev_attr_alarms_temp.attr,
NULL
};
static const struct attribute_group pc8736x_temp_group = {
.attrs = pc8736x_temp_attr_array,
};

/*
* Device detection, registration and update
*/
Expand Down Expand Up @@ -1009,6 +1091,11 @@ static int pc87360_detach_client(struct i2c_client *client)

hwmon_device_unregister(data->class_dev);

sysfs_remove_group(&client->dev.kobj, &pc8736x_temp_group);
sysfs_remove_group(&client->dev.kobj, &pc8736x_fan_group);
sysfs_remove_group(&client->dev.kobj, &pc8736x_therm_group);
sysfs_remove_group(&client->dev.kobj, &pc8736x_vin_group);

if ((i = i2c_detach_client(client)))
return i;

Expand Down

0 comments on commit fcb1001

Please sign in to comment.