From patchwork Thu Sep 27 20:08:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11815 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 4EDBC24140 for ; Thu, 27 Sep 2012 20:10:19 +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 F1834A18351 for ; Thu, 27 Sep 2012 20:10:18 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:10:18 -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=kcS0vWlhROW9PC2ytmFNIvZYzh0OOJwdQNFXu49LUvM=; b=b+KRoB5xS1p8D2BA5LFJD5bxUbng2E/LCCkUwzldWfOX7fbBwGkkKkyYKYGKHrowo7 FOUTlcfYiWsXOKoJ9vSr8H8NCGr39FxcmPZN7zwgmirgemIZj6jPE9ylfDUZhZeDtVtw X6IQSQc+T4VFiCtKjXS0CCOO1A4z0ODHMaujvN4/+XMoZoaF2aXUWIWSuo0rZp+aCSgX 6eLzRNNw5i9BrBSYoJ+sb5ji6RFU+bUL92tRTjGwPiEsomNct49yDJgamAUiRsXWXYHe rDYdHMxlpQPQYhnQWZq4rhJ/0HNn24130LandpYc2wn+fTEQEAJY3laMZnww6SnO2NXI F3ew== Received: by 10.50.150.198 with SMTP id uk6mr4651420igb.43.1348776618734; Thu, 27 Sep 2012 13:10:18 -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 ex8csp436374igc; Thu, 27 Sep 2012 13:10:18 -0700 (PDT) Received: by 10.68.129.233 with SMTP id nz9mr14436251pbb.136.1348776617995; Thu, 27 Sep 2012 13:10:17 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pi9si5467641pbb.12.2012.09.27.13.10.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.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-pb0-f50.google.com with SMTP id md4so1686045pbc.37 for ; Thu, 27 Sep 2012 13:10:17 -0700 (PDT) Received: by 10.66.90.38 with SMTP id bt6mr12136275pab.53.1348776617707; Thu, 27 Sep 2012 13:10:17 -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.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:17 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 42/57] power: charging: Allow capacity to raise from 1% Date: Thu, 27 Sep 2012 14:08:59 -0600 Message-Id: <1348776554-10019-43-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: ALoCoQnHJ4wRqO4oWruWMYaGfYqkZ52UIof99WK3jMC88j0eAXzJTkKHXjIyx98aQx6JdQkv5/kn From: Hakan Berg When battery capacity was going below 1% fg in 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%. That problem is addressed with this patch. Signed-off-by: Hakan BERG Signed-off-by: Mathieu Poirier Reviewed-by: Marcus COOPER Reviewed-by: Srinidhi KASAGAR --- drivers/power/ab8500_fg.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index c5732e7..cf6d2b5 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -1357,9 +1357,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; @@ -1771,9 +1768,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,