From patchwork Thu Sep 27 20:08:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11775 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 2C34024148 for ; Thu, 27 Sep 2012 20:09:24 +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 D1D9BA18B18 for ; Thu, 27 Sep 2012 20:09:23 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:09:23 -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=oqyH7mkWc8zcvD+7dslqCAFVIEwO2Gj85rYLzx63H+o=; b=Vctfek1COrb3AqnNNCwCXgberYVRUs7jGXEqguMTyAAcfCCbgfLHkpQ5TlQIrUol2d MTw2614J3JLWjOUGorR3kFlpNro4gvGVKQvVSo4jAi2MgMronY/TYu7McDfSWCtGgWMt W8CuZj1hBWp5ApxnIwgCYOgIh/GCVrZs97VuXo4E+Pary9pF/Altc/GikTS1w0j5VytS tCOWfOLSbDIpPTNjWE0zVoI+Xo15IFqZXjM+9UPhqcMM6llt4y8HT5vKNlr6LNsah8uP dKFVC94JtNRonuLtSt8X4Jd80Ab3qRa8QEfSOiATqPX7WsRQvP98CsMfMpyrg6ByZ0LV zaLg== Received: by 10.42.110.130 with SMTP id q2mr3862152icp.53.1348776563586; Thu, 27 Sep 2012 13:09:23 -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 ex8csp436262igc; Thu, 27 Sep 2012 13:09:23 -0700 (PDT) Received: by 10.68.223.37 with SMTP id qr5mr14518880pbc.101.1348776562977; Thu, 27 Sep 2012 13:09:22 -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.09.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:22 -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:09:22 -0700 (PDT) Received: by 10.66.87.105 with SMTP id w9mr12175202paz.5.1348776562742; Thu, 27 Sep 2012 13:09:22 -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.09.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:22 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 02/57] power: ab8500_bm: Don't clear the CCMuxOffset bit Date: Thu, 27 Sep 2012 14:08:19 -0600 Message-Id: <1348776554-10019-3-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: ALoCoQkFmGTU0fZBPBlfijvn4Qnocs9XKgPL1dVxb9r5iSj5iif/K4V/05NcY52Si1TypwsLKlOo From: Kalle Komierowski The CCMuxOffset bit is not kept set, this will force the columb counter of the AB8500 to use the measure offset calibration. This should increase the accuracy of the fuel gauge. Signed-off-by: Kalle Komierowski Signed-off-by: Marcus Cooper Signed-off-by: Mathieu Poirier Reviewed-by: Jonas ABERG --- drivers/power/ab8500_fg.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index bf02225..af792a8 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -485,8 +485,9 @@ static int ab8500_fg_coulomb_counter(struct ab8500_fg *di, bool enable) di->flags.fg_enabled = true; } else { /* Clear any pending read requests */ - ret = abx500_set_register_interruptible(di->dev, - AB8500_GAS_GAUGE, AB8500_GASG_CC_CTRL_REG, 0); + ret = abx500_mask_and_set_register_interruptible(di->dev, + AB8500_GAS_GAUGE, AB8500_GASG_CC_CTRL_REG, + (RESET_ACCU | READ_REQ), 0); if (ret) goto cc_err; @@ -1404,8 +1405,7 @@ static void ab8500_fg_algorithm_discharging(struct ab8500_fg *di) sleep_time = di->bat->fg_params->init_timer; /* Discard the first [x] seconds */ - if (di->init_cnt > - di->bat->fg_params->init_discard_time) { + if (di->init_cnt > di->bat->fg_params->init_discard_time) { ab8500_fg_calc_cap_discharge_voltage(di, true); ab8500_fg_check_capacity_limits(di, true);