ANDROID-COS: Change in charger detection for OSIP
authorPavan Kumar S <pavan.kumar.s@intel.com>
Mon, 23 Apr 2012 06:33:07 +0000 (12:03 +0530)
committerbuildbot <buildbot@intel.com>
Mon, 30 Apr 2012 23:25:33 +0000 (16:25 -0700)
BZ: 32617

Tablet platform supports AC-charger and currently doesn't support USB-charging.
This patch changes OSIP driver to detect for charger connection status using
power_supply_is_system_supplied() instead of penwell_otg_query_charging_cap().

Change-Id: I0da542988dd9575a6fcdee6c1e54edb4ab16ec65
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Reviewed-on: http://android.intel.com:8080/44361
Reviewed-by: Mukherjee, DevapriyaX <devapriyax.mukherjee@intel.com>
Reviewed-by: Pallala, Ramakrishna <ramakrishna.pallala@intel.com>
Reviewed-by: Tc, Jenny <jenny.tc@intel.com>
Reviewed-by: Jena, TapanX <tapanx.jena@intel.com>
Reviewed-by: Chotard, Celine <celine.chotard@intel.com>
Tested-by: Chotard, Celine <celine.chotard@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/platform/x86/intel_mid_osip.c

index d851329..1659e51 100644 (file)
@@ -33,7 +33,7 @@
 /* change to "loop0" and use losetup for safe testing */
 #define OSIP_BLKDEVICE "mmcblk0"
 #include <asm/intel_scu_ipc.h>
-#include <linux/usb/penwell_otg.h>
+#include <linux/power_supply.h>
 
 /* OSIP backup will be stored with this offset in the first sector */
 #define OSIP_BACKUP_OFFSET 0xE0
@@ -220,17 +220,15 @@ static int osip_reboot_notifier_call(struct notifier_block *notifier,
        int ret = NOTIFY_DONE;
        int ret_ipc;
        char *cmd = (char *)data;
-       struct otg_bc_cap cap;
        u8 rbt_reason;
 
        /* If system power off with charger connected, set the Reboot
           Reason to COS */
        if (what != SYS_RESTART || !data) {
                pr_err("%s(): invalid args\n", __func__);
-               penwell_otg_query_charging_cap(&cap);
                if (what == SYS_HALT || what == SYS_POWER_OFF) {
                        pr_info("%s(): sys power off ...\n", __func__);
-                       if (cap.chrg_type) {
+                       if (power_supply_is_system_supplied()) {
                                pr_warn("[SHTDWN] %s, Shutdown overload, "
                                        "switching to COS because a charger is "
                                        "plugged in\n", __func__);