From: "Pali Rohár" <pali.rohar@gmail.com>
To: Anton Vorontsov <cbouatmailru@gmail.com>,
Grazvydas Ignotas <notasas@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Rodolfo Giometti <giometti@linux.it>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] bq27x00_battery: Name of cycle count property
Date: Sat, 30 Apr 2011 23:59:35 +0200 [thread overview]
Message-ID: <BANLkTik8RDOP3Z2eYqQknEZXBNeWtvFLhw@mail.gmail.com> (raw)
This patch fix using correct property POWER_SUPPLY_PROP_CYCLE_COUNT
for cycle count instead POWER_SUPPLY_PROP_CHARGE_COUNTER
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
--- a/drivers/power/bq27x00_battery.c 2011-02-27 12:14:56.000000000 +0100
+++ b/drivers/power/bq27x00_battery.c 2011-04-30 23:50:19.000000000 +0200
@@ -4,6 +4,7 @@
* Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it>
* Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it>
* Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de>
+ * Copyright (C) 2011 Pali Rohár <pali.rohar@gmail.com>
*
* Based on a previous work by Copyright (C) 2008 Texas Instruments, Inc.
*
@@ -76,7 +77,7 @@ struct bq27x00_reg_cache {
int time_to_empty_avg;
int time_to_full;
int charge_full;
- int charge_counter;
+ int cycle_count;
int capacity;
int flags;
@@ -115,7 +116,7 @@ static enum power_supply_property bq27x0
POWER_SUPPLY_PROP_CHARGE_FULL,
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_COUNTER,
+ POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_ENERGY_NOW,
};
@@ -267,7 +268,7 @@ static void bq27x00_update(struct bq27x0
cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP);
cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF);
cache.charge_full = bq27x00_battery_read_lmd(di);
- cache.charge_counter = bq27x00_battery_read_cyct(di);
+ cache.cycle_count = bq27x00_battery_read_cyct(di);
if (!is_bq27500)
cache.current_now = bq27x00_read(di, BQ27x00_REG_AI, false);
@@ -496,8 +497,8 @@ static int bq27x00_battery_get_property(
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
ret = bq27x00_simple_value(di->charge_design_full, val);
break;
- case POWER_SUPPLY_PROP_CHARGE_COUNTER:
- ret = bq27x00_simple_value(di->cache.charge_counter, val);
+ case POWER_SUPPLY_PROP_CYCLE_COUNT:
+ ret = bq27x00_simple_value(di->cache.cycle_count, val);
break;
case POWER_SUPPLY_PROP_ENERGY_NOW:
ret = bq27x00_battery_energy(di, val);
--
Pali Rohár
pali.rohar@gmail.com
next reply other threads:[~2011-04-30 22:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 21:59 Pali Rohár [this message]
2011-05-20 15:51 ` [PATCH] bq27x00_battery: Name of cycle count property Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTik8RDOP3Z2eYqQknEZXBNeWtvFLhw@mail.gmail.com \
--to=pali.rohar@gmail.com \
--cc=cbouatmailru@gmail.com \
--cc=giometti@linux.it \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=notasas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).