[BATTERY] Update properties list.

David Woodhouse dwmw2 at infradead.org
Tue Nov 7 22:38:28 EST 2006


Commit:     0195ef745141d018b842b43dc4c33e6adb710073
Parent:     a32c64abd76ded9d5768953863647cc76290d2bb
commit 0195ef745141d018b842b43dc4c33e6adb710073
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Wed Oct 25 18:27:01 2006 +0300
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Wed Oct 25 18:27:01 2006 +0300

    [BATTERY] Update properties list.
    
    Follow suggestions from Shem Multinymous.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/battery/olpc-battery.c |    2 +-
 include/linux/battery.h        |   48 +++++++++++++++++++++++-----------------
 2 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/battery/olpc-battery.c b/drivers/battery/olpc-battery.c
index 3eb3cb3..d270a2e 100644
--- a/drivers/battery/olpc-battery.c
+++ b/drivers/battery/olpc-battery.c
@@ -183,7 +183,7 @@ static struct olpc_bat_attr_int attrs_in
 	ATTR_INT(BAT_INFO_CURRENT, wBAT_CURRENT, 15625, 120000),
 	ATTR_INT(BAT_INFO_TEMP1, wBAT_TEMP, 1000, 256),
 	ATTR_INT(BAT_INFO_TEMP2, wAMB_TEMP, 1000, 256),
-	ATTR_INT(BAT_INFO_CHARGE_PCT, SOC, 1, 1)
+	ATTR_INT(BAT_INFO_CAP_PCT, SOC, 1, 1)
 };
 
 /*********************************************************************
diff --git a/include/linux/battery.h b/include/linux/battery.h
index 679e2c8..2f856a0 100644
--- a/include/linux/battery.h
+++ b/include/linux/battery.h
@@ -37,9 +37,8 @@ #define BAT_STAT_CHARGE_DONE	(1<<8)
 
 /* Thou shalt not export any attributes in sysfs except these, and
    with these units: */
-#define BAT_INFO_STATUS		"status"		/* For AC: "on-line" or "off-line" */
-							/* For battery: ... */
-
+#define BAT_INFO_STATUS		"status"		/* Not free-form. Use
+							   provided function */
 #define BAT_INFO_TEMP1		"temp1"			/* °C/1000 */
 #define BAT_INFO_TEMP1_NAME	"temp1_name"		/* string */
 
@@ -47,22 +46,31 @@ #define BAT_INFO_TEMP2		"temp2"			/* °C
 #define BAT_INFO_TEMP2_NAME	"temp2_name"		/* string */
 
 #define BAT_INFO_VOLTAGE	"voltage"		/* mV */
-#define BAT_INFO_VOLTAGE_DESIGN	"design_voltage"	/* mV */
+#define BAT_INFO_VOLTAGE_DESIGN	"voltage_design"	/* mV */
 
 #define BAT_INFO_CURRENT	"current"		/* mA */
-#define BAT_INFO_AVG_CURRENT	"current_avg"		/* mA */
-
-#define BAT_INFO_CHARGE_RATE	"charge_rate"		/* CHARGE_UNITS */
-#define BAT_INFO_CHARGE		"charge"		/* CHARGE_UNITS*h */
-#define BAT_INFO_CHARGE_MAX	"design_charge"		/* CHARGE_UNITS*h */
-#define BAT_INFO_CHARGE_LAST	"charge_last"		/* CHARGE_UNITS*h */
-#define BAT_INFO_CHARGE_LOW	"charge_low_thresh"	/* CHARGE_UNITS*h */
-#define BAT_INFO_CHARGE_WARN	"charge_warn_thresh"	/* CHARGE_UNITS*h */
-#define BAT_INFO_CHARGE_UNITS	"charge_units"		/* string */
-
-#define BAT_INFO_CHARGE_PCT	"charge_percentage"	/* integer */
-
-#define BAT_INFO_TIME_REMAINING	"time_remaining"	/* seconds */
+#define BAT_INFO_CURRENT_NOW	"current_now"		/* mA */
+
+#define BAT_INFO_POWER		"power"			/* mW */
+#define BAT_INFO_POWER_NOW	"power_now"		/* mW */
+
+/* The following capacity/charge properties are represented in either
+   mA or mW. The CAP_UNITS property MUST be provided if any of these are. */
+#define BAT_INFO_RATE		"rate"			/* CAP_UNITS */
+#define BAT_INFO_CAP_LEFT	"capacity_left"		/* CAP_UNITS*h */
+#define BAT_INFO_CAP_DESIGN	"capacity_design"	/* CAP_UNITS*h */
+#define BAT_INFO_CAP_LAST_FULL	"capacity_last_full"	/* CAP_UNITS*h */
+#define BAT_INFO_CAP_LOW	"capacity_low_thresh"	/* CAP_UNITS*h */
+#define BAT_INFO_CAP_WARN	"capacity_warn_thresh"	/* CAP_UNITS*h */
+#define BAT_INFO_CAP_UNITS	"capacity_units"	/* string: must be
+							   either mA or mW */
+	
+#define BAT_INFO_CAP_PCT	"capacity_percentage"	/* integer */
+
+#define BAT_INFO_TIME_EMPTY	"time_to_empty"		/* seconds */
+#define BAT_INFO_TIME_EMPTY_NOW	"time_to_empty_now"	/* seconds */
+#define BAT_INFO_TIME_FULL	"time_to_full"		/* seconds */
+#define BAT_INFO_TIME_FULL_NOW	"time_to_full_now"	/* seconds */
 
 #define BAT_INFO_MANUFACTURER	"manufacturer"		/* string */
 #define BAT_INFO_TECHNOLOGY	"technology"		/* string */
@@ -70,9 +78,9 @@ #define BAT_INFO_MODEL		"model"			/* str
 #define BAT_INFO_SERIAL		"serial"		/* string */
 #define BAT_INFO_OEM_INFO	"oem_info"		/* string */
 
-#define BAT_INFO_CHARGE_COUNT	"charge_count"		/* integer */
-#define BAT_INFO_MFR_DATE	"manufacture_date"	/* YYYY[-MM[-DD]] */
-#define BAT_INFO_FIRST_USE	"first_use"		/* YYYY[-MM[-DD]] */
+#define BAT_INFO_CYCLE_COUNT	"cycle_count"		/* integer */
+#define BAT_INFO_DATE_MFR	"date_manufactured"	/* YYYY[-MM[-DD]] */
+#define BAT_INFO_DATE_FIRST_USE	"date_first_use"	/* YYYY[-MM[-DD]] */
 
 struct battery_dev {
 	int			status_cap;


More information about the Commits-kernel mailing list