rk3188:pmu:rt5025:debug the soc is not supply when resume
author张晴 <zhangqing@rock-chips.com>
Mon, 26 Aug 2013 07:36:57 +0000 (15:36 +0800)
committer张晴 <zhangqing@rock-chips.com>
Mon, 26 Aug 2013 07:36:57 +0000 (15:36 +0800)
drivers/power/rt5025-battery.c
drivers/power/rt5025-swjeita.c [changed mode: 0755->0644]

index 20d512ae8576730a943dee9e8df6755393ea5b2a..1759263ed506e18f5b9c3db0d1bc0f31073c5311 100644 (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 = 
old mode 100755 (executable)
new mode 100644 (file)
index 60609d5..56179d2
@@ -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;
 }