power: ds2781: Check if charger already attached when probed
authorGreg Meiste <w30289@motorola.com>
Thu, 5 Aug 2010 16:15:08 +0000 (11:15 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:30 +0000 (16:33 -0700)
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 <w30289@motorola.com>
drivers/power/ds2781_battery.c

index 6b9641f7271134ebac5d88328c4bc82ce34ed18e..6803eb482e2a0eaa72c622709625ce432c1e86f7 100644 (file)
@@ -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;