From patchwork Thu Sep 27 20:09:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11821 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 04AA024140 for ; Thu, 27 Sep 2012 20:10:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 97441A18B3B for ; Thu, 27 Sep 2012 20:10:26 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:10:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=lZg2IaGj2ofUB1+pc4D1ePPlNPN/+0mCwKa8H5YnF9Y=; b=Euny2UIg2pI/Olfj9fj2hQePycpl1NT253nIM0MTqObge2TZ24/XB6X9mHaFRy2Dxy FjYFBgy3JcXcOp2RQpeH1a1H9pNHBNWMPmIysf4DA9E1c/bhWlvabW/cqy3QqxP1TeH3 TZFD/xh5loV4KCzvS+x4qE4N86v1/GKiFRsXolHm3PMzjkYB53a6tzX62kUWvsPlXZNN obIAwMkel640dGD2SbXHvc6rkTIt2+Uh401eD6jCfsXX6kA4xDx0E1ckR/2njbWcEFYY OXK8SIBDelKa7UWU4o8CeWvb9E3a0ygr7L59p9X9YxSPMDhle3tw+SrN7hG0aeyVxP/l RQTQ== Received: by 10.50.184.129 with SMTP id eu1mr4761383igc.0.1348776626397; Thu, 27 Sep 2012 13:10:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp436394igc; Thu, 27 Sep 2012 13:10:25 -0700 (PDT) Received: by 10.68.222.42 with SMTP id qj10mr14453313pbc.117.1348776625665; Thu, 27 Sep 2012 13:10:25 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pi9si5467641pbb.12.2012.09.27.13.10.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) smtp.mail=mathieu.poirier@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md4so1686045pbc.37 for ; Thu, 27 Sep 2012 13:10:25 -0700 (PDT) Received: by 10.68.228.98 with SMTP id sh2mr14527967pbc.95.1348776625442; Thu, 27 Sep 2012 13:10:25 -0700 (PDT) Received: from localhost.localdomain (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPS id sa2sm1587890pbc.4.2012.09.27.13.10.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:24 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 48/57] power: ab8500 : quick re-attach for ext charger Date: Thu, 27 Sep 2012 14:09:05 -0600 Message-Id: <1348776554-10019-49-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> References: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> X-Gm-Message-State: ALoCoQnURhxqBRPb01dNdXskVobGlS+hUoQDP9QchxQAq86up7wIFEOMGfy96jCku+Ykw7YAQ/nI From: Rupesh Kumar Quick re-attach charging behaviour is not required for external ac charger. Internal AC/USB Charger removal detection problem is due to a bug in AB8500 ASICs. Signed-off-by: Rupesh Kumar Signed-off-by: Mathieu Poirier Reviewed-by: Hakan BERG Reviewed-by: Philippe LANGLAIS --- drivers/power/abx500_chargalg.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 180deab..ce58f20 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -330,12 +330,13 @@ static int abx500_chargalg_check_charger_enable(struct abx500_chargalg *di) return di->usb_chg->ops.check_enable(di->usb_chg, di->bat->bat_type[di->bat->batt_id].normal_vol_lvl, di->bat->bat_type[di->bat->batt_id].normal_cur_lvl); - } else if (di->chg_info.charger_type & AC_CHG) { + } else if ((di->chg_info.charger_type & AC_CHG) && + !(di->ac_chg->external)) { return di->ac_chg->ops.check_enable(di->ac_chg, di->bat->bat_type[di->bat->batt_id].normal_vol_lvl, di->bat->bat_type[di->bat->batt_id].normal_cur_lvl); } - return -ENXIO; + return 0; } /**