From patchwork Mon Jan 21 12:03:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14151 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 8408223E33 for ; Mon, 21 Jan 2013 12:04:49 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by fiordland.canonical.com (Postfix) with ESMTP id 425E4A18CF5 for ; Mon, 21 Jan 2013 12:04:49 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id m8so4813806vcd.37 for ; Mon, 21 Jan 2013 04:04:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=30/s3y0miBarKDatIdzBWcslc2C7eocF053OlxMKyhc=; b=crFUhLOjtqvgVp8+oIiHiOBkWGU+xaSWa2eP8s5cwjzeJdu5sEFSdDrDs2sDbF8YCB IyVhz4ILpGESyc+59Sc3KWOHnBxx2Wl459zg61DpQtID/A4ck4OfkD9rwR4tjtE02riR xrAELgjSQNCK0mtb0dMG+e7wB2qHkP9W4CX7wCdVFK+C7YQIRfZxGaVdTPSsxBFr+NFx kf9K9vhPqsfFTBei9PPBD9U1eAAhYr2GvPsNfWQugik6ztAWAAusQQ/AKjCsKxKu8KLN DIn1BVejT8BF+AHA0+Cqq46vPb+Wzmgb8ATpOI91whp37W4TjxN00OU/eMJSoDxcA3Wm gucQ== X-Received: by 10.52.18.147 with SMTP id w19mr16809925vdd.94.1358769888815; Mon, 21 Jan 2013 04:04:48 -0800 (PST) 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.58.145.101 with SMTP id st5csp197715veb; Mon, 21 Jan 2013 04:04:48 -0800 (PST) X-Received: by 10.194.171.198 with SMTP id aw6mr26001946wjc.3.1358769868870; Mon, 21 Jan 2013 04:04:28 -0800 (PST) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx.google.com with ESMTPS id x12si3824550wiv.0.2013.01.21.04.04.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.182 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.182; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.182 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f182.google.com with SMTP id hn14so4854410wib.3 for ; Mon, 21 Jan 2013 04:04:28 -0800 (PST) X-Received: by 10.194.235.100 with SMTP id ul4mr26051226wjc.7.1358769868402; Mon, 21 Jan 2013 04:04:28 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id i2sm16575305wiw.3.2013.01.21.04.04.26 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:27 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, anton.vorontsov@linaro.org, cbou@mail.ru, Lee Jones Subject: [PATCH 06/24] ab8500-chargalg: Update battery health on safety timer exp Date: Mon, 21 Jan 2013 12:03:42 +0000 Message-Id: <1358769840-4763-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358769840-4763-1-git-send-email-lee.jones@linaro.org> References: <1358769840-4763-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmOZA9V2lzczEurrgDyOKJVb+DNY6z+LRdXUZIXHbi57E1Tqzl+KLr6TBwZu2srkOPC1yDL When the charging safety timer elapses, the battery health is shown as "Good". This is misleading and also makes it difficult to distinguish issues relating to discharging despite the fact that the charger is still connected. When in actual fact a safety timer elapse is an indication of a fault in the battery. Here we make this clearer by reporting POWER_SUPPLY_HEALTH_UNSPEC_FAILURE instead. Signed-off-by: Lee Jones --- drivers/power/abx500_chargalg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 830b2dd..2463fa0 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -1628,6 +1628,9 @@ 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; }