From patchwork Fri Feb 15 12:45:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14883 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 28E8B23E2E for ; Fri, 15 Feb 2013 12:47:25 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by fiordland.canonical.com (Postfix) with ESMTP id D3B06A197C5 for ; Fri, 15 Feb 2013 12:47:24 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id m8so2103486vcd.37 for ; Fri, 15 Feb 2013 04:47:24 -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=nTWWRkBUqWrRiP1oiQ9DXE1BN5Q1Q5wTqfu9cdu/QPo=; b=pC4zRgIO58WrjpX56L6mv+hCOnXuFO/IF79ZuvcYeYHeGf0UmS00R95JCMULwoCD+p 0Cp2q3YZ5kJ2k9+P97VLjUrcFCK7teA0N80ofnnJBqxLP401YtqXr4cpgOelVSRezwQA xgrxdgYQ/9Z7iT/5hV+8Qq/YmFO91ncfyPBcUIgDSXRioNrv90WZ8z4Qbqy7eBMX+jCT FiLXSZYJ9e5GfncYcv+ZYY2l74Lm8ZKF+bzgnRlaJTea2eC6dKSZ+Wh6SNR7ZJM2XnES BAo8MKHN+E3HhlC3ZXjqYvfLXU8m9kEn3hNoRm5dkOA089cl0C7obAEmz5/dZRoPLYfm Zd1w== X-Received: by 10.220.220.134 with SMTP id hy6mr2979776vcb.2.1360932444279; Fri, 15 Feb 2013 04:47:24 -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 oa5csp10929vcb; Fri, 15 Feb 2013 04:47:20 -0800 (PST) X-Received: by 10.180.79.6 with SMTP id f6mr5636706wix.26.1360932428180; Fri, 15 Feb 2013 04:47:08 -0800 (PST) Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by mx.google.com with ESMTPS id y6si193935wix.93.2013.02.15.04.47.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:47:08 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22a; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::22a 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-wi0-f170.google.com with SMTP id hm11so1279311wib.3 for ; Fri, 15 Feb 2013 04:47:07 -0800 (PST) X-Received: by 10.180.94.69 with SMTP id da5mr5581255wib.30.1360932427044; Fri, 15 Feb 2013 04:47:07 -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.47.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:47:06 -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, lme00437 , Benoit GAUTHIER , Lee Jones Subject: [PATCH 39/40] ab8500-fg: Change current calculation Date: Fri, 15 Feb 2013 12:45:09 +0000 Message-Id: <1360932310-30065-40-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: ALoCoQnOgEq6NqB4NXuWx7/qxipUCb8jItB3lgL0jKsHWhO91SgVJt1OKs+vC2H+sg+X5ArgyePP From: lme00437 This patch updates the gas gauge constant for electric current calculation according to hardware specification. Signed-off-by: Benoit GAUTHIER Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Reviewed-by: Philippe LANGLAIS Tested-by: Benoit GAUTHIER --- drivers/power/ab8500_fg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 7de5333..4968061 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -36,7 +36,7 @@ #define MILLI_TO_MICRO 1000 #define FG_LSB_IN_MA 1627 -#define QLSB_NANO_AMP_HOURS_X10 1129 +#define QLSB_NANO_AMP_HOURS_X10 1071 #define INS_CURR_TIMEOUT (3 * HZ) #define SEC_TO_SAMPLE(S) (S * 4) @@ -672,11 +672,11 @@ int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res) /* * Convert to unit value in mA * Full scale input voltage is - * 66.660mV => LSB = 66.660mV/(4096*res) = 1.627mA + * 63.160mV => LSB = 63.160mV/(4096*res) = 1.542mA * Given a 250ms conversion cycle time the LSB corresponds - * to 112.9 nAh. Convert to current by dividing by the conversion + * to 107.1 nAh. Convert to current by dividing by the conversion * time in hours (250ms = 1 / (3600 * 4)h) - * 112.9nAh assumes 10mOhm, but fg_res is in 0.1mOhm + * 107.1nAh assumes 10mOhm, but fg_res is in 0.1mOhm */ val = (val * QLSB_NANO_AMP_HOURS_X10 * 36 * 4) / (1000 * di->bm->fg_res);