From a1ffbfd7ffecf7806cac3537ead90eaf48c53d71 Mon Sep 17 00:00:00 2001 From: Joshua Primero Date: Tue, 3 Jul 2012 19:37:55 -0700 Subject: ARM: tegra: thermal: fixed some skin thermal bugs 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 Reviewed-on: http://git-master/r/113563 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- arch/arm/mach-tegra/tegra3_thermal.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-tegra/tegra3_thermal.c') diff --git a/arch/arm/mach-tegra/tegra3_thermal.c b/arch/arm/mach-tegra/tegra3_thermal.c index 788a5d7b26f8..f36f84ccddf4 100644 --- a/arch/arm/mach-tegra/tegra3_thermal.c +++ b/arch/arm/mach-tegra/tegra3_thermal.c @@ -104,7 +104,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 @@ -288,15 +288,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; @@ -410,8 +420,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 -- cgit v1.2.3