From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Len Brown <lenb@kernel.org>
Cc: Linux-acpi@vger.kernel.org
Subject: [PATCH 3/4] ACPI: SBS: Export cycle_count
Date: Thu, 15 Oct 2009 14:31:37 +0400 [thread overview]
Message-ID: <20091015103137.3853.65255.stgit@thinkpad> (raw)
In-Reply-To: <20091015103122.3853.34760.stgit@thinkpad>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/sbs.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 52b9db8..38412ec 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -217,6 +217,9 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_TECHNOLOGY:
val->intval = acpi_battery_technology(battery);
break;
+ case POWER_SUPPLY_PROP_CYCLE_COUNT:
+ val->intval = battery->cycle_count;
+ break;
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
val->intval = battery->design_voltage *
acpi_battery_vscale(battery) * 1000;
@@ -276,6 +279,7 @@ static enum power_supply_property sbs_charge_battery_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_TECHNOLOGY,
+ POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_CURRENT_NOW,
@@ -560,6 +564,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
battery->design_voltage * acpi_battery_vscale(battery));
seq_printf(seq, "design capacity warning: unknown\n");
seq_printf(seq, "design capacity low: unknown\n");
+ seq_printf(seq, "cycle count: %i\n", battery->cycle_count);
seq_printf(seq, "capacity granularity 1: unknown\n");
seq_printf(seq, "capacity granularity 2: unknown\n");
seq_printf(seq, "model number: %s\n", battery->device_name);
next prev parent reply other threads:[~2009-10-15 10:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-15 10:31 [PATCH 1/4] ACPI: Battery: Add bit flags Alexey Starikovskiy
2009-10-15 10:31 ` [PATCH 2/4] POWER: Add support for cycle_count Alexey Starikovskiy
2010-01-15 21:59 ` Len Brown
2009-10-15 10:31 ` Alexey Starikovskiy [this message]
2010-01-15 21:59 ` [PATCH 3/4] ACPI: SBS: Export cycle_count Len Brown
2009-10-15 10:31 ` [PATCH 4/4] ACPI: Battery: Add support for _BIX extended info method Alexey Starikovskiy
2009-10-16 9:08 ` Alan Jenkins
2009-10-16 9:46 ` [PATCH] " Alexey Starikovskiy
2009-10-17 15:41 ` [PATCH 4/4] " Henrique de Moraes Holschuh
2010-03-14 22:15 ` Alexey Starikovskiy
2010-03-15 11:38 ` Henrique de Moraes Holschuh
2010-03-15 20:17 ` Alexey Starikovskiy
2010-03-16 0:12 ` Henrique de Moraes Holschuh
2010-01-15 22:03 ` Len Brown
2010-01-15 21:59 ` [PATCH 1/4] ACPI: Battery: Add bit flags Len Brown
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=20091015103137.3853.65255.stgit@thinkpad \
--to=astarikovskiy@suse.de \
--cc=Linux-acpi@vger.kernel.org \
--cc=lenb@kernel.org \
/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).