Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81246
b: refs/heads/master
c: 97759e4
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Jan 17, 2008
1 parent f49db3b commit 4324172
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 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: 9eb81bdf12efd32661a8eb97a5aaa6b7a1d3c795
refs/heads/master: 97759e494e2bfccc23ffc7b236196cb5c1703e2e
55 changes: 38 additions & 17 deletions trunk/drivers/macintosh/therm_pm72.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,8 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
*/
static int init_cpu_state(struct cpu_pid_state *state, int index)
{
int err;

state->index = index;
state->first = 1;
state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000;
Expand All @@ -1182,18 +1184,21 @@ static int init_cpu_state(struct cpu_pid_state *state, int index)
DBG("CPU %d Using %d power history entries\n", index, state->count_power);

if (index == 0) {
device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
} else {
device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
}
if (err)
printk(KERN_WARNING "Failed to create some of the atribute"
"files for CPU %d\n", index);

return 0;
fail:
Expand Down Expand Up @@ -1329,6 +1334,7 @@ static int init_backside_state(struct backside_pid_state *state)
{
struct device_node *u3;
int u3h = 1; /* conservative by default */
int err;

/*
* There are different PID params for machines with U3 and machines
Expand Down Expand Up @@ -1380,8 +1386,11 @@ static int init_backside_state(struct backside_pid_state *state)
if (state->monitor == NULL)
return -ENODEV;

device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
if (err)
printk(KERN_WARNING "Failed to create attribute file(s)"
" for backside fan\n");

return 0;
}
Expand Down Expand Up @@ -1492,6 +1501,8 @@ static void do_monitor_drives(struct drives_pid_state *state)
*/
static int init_drives_state(struct drives_pid_state *state)
{
int err;

state->ticks = 1;
state->first = 1;
state->rpm = 1000;
Expand All @@ -1500,8 +1511,11 @@ static int init_drives_state(struct drives_pid_state *state)
if (state->monitor == NULL)
return -ENODEV;

device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
if (err)
printk(KERN_WARNING "Failed to create attribute file(s)"
" for drives bay fan\n");

return 0;
}
Expand Down Expand Up @@ -1622,7 +1636,9 @@ static int init_dimms_state(struct dimm_pid_state *state)
if (state->monitor == NULL)
return -ENODEV;

device_create_file(&of_dev->dev, &dev_attr_dimms_temperature);
if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature))
printk(KERN_WARNING "Failed to create attribute file"
" for DIMM temperature\n");

return 0;
}
Expand Down Expand Up @@ -1732,6 +1748,8 @@ static void do_monitor_slots(struct slots_pid_state *state)
*/
static int init_slots_state(struct slots_pid_state *state)
{
int err;

state->ticks = 1;
state->first = 1;
state->pwm = 50;
Expand All @@ -1740,8 +1758,11 @@ static int init_slots_state(struct slots_pid_state *state)
if (state->monitor == NULL)
return -ENODEV;

device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
if (err)
printk(KERN_WARNING "Failed to create attribute file(s)"
" for slots bay fan\n");

return 0;
}
Expand Down

0 comments on commit 4324172

Please sign in to comment.