From patchwork Mon Jan 21 12:03:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14165 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 7E5C023E33 for ; Mon, 21 Jan 2013 12:05:10 +0000 (UTC) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by fiordland.canonical.com (Postfix) with ESMTP id 27DFFA18DD2 for ; Mon, 21 Jan 2013 12:05:10 +0000 (UTC) Received: by mail-vc0-f174.google.com with SMTP id n11so3666703vch.33 for ; Mon, 21 Jan 2013 04:05:09 -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=M1at+UR7QuKGR2qhptuvKD6ZKMJT6ZhAqqyybBd/99s=; b=H0b4srqshgZDaWo7S9SKyTtiLJF9rub9L4hfPY3yEx1XHQzUfkaIPBGQBASZHJrFi+ 0YdS4hjsx8ZhL5MuJ1N3hrt/DyuZ8Rz3t3w3l0Q+wl/aLdvxX2j9LZGrEIubzn2J0XYq OxxMZmaPmKbFGh8Sa0L4YCuYzO4dEfEMOQPitoVdREav/NFTCwnp/Clb/t4/8SyHKSpC 7Plu89MKOXDfCpgB4hkjhZwMVpUm+ZK4qr5MmvPy+gX0zfvJVDyb1GPR6QiDCoow6kHb Z05djRUnpbl3pYpVz24F+sFNZOKZLi3ax5pwQb9cc0TJyCFOMqFjt295ZYakW1dUr8gz a6lA== X-Received: by 10.52.34.108 with SMTP id y12mr12644931vdi.8.1358769909708; Mon, 21 Jan 2013 04:05:09 -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 st5csp197746veb; Mon, 21 Jan 2013 04:05:09 -0800 (PST) X-Received: by 10.194.109.10 with SMTP id ho10mr26132090wjb.16.1358769898506; Mon, 21 Jan 2013 04:04:58 -0800 (PST) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by mx.google.com with ESMTPS id fb6si3810313wib.59.2013.01.21.04.04.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:58 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.49 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.49 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-wg0-f49.google.com with SMTP id 15so550598wgd.28 for ; Mon, 21 Jan 2013 04:04:58 -0800 (PST) X-Received: by 10.180.82.69 with SMTP id g5mr15047460wiy.21.1358769898104; Mon, 21 Jan 2013 04:04:58 -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.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:57 -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, Rajkumar Kasirajan , Lee Jones Subject: [PATCH 20/24] ab8500-fg: Use correct battery charge full design Date: Mon, 21 Jan 2013 12:03:56 +0000 Message-Id: <1358769840-4763-21-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: ALoCoQlrg4QoKxRbzxxBQ0fCfi5s5ZxrLBq6QjgT+/0Z2oygn+HyQfxhGqrWzdYsul1j3RExKWm7 From: Rajkumar Kasirajan If battery is not identified while fg probe, mah_max_design gets initialized with unknown battery's charge full design. Reinitialize mah_max_design if battery is identified after fg probe. Signed-off-by: Lee Jones Signed-off-by: Rajkumar Kasirajan Reviewed-by: Vijaya Kumar K-1 Reviewed-by: Marcus COOPER Reviewed-by: Olivier CLERGEAUD Reviewed-by: Arun MURTHY Reviewed-by: Rabin VINCENT Tested-by: Rupesh KUMAR Tested-by: Jonas ABERG --- drivers/power/ab8500_fg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 1a78116..0780b60 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -2090,7 +2090,8 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) case POWER_SUPPLY_PROP_TECHNOLOGY: switch (ext->type) { case POWER_SUPPLY_TYPE_BATTERY: - if (!di->flags.batt_id_received) { + if (!di->flags.batt_id_received && + di->bm->batt_id != BATTERY_UNKNOWN) { const struct abx500_battery_type *b; b = &(di->bm->bat_type[di->bm->batt_id]);