From 81874c961ab63bdfbf3ee062301100708d99c9fe Mon Sep 17 00:00:00 2001 From: santosh Date: Thu, 23 Feb 2012 15:43:15 +0530 Subject: [PATCH] [PORT FROM R2]Battery: ignore the LOWBATT INT in case of charger connected BZ: 21057 This patch adds the logic to check for charger connection upon LOWBATT INT. If the charger is connected LOWBATT INT will be ignored else driver will set the battery health to Dead. Change-Id: Ice88315c9f591ca977a5f79bf8604cb8552e8b0e Orig-Change-Id: Ie35f9e9b1b42e8bac50b2a5c89e3b4053d8fecd8 Signed-off-by: Ramakrishna Pallala Signed-off-by: santosh Reviewed-on: http://android.intel.com:8080/36394 Reviewed-by: Kuppuswamy, Sathyanarayanan Reviewed-by: buildbot Tested-by: buildbot --- drivers/power/intel_mdf_battery.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/power/intel_mdf_battery.c b/drivers/power/intel_mdf_battery.c index 2f65d72..2741c55 100644 --- a/drivers/power/intel_mdf_battery.c +++ b/drivers/power/intel_mdf_battery.c @@ -962,7 +962,8 @@ static void msic_handle_exception(struct msic_power_module_info *mbi, } if (CHRINT_reg_value & MSIC_BATT_CHR_LOWBATT_MASK) { - health = POWER_SUPPLY_HEALTH_DEAD; + if (!mbi->usb_chrg_props.charger_present) + health = POWER_SUPPLY_HEALTH_DEAD; exception = MSIC_EVENT_LOWBATT_EXCPT; msic_log_exception_event(exception); } @@ -2171,7 +2172,8 @@ static irqreturn_t msic_battery_thread_handler(int id, void *dev) * on LOWBATT INT, So no need to service LOWBATT INT * afterwards and increase the load on CPU. */ - if (data[0] & MSIC_BATT_CHR_LOWBATT_MASK) { + if ((data[0] & MSIC_BATT_CHR_LOWBATT_MASK) && + !mbi->usb_chrg_props.charger_present) { dev_warn(msic_dev, "Masking LOWBATTINT\n"); mbi->chrint_mask |= MSIC_BATT_CHR_LOWBATT_MASK; ret = intel_scu_ipc_iowrite8(MSIC_BATT_CHR_MCHRINT_ADDR, -- 2.7.4