mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
Merge "power: supply: qti_battery_charger: Keep device awake during notification"
This commit is contained in:
commit
e2300e65af
1 changed files with 12 additions and 1 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/reboot.h>
|
||||
#include <linux/rpmsg.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/pm_wakeup.h>
|
||||
#include <linux/power_supply.h>
|
||||
#include <linux/soc/qcom/pmic_glink.h>
|
||||
#include <linux/soc/qcom/battery_charger.h>
|
||||
|
|
@ -622,8 +623,18 @@ static void handle_notification(struct battery_chg_dev *bcdev, void *data,
|
|||
break;
|
||||
}
|
||||
|
||||
if (pst && pst->psy)
|
||||
if (pst && pst->psy) {
|
||||
/*
|
||||
* For charger mode, keep the device awake at least for 50 ms
|
||||
* so that device won't enter suspend when a non-SDP charger
|
||||
* is removed. This would allow the userspace process like
|
||||
* "charger" to be able to read power supply uevents to take
|
||||
* appropriate actions (e.g. shutting down when the charger is
|
||||
* unplugged).
|
||||
*/
|
||||
power_supply_changed(pst->psy);
|
||||
pm_wakeup_dev_event(bcdev->dev, 50, true);
|
||||
}
|
||||
}
|
||||
|
||||
static int battery_chg_callback(void *priv, void *data, size_t len)
|
||||
|
|
|
|||
Loading…
Reference in a new issue