From: 张晴 Date: Mon, 26 Aug 2013 07:36:57 +0000 (+0800) Subject: rk3188:pmu:rt5025:debug the soc is not supply when resume X-Git-Tag: firefly_0821_release~6682 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=382f985d68c79fbbac38e52808315e97af6eeca1;p=firefly-linux-kernel-4.4.55.git rk3188:pmu:rt5025:debug the soc is not supply when resume --- diff --git a/drivers/power/rt5025-battery.c b/drivers/power/rt5025-battery.c index 20d512ae8576..1759263ed506 100644 --- a/drivers/power/rt5025-battery.c +++ b/drivers/power/rt5025-battery.c @@ -1616,7 +1616,8 @@ static void rt5025_update_work(struct work_struct *work) local_irq_restore(flags); wake_unlock(&bi->monitor_wake_lock); - schedule_delayed_work(&bi->monitor_work, bi->update_time*HZ); + if (!bi->device_suspend) + schedule_delayed_work(&bi->monitor_work, bi->update_time*HZ); } static enum power_supply_property rt5025_battery_props[] = { @@ -1665,9 +1666,9 @@ static int rt5025_battery_suspend(struct platform_device *pdev, pm_message_t sta //rt5025_battery_parameter_backup(bi); //rt5025_channel_cc(bi, false); - cancel_delayed_work_sync(&bi->monitor_work); //rt5025_update(bi); bi->device_suspend = true; + cancel_delayed_work_sync(&bi->monitor_work); /* prevent suspend before starting the alarm */ //bi->update_time = SUSPEND_POLL; rt5025_alert_setting(bi,MAXVOLT, false); @@ -1712,6 +1713,7 @@ static int rt5025_battery_remove(struct platform_device *pdev) cancel_delayed_work(&bi->monitor_work); wake_lock_destroy(&bi->monitor_wake_lock); kfree(bi); + RTINFO("\n"); return 0; } @@ -1803,6 +1805,7 @@ static void rt5025_battery_shutdown(struct platform_device *pdev) RTINFO("bi->cal_fcc=%d\n", bi->cal_fcc); } rt5025_battery_parameter_backup(bi); + RTINFO("\n"); } static struct platform_driver rt5025_battery_driver = diff --git a/drivers/power/rt5025-swjeita.c b/drivers/power/rt5025-swjeita.c old mode 100755 new mode 100644 index 60609d5dbbec..56179d2be936 --- a/drivers/power/rt5025-swjeita.c +++ b/drivers/power/rt5025-swjeita.c @@ -356,7 +356,8 @@ static void thermal_reg_work_func(struct work_struct *work) rt5025_notify_charging_cable(swji, swji->cur_cable); } - schedule_delayed_work(&swji->thermal_reg_work, 5*HZ); + if (!swji->suspend) + schedule_delayed_work(&swji->thermal_reg_work, 5*HZ); RTINFO("%s --", __func__); } @@ -422,16 +423,17 @@ static int __devexit rt5025_swjeita_remove(struct platform_device *pdev) swji->chip->jeita_info = NULL; kfree(swji); + RTINFO("\n"); return 0; } static int rt5025_swjeita_suspend(struct platform_device *pdev, pm_message_t state) { struct rt5025_swjeita_info *swji = platform_get_drvdata(pdev); - cancel_delayed_work_sync(&swji->thermal_reg_work); swji->cur_therm_region = swji->dec_current = 0; rt5025_notify_charging_cable(swji, swji->cur_cable); swji->suspend = 1; + cancel_delayed_work_sync(&swji->thermal_reg_work); RTINFO("\n"); return 0; }