From patchwork Thu Oct 15 10:31:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Starikovskiy X-Patchwork-Id: 54006 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9FAWS0Y026793 for ; Thu, 15 Oct 2009 10:32:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757117AbZJOKcQ (ORCPT ); Thu, 15 Oct 2009 06:32:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758094AbZJOKcQ (ORCPT ); Thu, 15 Oct 2009 06:32:16 -0400 Received: from charybdis-ext.suse.de ([195.135.221.2]:37217 "EHLO emea5-mh.id5.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757117AbZJOKcP (ORCPT ); Thu, 15 Oct 2009 06:32:15 -0400 Received: from [127.0.1.1] ([149.44.162.75]) by emea5-mh.id5.novell.com with ESMTP; Thu, 15 Oct 2009 12:31:38 +0200 From: Alexey Starikovskiy To: Len Brown Cc: Linux-acpi@vger.kernel.org Subject: [PATCH 3/4] ACPI: SBS: Export cycle_count Date: Thu, 15 Oct 2009 14:31:37 +0400 Message-ID: <20091015103137.3853.65255.stgit@thinkpad> In-Reply-To: <20091015103122.3853.34760.stgit@thinkpad> References: <20091015103122.3853.34760.stgit@thinkpad> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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);