From: Pavan Kumar S Date: Mon, 23 Apr 2012 06:33:07 +0000 (+0530) Subject: ANDROID-COS: Change in charger detection for OSIP X-Git-Tag: 2.1b_release~857 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c839021138b4f92456416c81a6356c26b4747d2;p=kernel%2Fkernel-mfld-blackbay.git ANDROID-COS: Change in charger detection for OSIP 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 Reviewed-on: http://android.intel.com:8080/44361 Reviewed-by: Mukherjee, DevapriyaX Reviewed-by: Pallala, Ramakrishna Reviewed-by: Tc, Jenny Reviewed-by: Jena, TapanX Reviewed-by: Chotard, Celine Tested-by: Chotard, Celine Reviewed-by: buildbot Tested-by: buildbot --- diff --git a/drivers/platform/x86/intel_mid_osip.c b/drivers/platform/x86/intel_mid_osip.c index d851329..1659e51 100644 --- a/drivers/platform/x86/intel_mid_osip.c +++ b/drivers/platform/x86/intel_mid_osip.c @@ -33,7 +33,7 @@ /* change to "loop0" and use losetup for safe testing */ #define OSIP_BLKDEVICE "mmcblk0" #include -#include +#include /* 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__);