power_supply: Add support for CHARGE_CONTROL_* attributes
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>
Tue, 9 Oct 2012 16:55:29 +0000 (22:25 +0530)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Sun, 18 Nov 2012 04:21:43 +0000 (20:21 -0800)
Add support for power supply attributes CHARGE_CONTROL_LIMIT
and CHARGE_CONTROL_LIMIT_MAX.

These new attributes will enable the user space to implement
custom charging algorithms based on platform state.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Documentation/power/power_supply_class.txt
drivers/power/power_supply_sysfs.c
include/linux/power_supply.h

index 9c647bd7c5a9cf108746647b8f97ec4b70afe1ab..3f10b39b034639cd558e080d289ed361c7ea63f7 100644 (file)
@@ -123,6 +123,9 @@ CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
 CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
 power supply object.
 
+CHARGE_CONTROL_LIMIT - current charge control limit setting
+CHARGE_CONTROL_LIMIT_MAX - maximum charge control limit setting
+
 ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
 
 CAPACITY - capacity in percents.
index 395c2cfa16c0bbd3bb200b31f5d2de343e2cd7e3..40fa3b7cae548033d0d69e358574326e11a8f22c 100644 (file)
@@ -164,6 +164,8 @@ static struct device_attribute power_supply_attrs[] = {
        POWER_SUPPLY_ATTR(constant_charge_current_max),
        POWER_SUPPLY_ATTR(constant_charge_voltage),
        POWER_SUPPLY_ATTR(constant_charge_voltage_max),
+       POWER_SUPPLY_ATTR(charge_control_limit),
+       POWER_SUPPLY_ATTR(charge_control_limit_max),
        POWER_SUPPLY_ATTR(energy_full_design),
        POWER_SUPPLY_ATTR(energy_empty_design),
        POWER_SUPPLY_ATTR(energy_full),
index e5ef45834c3c415e05af46d66b0d38599c12ec85..445b4b249af5ffb116680442a697df953f4bdd82 100644 (file)
@@ -114,6 +114,8 @@ enum power_supply_property {
        POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
        POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
        POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
+       POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
+       POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
        POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
        POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
        POWER_SUPPLY_PROP_ENERGY_FULL,