ARM: tegra: thermal: fixed some skin thermal bugs
Joshua Primero [Wed, 4 Jul 2012 02:37:55 +0000 (19:37 -0700)]
Fixed bug where skin cooling device is being bound to nct
device instead of skin thermal device.

bug 1007726

Change-Id: Ia6316735da8895fd4f4c20c0a76cd6796dafdf9b
Signed-off-by: Joshua Primero <jprimero@nvidia.com>
Reviewed-on: http://git-master/r/113563
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

arch/arm/mach-tegra/tegra3_thermal.c

index 85ff49c..033b4f6 100644 (file)
@@ -105,7 +105,7 @@ static int tegra_thermal_zone_bind(struct thermal_zone_device *thz,
 
 #ifdef CONFIG_TEGRA_SKIN_THROTTLE
        if ((bthrot->id == BALANCED_THROTTLE_ID_SKIN) &&
-               (device->id == therm->throttle_edp_device_id))
+               (device->id == therm->skin_device_id))
                return thermal_zone_bind_cooling_device(thz, 0, cdevice);
 #endif
 
@@ -289,15 +289,25 @@ static void tegra_thermal_alert_unlocked(void *data)
 #endif
 }
 
+#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
 /* Make sure this function remains stateless */
-void tegra_thermal_alert(void *data)
+static void tegra_thermal_alert(void *data)
 {
        mutex_lock(&tegra_therm_mutex);
        tegra_thermal_alert_unlocked(data);
        mutex_unlock(&tegra_therm_mutex);
 }
+#endif
 
 #ifdef CONFIG_TEGRA_SKIN_THROTTLE
+static void tegra_skin_thermal_alert(void *data)
+{
+       struct tegra_thermal_device *dev = data;
+
+       if (!dev->thz->passive)
+               thermal_zone_device_update(dev->thz);
+}
+
 static int tegra_skin_device_register(struct tegra_thermal_device *device)
 {
        int i;
@@ -411,8 +421,8 @@ int tegra_thermal_device_register(struct tegra_thermal_device *device)
        if (device->id == therm->skin_device_id) {
                if (create_thz)
                        device->set_alert(device->data,
-                               (void (*)(void *))thermal_zone_device_update,
-                               thz);
+                               tegra_skin_thermal_alert,
+                               device);
                device->set_limits(device->data, 0, therm->temp_throttle_skin);
        }
 #endif