From patchwork Wed Feb 11 11:36:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Looijmans X-Patchwork-Id: 5812331 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F34FBF440 for ; Wed, 11 Feb 2015 11:42:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B698520225 for ; Wed, 11 Feb 2015 11:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D78622021B for ; Wed, 11 Feb 2015 11:42:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbbBKLma (ORCPT ); Wed, 11 Feb 2015 06:42:30 -0500 Received: from atl4mhfb03.myregisteredsite.com ([209.17.115.61]:35727 "EHLO atl4mhfb03.myregisteredsite.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbbBKLm3 (ORCPT ); Wed, 11 Feb 2015 06:42:29 -0500 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Feb 2015 06:42:27 EST Received: from atl4mhob12.myregisteredsite.com (atl4mhob12.myregisteredsite.com [209.17.115.50]) by atl4mhfb03.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id t1BBbQtZ026788 for ; Wed, 11 Feb 2015 06:37:26 -0500 Received: from mailpod.hostingplatform.com ([10.30.71.206]) by atl4mhob12.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id t1BBbNc5021395 for ; Wed, 11 Feb 2015 06:37:23 -0500 Received: (qmail 32292 invoked by uid 0); 11 Feb 2015 11:37:23 -0000 X-TCPREMOTEIP: 88.159.208.100 X-Authenticated-UID: mike@milosoftware.com Received: from unknown (HELO mikebuntu.TOPIC.LOCAL) (mike@milosoftware.com@88.159.208.100) by 0 with ESMTPA; 11 Feb 2015 11:37:23 -0000 From: Mike Looijmans To: sre@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, Mike Looijmans Subject: [PATCH] ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85) Date: Wed, 11 Feb 2015 12:36:51 +0100 Message-Id: <1423654611-10906-1-git-send-email-mike.looijmans@topic.nl> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver reported 30% less than actually measured. This turned out to be caused by a simple typo in the formula to calculate the LSB quantity. Signed-off-by: Mike Looijmans --- drivers/power/ltc2941-battery-gauge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/ltc2941-battery-gauge.c b/drivers/power/ltc2941-battery-gauge.c index e4a9c87..784ff0b 100644 --- a/drivers/power/ltc2941-battery-gauge.c +++ b/drivers/power/ltc2941-battery-gauge.c @@ -439,7 +439,7 @@ static int ltc294x_i2c_probe(struct i2c_client *client, } else { if (prescaler_exp > LTC2941_MAX_PRESCALER_EXP) prescaler_exp = LTC2941_MAX_PRESCALER_EXP; - info->Qlsb = ((58 * 50000) / r_sense) / + info->Qlsb = ((85 * 50000) / r_sense) / (128 / (1 << prescaler_exp)); }