From: Greg Meiste Date: Thu, 5 Aug 2010 16:15:08 +0000 (-0500) Subject: power: ds2781: Check if charger already attached when probed X-Git-Tag: firefly_0821_release~9834^2~728 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=81a8a0e81ebdcf85b90fb0a7c8d1353f6e456834;p=firefly-linux-kernel-4.4.55.git power: ds2781: Check if charger already attached when probed If Stingray is powered up with a charger already attached, the battery driver would not report charging to the system, even though the battery was being charged. This charges the DS2781 battery driver to check if a charger is already present when the driver is probed. Change-Id: I786e34a4699a545f5a03995db5df457cd7f63773 Signed-off-by: Greg Meiste --- diff --git a/drivers/power/ds2781_battery.c b/drivers/power/ds2781_battery.c index 6b9641f72711..6803eb482e2a 100644 --- a/drivers/power/ds2781_battery.c +++ b/drivers/power/ds2781_battery.c @@ -422,6 +422,10 @@ static int ds2781_battery_probe(struct platform_device *pdev) alarm_init(&di->alarm, ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, ds2781_battery_alarm); wake_lock(&di->work_wake_lock); + + /* Check for charger since it could have been detected already. */ + battery_ext_power_changed(&di->bat); + queue_work(di->monitor_wqueue, &di->monitor_work); return 0;