From patchwork Mon Sep 14 21:26:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 7178501 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 D1383BEEC1 for ; Mon, 14 Sep 2015 21:26:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E001A20639 for ; Mon, 14 Sep 2015 21:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E714020635 for ; Mon, 14 Sep 2015 21:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710AbbINV0q (ORCPT ); Mon, 14 Sep 2015 17:26:46 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45046 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469AbbINV0p (ORCPT ); Mon, 14 Sep 2015 17:26:45 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8ELQgfX008620; Mon, 14 Sep 2015 16:26:42 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8ELQg8L008421; Mon, 14 Sep 2015 16:26:42 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 14 Sep 2015 16:26:42 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8ELQgBN025751; Mon, 14 Sep 2015 16:26:42 -0500 Received: from localhost (uda0226330.am.dhcp.ti.com [128.247.8.252]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id t8ELQg923561; Mon, 14 Sep 2015 16:26:42 -0500 (CDT) From: "Andrew F. Davis" To: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse CC: Dan Murphy , , , "Andrew F. Davis" Subject: [PATCH v4 4/7] power: bq27xxx_battery: Fix typos and change naming for state of charge functions Date: Mon, 14 Sep 2015 16:26:10 -0500 Message-ID: <1442265973-32261-5-git-send-email-afd@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442265973-32261-1-git-send-email-afd@ti.com> References: <1442265973-32261-1-git-send-email-afd@ti.com> MIME-Version: 1.0 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 Fix typos and change "relative state of charge" to "state of charge" as not all supported devices use relative state of charge. Signed-off-by: Andrew F. Davis Acked-by: Pali Rohár --- drivers/power/bq27xxx_battery.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c index 0734413..1ff88ad 100644 --- a/drivers/power/bq27xxx_battery.c +++ b/drivers/power/bq27xxx_battery.c @@ -229,26 +229,26 @@ static bool bq27xxx_is_chip_version_higher(struct bq27xxx_device_info *di) } /* - * Return the battery Relative State-of-Charge + * Return the battery State-of-Charge * Or < 0 if something fails. */ -static int bq27xxx_battery_read_rsoc(struct bq27xxx_device_info *di) +static int bq27xxx_battery_read_soc(struct bq27xxx_device_info *di) { - int rsoc; + int soc; if (di->chip == BQ27500 || di->chip == BQ27742) - rsoc = bq27xxx_read(di, BQ27500_REG_SOC, false); + soc = bq27xxx_read(di, BQ27500_REG_SOC, false); else if (di->chip == BQ27510) - rsoc = bq27xxx_read(di, BQ27510_REG_SOC, false); + soc = bq27xxx_read(di, BQ27510_REG_SOC, false); else if (di->chip == BQ27425) - rsoc = bq27xxx_read(di, BQ27425_REG_SOC, false); - else - rsoc = bq27xxx_read(di, BQ27000_REG_RSOC, true); + soc = bq27xxx_read(di, BQ27425_REG_SOC, false); + else /* for the bq27000 we read the "relative" SoC register */ + soc = bq27xxx_read(di, BQ27000_REG_RSOC, true); - if (rsoc < 0) - dev_dbg(di->dev, "error reading relative State-of-Charge\n"); + if (soc < 0) + dev_dbg(di->dev, "error reading State-of-Charge\n"); - return rsoc; + return soc; } /* @@ -275,7 +275,7 @@ static int bq27xxx_battery_read_charge(struct bq27xxx_device_info *di, u8 reg) } /* - * Return the battery Nominal available capaciy in µAh + * Return the battery Nominal available capacity in µAh * Or < 0 if something fails. */ static inline int bq27xxx_battery_read_nac(struct bq27xxx_device_info *di) @@ -416,7 +416,7 @@ static int bq27xxx_battery_read_time(struct bq27xxx_device_info *di, u8 reg) } /* - * Read a power avg register. + * Read an average power register. * Return < 0 if something fails. */ static int bq27xxx_battery_read_pwr_avg(struct bq27xxx_device_info *di, u8 reg) @@ -498,7 +498,7 @@ static void bq27xxx_battery_update(struct bq27xxx_device_info *di) cache.charge_full = -ENODATA; cache.health = -ENODATA; } else { - cache.capacity = bq27xxx_battery_read_rsoc(di); + cache.capacity = bq27xxx_battery_read_soc(di); if (is_bq27742 || is_bq27510) cache.time_to_empty = bq27xxx_battery_read_time(di,