kernel:battery driver avoid i2c operation before suspend
authorxuwei9 <xuwei9@lenovo.com>
Thu, 3 Jan 2019 06:18:50 +0000 (14:18 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:52 +0000 (17:36 +0800)
avoid i2c operation before
suspspend in case i2c error

Change-Id: I1e570242913797114d0479534cc36d8e575fb930
Signed-off-by: xuwei9 <xuwei9@mt.com>
Reviewed-on: https://gerrit.mot.com/1289230
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/power/supply/s2mu00x_battery.c

index a75563f93554fc600c27ca4e838334e04554cfa2..e3e12bd2bcd352112a94a6f8f76fd08adb4a19e1 100644 (file)
@@ -40,8 +40,8 @@
 #endif
 
 #define FAKE_BAT_LEVEL 50
-#define DEFAULT_ALARM_INTERVAL 10
-#define SLEEP_ALARM_INTERVAL   30
+#define DEFAULT_ALARM_INTERVAL 30
+#define SLEEP_ALARM_INTERVAL   60
 
 static char *bat_status_str[] = {
        "Unknown",
@@ -3842,7 +3842,7 @@ static void smbchg_heartbeat_work(struct work_struct *work)
 
        pr_info("%s: start heatbeat\n", __func__);
 
-       smbchg_stay_awake(chip);
+       //smbchg_stay_awake(chip);
        //dump register of charger
        get_property_from_charger(chip, POWER_SUPPLY_PROP_PRESENT, &state);
 
@@ -4039,7 +4039,7 @@ static void smbchg_heartbeat_work(struct work_struct *work)
                schedule_delayed_work(&chip->heartbeat_work,
                                      msecs_to_jiffies(HEARTBEAT_HOLDOFF_MS));
 
-       smbchg_relax(chip);
+//     smbchg_relax(chip);
 }
 
 static bool smbchg_charger_mmi_factory(void)
@@ -4583,7 +4583,6 @@ static int s2mu00x_battery_resume(struct device *dev)
 static void s2mu00x_battery_complete(struct device *dev)
 {
        struct s2mu00x_battery_info *battery = dev_get_drvdata(dev);
-
        if (battery->monitor_alarm_interval != DEFAULT_ALARM_INTERVAL) {
                battery->monitor_alarm_interval = DEFAULT_ALARM_INTERVAL;
                pr_info("%s: Recover battery monitoring interval -> %d\n",