From patchwork Thu Sep 27 20:09:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11829 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 4B97924140 for ; Thu, 27 Sep 2012 20:10:40 +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 005C9A18351 for ; Thu, 27 Sep 2012 20:10:39 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:10:39 -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=76BX72jwy4jeXm6wG8nwkT6kCIuxQE0VaxWjFC6JdUA=; b=enqaV9c7+82a1jRHhQFzo8K1UZ4RL5TpnP4BoG5xXRX/WdOjKc2J8R/65lF/kAejSd TGSUqvkB6CFCwcpMF0vq9niCPLvC3CIpDie/MmjAqsX/gnEcp9XMlOAZe8rI8MXZJikL hKm3zD5sHX5pjTUQNgxGJKRlP+OO7BQkeloKvs8JzHHpQUy2TqiT4rPrAKlAFjp/Jp/J AZ4SEdzSVEa6kmODH4LScy8NtWcMeIRS9Cwg7vih7Nas7QVXLsIZypY6Da0u1iJh7En2 jKxPZLH0u19lWchJd18TPnrStrrQgS++ZXfL8nTRedq7A1FEaMCCkfY6dxn9hYUnFtBa g2Cg== Received: by 10.50.184.129 with SMTP id eu1mr4762264igc.0.1348776638692; Thu, 27 Sep 2012 13:10:38 -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 ex8csp436421igc; Thu, 27 Sep 2012 13:10:36 -0700 (PDT) Received: by 10.50.192.234 with SMTP id hj10mr4594048igc.53.1348776636001; Thu, 27 Sep 2012 13:10:36 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id vn9si8390651pbc.17.2012.09.27.13.10.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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-pa0-f50.google.com with SMTP id hz11so1847989pad.37 for ; Thu, 27 Sep 2012 13:10:35 -0700 (PDT) Received: by 10.68.204.66 with SMTP id kw2mr14404717pbc.110.1348776635570; Thu, 27 Sep 2012 13:10:35 -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.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:35 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 56/57] power: abx500_chargalg: Fix quick re-attach charger issue. Date: Thu, 27 Sep 2012 14:09:13 -0600 Message-Id: <1348776554-10019-57-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: ALoCoQn8BFRlxVpagW4CNEz5D00W5NhVW00jQJlAKAj0SqeBpP3ciAA9aMqc72SYA5dIR+1eRp7e From: Marcus Cooper The patch for 426250 added a change to check for the quick re-attachment of the charger connection as an error in the AB8500 HW meant that a quick detach/attach wouldn't be detected. This patch isolates the original change so that newer AB's are not affected. Signed-off-by: Marcus Cooper Signed-off-by: Mathieu Poirier Reviewed-by: Martin SJOBLOM Reviewed-by: Hakan BERG Reviewed-by: Jonas ABERG --- drivers/power/abx500_chargalg.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index c8849af..7a81e4e 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -1299,11 +1299,12 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di) abx500_chargalg_check_charger_voltage(di); charger_status = abx500_chargalg_check_charger_connection(di); - ret = abx500_chargalg_check_charger_enable(di); - if (ret < 0) - dev_err(di->dev, "Checking charger if enabled error: %d line: %d\n", - ret, __LINE__); - + if (is_ab8500(di->parent)) { + ret = abx500_chargalg_check_charger_enable(di); + if (ret < 0) + dev_err(di->dev, "Checking charger is enabled error"); + dev_err(di->dev, ": Returned Value %d\n", ret); + } /* * First check if we have a charger connected. * Also we don't allow charging of unknown batteries if configured