diff options
author | Jean Huang <jeanh@nvidia.com> | 2013-04-23 12:28:59 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2013-04-25 17:47:07 -0700 |
commit | 71082aec6dd1ab636ae67eb9415f1309a110c3b3 (patch) | |
tree | 3652fce9c51c6b74b69347101bf9a9facd35b9f6 | |
parent | 65e0b90df3d17ae6d97234f61d1a4b4624d88feb (diff) |
arm: tegra: fan: clear next fan state before suspend
Original design was to restore fan to the state before suspend,
but fan-thermal detection should work itself to decide fan state after resume.
Bug 1273984
Change-Id: Ieac7688ed2ccf3dca3427c61e3d51a209cda79a3
Signed-off-by: Jean Huang <jeanh@nvidia.com>
Reviewed-on: http://git-master/r/222157
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
-rw-r--r-- | drivers/misc/therm_fan_est.c | 5 | ||||
-rw-r--r-- | drivers/thermal/pwm_fan.c | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/misc/therm_fan_est.c b/drivers/misc/therm_fan_est.c index 15d6352a915e..b64af6ceefe7 100644 --- a/drivers/misc/therm_fan_est.c +++ b/drivers/misc/therm_fan_est.c @@ -95,9 +95,9 @@ static void therm_fan_est_work_func(struct work_struct *work) } if (est->current_trip_index != (trip_index - 1)) { - est->current_trip_index = trip_index - 1; - if (!((trip_index - 1) % 2)) + if (!((trip_index - 1) % 2) || (!est->current_trip_index)) thermal_zone_device_update(est->thz); + est->current_trip_index = trip_index - 1; } est->ntemp++; @@ -406,6 +406,7 @@ static int therm_fan_est_suspend(struct platform_device *pdev, if (!est) return -EINVAL; + est->current_trip_index = 0; cancel_delayed_work(&est->therm_fan_est_work); return 0; diff --git a/drivers/thermal/pwm_fan.c b/drivers/thermal/pwm_fan.c index df736557b627..ef1e69906985 100644 --- a/drivers/thermal/pwm_fan.c +++ b/drivers/thermal/pwm_fan.c @@ -777,6 +777,7 @@ static int pwm_fan_suspend(struct platform_device *pdev, pm_message_t state) cancel_delayed_work(&fan_data->fan_ramp_work); /*Turn the fan off*/ fan_data->fan_cur_pwm = 0; + fan_data->next_target_pwm = 0; set_pwm_duty_cycle(0, fan_data); /*Stop thermal control*/ @@ -795,10 +796,7 @@ static int pwm_fan_resume(struct platform_device *pdev) /*Start thermal control*/ fan_data->fan_temp_control_flag = 1; - if (fan_data->next_target_pwm != fan_data->fan_cur_pwm) - queue_delayed_work(fan_data->workqueue, - &fan_data->fan_ramp_work, - msecs_to_jiffies(fan_data->step_time)); + mutex_unlock(&fan_data->fan_state_lock); return 0; } |