ARM: Add Versatile Express support
[safe/jmp/linux-2.6] / drivers / macintosh / therm_pm72.c
index a028598..921373e 100644 (file)
@@ -286,6 +286,8 @@ struct fcu_fan_table        fcu_fans[] = {
        },
 };
 
+static struct i2c_driver therm_pm72_driver;
+
 /*
  * Utility function to create an i2c_client structure and
  * attach it to one of u3 adapters
@@ -318,7 +320,7 @@ static struct i2c_client *attach_i2c_chip(int id, const char *name)
         * Let i2c-core delete that device on driver removal.
         * This is safe because i2c-core holds the core_lock mutex for us.
         */
-       list_add_tail(&clt->detected, &clt->driver->clients);
+       list_add_tail(&clt->detected, &therm_pm72_driver.clients);
        return clt;
 }
 
@@ -946,10 +948,16 @@ static void do_monitor_cpu_combined(void)
                printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
                       temp_combi >> 16);
                state0->overtemp += CPU_MAX_OVERTEMP / 4;
-       } else if (temp_combi > (state0->mpu.tmax << 16))
+       } else if (temp_combi > (state0->mpu.tmax << 16)) {
                state0->overtemp++;
-       else
+               printk(KERN_WARNING "Temperature %d above max %d. overtemp %d\n",
+                      temp_combi >> 16, state0->mpu.tmax, state0->overtemp);
+       } else {
+               if (state0->overtemp)
+                       printk(KERN_WARNING "Temperature back down to %d\n",
+                              temp_combi >> 16);
                state0->overtemp = 0;
+       }
        if (state0->overtemp >= CPU_MAX_OVERTEMP)
                critical_state = 1;
        if (state0->overtemp > 0) {
@@ -1021,10 +1029,16 @@ static void do_monitor_cpu_split(struct cpu_pid_state *state)
                       " (%d) !\n",
                       state->index, temp >> 16);
                state->overtemp += CPU_MAX_OVERTEMP / 4;
-       } else if (temp > (state->mpu.tmax << 16))
+       } else if (temp > (state->mpu.tmax << 16)) {
                state->overtemp++;
-       else
+               printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
+                      state->index, temp >> 16, state->mpu.tmax, state->overtemp);
+       } else {
+               if (state->overtemp)
+                       printk(KERN_WARNING "CPU %d temperature back down to %d\n",
+                              state->index, temp >> 16);
                state->overtemp = 0;
+       }
        if (state->overtemp >= CPU_MAX_OVERTEMP)
                critical_state = 1;
        if (state->overtemp > 0) {
@@ -1083,10 +1097,16 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
                       " (%d) !\n",
                       state->index, temp >> 16);
                state->overtemp = CPU_MAX_OVERTEMP / 4;
-       } else if (temp > (state->mpu.tmax << 16))
+       } else if (temp > (state->mpu.tmax << 16)) {
                state->overtemp++;
-       else
+               printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
+                      state->index, temp >> 16, state->mpu.tmax, state->overtemp);
+       } else {
+               if (state->overtemp)
+                       printk(KERN_WARNING "CPU %d temperature back down to %d\n",
+                              state->index, temp >> 16);
                state->overtemp = 0;
+       }
        if (state->overtemp >= CPU_MAX_OVERTEMP)
                critical_state = 1;
        if (state->overtemp > 0) {
@@ -1897,7 +1917,7 @@ static int create_control_loops(void)
         */
        if (rackmac)
                cpu_pid_type = CPU_PID_TYPE_RACKMAC;
-       else if (machine_is_compatible("PowerMac7,3")
+       else if (of_machine_is_compatible("PowerMac7,3")
            && (cpu_count > 1)
            && fcu_fans[CPUA_PUMP_RPM_INDEX].id != FCU_FAN_ABSENT_ID
            && fcu_fans[CPUB_PUMP_RPM_INDEX].id != FCU_FAN_ABSENT_ID) {
@@ -2209,7 +2229,7 @@ static int fcu_of_remove(struct of_device* dev)
        return 0;
 }
 
-static struct of_device_id fcu_match[] = 
+static const struct of_device_id fcu_match[] = 
 {
        {
        .type           = "fcu",
@@ -2232,10 +2252,10 @@ static int __init therm_pm72_init(void)
 {
        struct device_node *np;
 
-       rackmac = machine_is_compatible("RackMac3,1");
+       rackmac = of_machine_is_compatible("RackMac3,1");
 
-       if (!machine_is_compatible("PowerMac7,2") &&
-           !machine_is_compatible("PowerMac7,3") &&
+       if (!of_machine_is_compatible("PowerMac7,2") &&
+           !of_machine_is_compatible("PowerMac7,3") &&
            !rackmac)
                return -ENODEV;