From patchwork Fri Feb 15 12:44:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14862 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 09D2723E2E for ; Fri, 15 Feb 2013 12:46:23 +0000 (UTC) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id BA394A1828F for ; Fri, 15 Feb 2013 12:46:22 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id fo13so2189467vcb.11 for ; Fri, 15 Feb 2013 04:46:22 -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=yBuIlGqbAaCMRtaegOpU20ZKTI7a/cBHbPkfqD86g/E=; b=athnF1ZkjEuQR8Nxw4WWJ9GIuFhYUEC+oye4SW2/eIMlHeMPmi8Wb9YJL7qDUEdfj2 3rPHyoyn5CFZt2BWZSl4EDgkNxJpbXZZLB1Xzp+dS3sjf2nTlDGlHXjkX2VSBXXgiJJ8 +ymWch75beyuMeaVIIsnke1RmPkqfnu+R/ecD0H5Ix6fajI0nCF+o5YDwWjkT2IksWIg 2UrM1JHiyyyKJwiO1We2X/gOkadqAG1Kwj3q8B5Df9taN+dF2PhfIjHanfaTx/cT3wPP oSZz/p/yDTycnljeiGljEJhEhYdeZknBBEPMO59G09aiFTNmq5nvXwlKcmnOHgXVpeSX LX6Q== X-Received: by 10.52.98.5 with SMTP id ee5mr2478574vdb.102.1360932382246; Fri, 15 Feb 2013 04:46:22 -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.221.4.5 with SMTP id oa5csp10861vcb; Fri, 15 Feb 2013 04:46:21 -0800 (PST) X-Received: by 10.180.98.232 with SMTP id el8mr2245003wib.22.1360932379953; Fri, 15 Feb 2013 04:46:19 -0800 (PST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id k12si4157301wjn.74.2013.02.15.04.46.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46:19 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.47 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-f47.google.com with SMTP id dr13so2687412wgb.2 for ; Fri, 15 Feb 2013 04:46:19 -0800 (PST) X-Received: by 10.194.87.100 with SMTP id w4mr3874285wjz.48.1360932379498; Fri, 15 Feb 2013 04:46:19 -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 bs6sm5133904wib.4.2013.02.15.04.46.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46:18 -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, cbouatmailru@gmail.com, sameo@linux.intel.com, Hakan Berg , Lee Jones Subject: [PATCH 17/40] ab8500-fg: Allow capacity to raise from 1% when charging Date: Fri, 15 Feb 2013 12:44:47 +0000 Message-Id: <1360932310-30065-18-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> References: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmdoYs/EU/SdiKCVPGiYN3vGvcvVi3cyZJ6ofOkF6b3d08bsMRR22LvMIOpLyfOd1Nothke From: Hakan Berg When battery capacity was going below 1% fg is not supposed to report 0% unless we've got the LOW_BAT IRQ, no matter what the FG-algorithm says. This made fg get stuck at 1% if charger is connected when capacity is 1%. Signed-off-by: Hakan BERG Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Reviewed-by: Srinidhi KASAGAR --- drivers/power/ab8500_fg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 44d8faa..f596883 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -1354,9 +1354,6 @@ static void ab8500_fg_check_capacity_limits(struct ab8500_fg *di, bool init) * algorithm says. */ di->bat_cap.prev_percent = 1; - di->bat_cap.permille = 1; - di->bat_cap.prev_mah = 1; - di->bat_cap.mah = 1; percent = 1; changed = true; @@ -1768,9 +1765,10 @@ static void ab8500_fg_algorithm(struct ab8500_fg *di) ab8500_fg_algorithm_discharging(di); } - dev_dbg(di->dev, "[FG_DATA] %d %d %d %d %d %d %d %d %d " + dev_dbg(di->dev, "[FG_DATA] %d %d %d %d %d %d %d %d %d %d " "%d %d %d %d %d %d %d\n", di->bat_cap.max_mah_design, + di->bat_cap.max_mah, di->bat_cap.mah, di->bat_cap.permille, di->bat_cap.level,