From 35b0d3174ffd49a78e41b1c5f59e08967e2750d0 Mon Sep 17 00:00:00 2001 From: Hank_Lee Date: Fri, 14 Jun 2013 20:48:19 +0800 Subject: [PATCH] charger: smb345: hold 2s tiemout wakelock during resume The system resume then suspend too fast when put on or remove wireless charging dock Change-Id: Idddb823036b58f1c390aee500574d8379a91731f Signed-off-by: Hank_Lee --- drivers/power/smb345-charger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/smb345-charger.c b/drivers/power/smb345-charger.c index 280760407f34..328948132232 100644 --- a/drivers/power/smb345-charger.c +++ b/drivers/power/smb345-charger.c @@ -1248,6 +1248,10 @@ static int smb345_suspend(struct i2c_client *client, pm_message_t mesg) static int smb345_resume(struct i2c_client *client) { + printk("smb345_resume+\n"); + if (wireless_on != !(gpio_get_value(charger->wpc_pok_gpio))) + wake_lock_timeout(&charger_wakelock, 2*HZ); + printk("smb345_resume-\n"); return 0; }