rk3188:pmu:rt5025:debug the soc is not supply when resume

This commit is contained in:
张晴
2013-08-26 15:36:57 +08:00
parent 2192a21c68
commit 382f985d68
2 changed files with 9 additions and 4 deletions

View File

@@ -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 =

6
drivers/power/rt5025-swjeita.c Executable file → Normal file
View File

@@ -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;
}