From: Gabriel Touzeau Date: Thu, 26 Apr 2012 07:53:11 +0000 (+0200) Subject: intel_mid_power_off: modified charger detection X-Git-Tag: 2.1b_release~856 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30d439dcfd5f38fefa8db64b49ac64b8a0995628;p=kernel%2Fkernel-mfld-blackbay.git intel_mid_power_off: modified charger detection BZ: 31318 Shutdown with SDP/CDP/DCP cable connected shall NOT RESET the system and enter in Charging MODE This shall be done ONLY with ACDC Charger Signed-off-by: Gabriel Touzeau Change-Id: If6c8fc667930bd94f26493755eab36648182ec2e Reviewed-on: http://android.intel.com:8080/46358 Reviewed-by: Pallala, Ramakrishna Tested-by: Romieu, Benoit Reviewed-by: buildbot Tested-by: buildbot --- diff --git a/arch/x86/platform/intel-mid/mfld.c b/arch/x86/platform/intel-mid/mfld.c index e25cc6e..1d3e61d 100644 --- a/arch/x86/platform/intel-mid/mfld.c +++ b/arch/x86/platform/intel-mid/mfld.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,38 +41,11 @@ #include -#define MSIC_POWER_SRC_STAT 0x192 -#define MSIC_POWER_BATT (1 << 0) -#define MSIC_POWER_USB (1 << 1) - -static bool check_charger_conn(void) -{ - int ret; - struct otg_bc_cap cap; - u8 data; - - ret = intel_scu_ipc_ioread8(MSIC_POWER_SRC_STAT, &data); - if (ret) - return false; - - if (!((data & MSIC_POWER_BATT) && (data & MSIC_POWER_USB))) - return false; - - ret = penwell_otg_query_charging_cap(&cap); - if (ret) - return false; - - if (cap.chrg_type == CHRG_UNKNOWN) - return false; - - return true; -} - void intel_mid_power_off(void) { #ifdef CONFIG_INTEL_MID_OSIP - bool charger_conn = check_charger_conn(); - if (!get_force_shutdown_occured() && charger_conn) { + if (!get_force_shutdown_occured() && + power_supply_is_system_supplied()) { /* * Do a cold reset to let bootloader bring up the * platform into acting dead mode to continue