From patchwork Thu Sep 27 20:09:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11823 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 5AC3124140 for ; Thu, 27 Sep 2012 20:10:29 +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 E8135A18968 for ; Thu, 27 Sep 2012 20:10:28 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:10:28 -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=m/tteFu/kpTpj/JU9wyK7/kxyEeaT7dcdsvYdpbdiIE=; b=QPu5QTK/weVYb/XYse0z6/8ERh4O9y1DxncjWiiIk9z7/0wJKTSj2EPJFvwxf/mul0 L2zzb/Moea/wN0B91BBDWgtO/H6aEm0KtldiekhG9DA04JDP4xewu1Z/pvu/Q8shClhT H1gphR/wWoI6lvbPPV41TvKj5OS3Zoe77Dk79sc2Uf/aHhzcOjeJzVVvd8H8aOuhhNkx mU9Mg/inUvk439ayFt3EDwbUtw1NKD3yzJuw3nRWxlSQaARsyE3lVYmHSeOZVoutlQGS DC8osHN6rr1oWZ452U0W/a8yDTQh1YcpF52O+iuTnXlswerIf6CGw+qJ6T04Nq812r6u oyVw== Received: by 10.50.195.134 with SMTP id ie6mr4711206igc.28.1348776628743; Thu, 27 Sep 2012 13:10:28 -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 ex8csp436400igc; Thu, 27 Sep 2012 13:10:28 -0700 (PDT) Received: by 10.68.222.42 with SMTP id qj10mr14453547pbc.117.1348776628268; Thu, 27 Sep 2012 13:10:28 -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.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:28 -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:28 -0700 (PDT) Received: by 10.66.78.6 with SMTP id x6mr12135077paw.41.1348776628040; Thu, 27 Sep 2012 13:10:28 -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.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:27 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 50/57] power: ab8500-chargalg: update battery health on safety timer exp Date: Thu, 27 Sep 2012 14:09:07 -0600 Message-Id: <1348776554-10019-51-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: ALoCoQlQrNOk0rpqAEpKzXIVRgNTD7/YF+UKlCw0octeyzpHqmsWFK3FpVyItk+/3mOkWrTHDu/9 From: Hakan Berg When the charging safety timer is elapsed the battery health is shown as "Good". This is misleading and also hard to distingiush problems reported on "phone discharges although charger is attached". When safety timer elapses that is an indication of a fault in the battery of some kind. Hence report as POWER_SUPPLY_HEALTH_UNSPEC_FAILURE. Signed-off-by: Hakan Berg Signed-off-by: Mathieu Poirier Reviewed-by: Arun MURTHY Reviewed-by: Karl KOMIEROWSKI --- drivers/power/abx500_chargalg.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 4db0ef0..1df238f 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -1711,6 +1711,10 @@ static int abx500_chargalg_get_property(struct power_supply *psy, val->intval = POWER_SUPPLY_HEALTH_COLD; else val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; + } else if (di->charge_state == STATE_SAFETY_TIMER_EXPIRED || + di->charge_state == + STATE_SAFETY_TIMER_EXPIRED_INIT) { + val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; } else { val->intval = POWER_SUPPLY_HEALTH_GOOD; }