From 81a8a0e81ebdcf85b90fb0a7c8d1353f6e456834 Mon Sep 17 00:00:00 2001 From: Greg Meiste Date: Thu, 5 Aug 2010 11:15:08 -0500 Subject: [PATCH] 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 --- drivers/power/ds2781_battery.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.34.1