[PATCH 1/3] power: add two properties: charge_to_use and voltage_to_use

From: Philip Rakity
Date: Mon Aug 29 2011 - 13:06:49 EST



Add two new properties
a) POWER_SUPPLY_PROP_VOLTAGE_TO_USE
b) POWER_SUPPLY_PROP_CHARGE_TO_USE

These 2 properties can be returned by the battery to
tell the charger what voltage and charge to use.

Signed-off-by: Philip Rakity <prakity@xxxxxxxxxxx>
---
drivers/power/power_supply_sysfs.c | 2 ++
include/linux/power_supply.h | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index c9e9479..bffc67b 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -167,6 +167,8 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(time_to_full_now),
POWER_SUPPLY_ATTR(time_to_full_avg),
POWER_SUPPLY_ATTR(type),
+ POWER_SUPPLY_ATTR(charge_to_use),
+ POWER_SUPPLY_ATTR(voltage_to_use),
/* Properties of type `const char *' */
POWER_SUPPLY_ATTR(model_name),
POWER_SUPPLY_ATTR(manufacturer),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 204c18d..a41b510 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -116,6 +116,8 @@ enum power_supply_property {
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
+ POWER_SUPPLY_PROP_CHARGE_TO_USE,
+ POWER_SUPPLY_PROP_VOLTAGE_TO_USE,
/* Properties of type `const char *' */
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
@@ -228,6 +230,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
case POWER_SUPPLY_PROP_CURRENT_MAX:
case POWER_SUPPLY_PROP_CURRENT_NOW:
case POWER_SUPPLY_PROP_CURRENT_AVG:
+ case POWER_SUPPLY_PROP_CHARGE_TO_USE:
return 1;
default:
break;
@@ -252,6 +255,7 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
case POWER_SUPPLY_PROP_VOLTAGE_AVG:
case POWER_SUPPLY_PROP_POWER_NOW:
+ case POWER_SUPPLY_PROP_VOLTAGE_TO_USE:
return 1;
default:
break;
--
1.7.6


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/