summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-04-01 10:48:01 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-06 12:06:23 -0700
commit4e468402df857c050dc5ebb287411d14fae5221d (patch)
tree4f6b8c7061d1066c288023b298e077119e8654bf
parent27f3e78625e59e1b31d8e4f08ff23e142295189e (diff)
power_supply: add INPUT_SUSPEND power supply property
POWER_SUPPLY_PROP_CHARGING_ENABLED has been used to indicate enabling the charge path in some drivers and enabling the input path in others. This leads to confusion of what charging enabled really means. POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED was introduced to indicate enabling the charge path, and in this case POWER_SUPPLY_PROP_CHARGING_ENABLED is used to indicate enabling the input path. Since these are similarly named it leads to even more confusion. In an attempt to fix this confusion we introduce a new power supply property POWER_SUPPLY_PROP_INPUT_SUSPEND which indicates suspending the input path of the power supply. POWER_SUPPLY_PROP_CHARGING_ENABLED takes its original definition of enabling the charge path. Then POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED will be retired from use. CRs-Fixed: 1005389 Change-Id: I1ca8f5748a56a9395caa8ed8ed18f70e69f0cbe8 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
-rw-r--r--drivers/power/power_supply_sysfs.c1
-rw-r--r--include/linux/power_supply.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index f42f1b0d0874..61f611296ad6 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -228,6 +228,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(charge_enabled),
POWER_SUPPLY_ATTR(battery_charging_enabled),
POWER_SUPPLY_ATTR(charging_enabled),
+ POWER_SUPPLY_ATTR(input_suspend),
POWER_SUPPLY_ATTR(input_voltage_regulation),
POWER_SUPPLY_ATTR(input_current_max),
POWER_SUPPLY_ATTR(input_current_trim),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 6ccfe7a8de41..b081a56e250f 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -177,6 +177,7 @@ enum power_supply_property {
POWER_SUPPLY_PROP_CHARGE_ENABLED,
POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED,
POWER_SUPPLY_PROP_CHARGING_ENABLED,
+ POWER_SUPPLY_PROP_INPUT_SUSPEND,
POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION,
POWER_SUPPLY_PROP_INPUT_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM,