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: 2011861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C19C23FD1A for ; Mon, 21 Jan 2013 12:15:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TxGE6-0001t5-0n; Mon, 21 Jan 2013 12:11:46 +0000 Received: from mail-wg0-f44.google.com ([74.125.82.44]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxG8Y-0006ZV-GE for linux-arm-kernel@lists.infradead.org; Mon, 21 Jan 2013 12:06:20 +0000 Received: by mail-wg0-f44.google.com with SMTP id dr12so3595012wgb.11 for ; Mon, 21 Jan 2013 04:04:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=M1at+UR7QuKGR2qhptuvKD6ZKMJT6ZhAqqyybBd/99s=; b=B6XpDGgtEJ2F4ZqgFy8aXLrZNsrH2X6plWqsElzd+8woTAccd+ve99OsoBCFICf9Ty Iu4HabfzmuknrHtC1wH9gWiXYUcl9SyZPhr5K/wEmKCEZgfN61Tt7Ma497uDtha8Ekyq sCRPo7HIS1Cut1lf2wfixcA6QR7CJAjeR+RntzGXdI/S7a6a+iYsPWwJLrIw75e0J0v4 zla5EPgENZ3ZxwdnFDRixoAYDA0k+1XzrcmzhSe8/AZL4XiuhFB8TcEBOlolxaUmj0mz KtLs5DTn0zfNSSvsZ4HLYOKBM1H6lnUtbG1rSxe7KXje52QA9iTnNDoFvAdLZIed6wJ6 WUGA== 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 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: ALoCoQmlXJ3IZbga4gx0AMKuOlN0iHx2mMbuxrlxbdmALIpdlrq+HBjVLcwPz/6kNOLitx91EenS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130121_070602_721960_349935B5 X-CRM114-Status: GOOD ( 11.83 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.44 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linus.walleij@stericsson.com, arnd@arndb.de, cbou@mail.ru, anton.vorontsov@linaro.org, Rajkumar Kasirajan , Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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]);