aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenny TC <jenny.tc@intel.com>2014-07-08 02:04:18 -0400
committerSebastian Reichel <sre@kernel.org>2014-07-18 17:40:23 -0400
commit6bb1d272d7c9f5dcfbb790d6aef47d8f82dccbf5 (patch)
tree77c0fd50a6960576082b0c9d3f7cb13bdac88864
parent193dcced049ceacc0cce1a512ad8a1e1a26eedad (diff)
power_supply: Add inlmt,iterm, min/max temp props
Add new power supply properties for input current, charge termination current, min and max temperature POWER_SUPPLY_PROP_TEMP_MIN - minimum operatable temperature POWER_SUPPLY_PROP_TEMP_MAX - maximum operatable temperature POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates the input current for a charging source. POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT - Charge termination current used to detect the end of charge condition Signed-off-by: Jenny TC <jenny.tc@intel.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--Documentation/power/power_supply_class.txt6
-rw-r--r--drivers/power/power_supply_sysfs.c4
-rw-r--r--include/linux/power_supply.h4
3 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 89a8816990ff..48cff881cb8a 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -118,6 +118,10 @@ relative, time-based measurements.
118CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger. 118CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger.
119CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the 119CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the
120power supply object. 120power supply object.
121INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates
122the current drawn from a charging source.
123CHARGE_TERM_CURRENT - Charge termination current used to detect the end of charge
124condition.
121 125
122CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger. 126CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
123CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the 127CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
@@ -140,6 +144,8 @@ TEMP_ALERT_MAX - maximum battery temperature alert.
140TEMP_AMBIENT - ambient temperature. 144TEMP_AMBIENT - ambient temperature.
141TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert. 145TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert.
142TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert. 146TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert.
147TEMP_MIN - minimum operatable temperature
148TEMP_MAX - maximum operatable temperature
143 149
144TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e. 150TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e.
145while battery powers a load) 151while battery powers a load)
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 44420d1e9094..750a20275664 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -167,6 +167,7 @@ static struct device_attribute power_supply_attrs[] = {
167 POWER_SUPPLY_ATTR(constant_charge_voltage_max), 167 POWER_SUPPLY_ATTR(constant_charge_voltage_max),
168 POWER_SUPPLY_ATTR(charge_control_limit), 168 POWER_SUPPLY_ATTR(charge_control_limit),
169 POWER_SUPPLY_ATTR(charge_control_limit_max), 169 POWER_SUPPLY_ATTR(charge_control_limit_max),
170 POWER_SUPPLY_ATTR(input_current_limit),
170 POWER_SUPPLY_ATTR(energy_full_design), 171 POWER_SUPPLY_ATTR(energy_full_design),
171 POWER_SUPPLY_ATTR(energy_empty_design), 172 POWER_SUPPLY_ATTR(energy_empty_design),
172 POWER_SUPPLY_ATTR(energy_full), 173 POWER_SUPPLY_ATTR(energy_full),
@@ -178,6 +179,8 @@ static struct device_attribute power_supply_attrs[] = {
178 POWER_SUPPLY_ATTR(capacity_alert_max), 179 POWER_SUPPLY_ATTR(capacity_alert_max),
179 POWER_SUPPLY_ATTR(capacity_level), 180 POWER_SUPPLY_ATTR(capacity_level),
180 POWER_SUPPLY_ATTR(temp), 181 POWER_SUPPLY_ATTR(temp),
182 POWER_SUPPLY_ATTR(temp_max),
183 POWER_SUPPLY_ATTR(temp_min),
181 POWER_SUPPLY_ATTR(temp_alert_min), 184 POWER_SUPPLY_ATTR(temp_alert_min),
182 POWER_SUPPLY_ATTR(temp_alert_max), 185 POWER_SUPPLY_ATTR(temp_alert_max),
183 POWER_SUPPLY_ATTR(temp_ambient), 186 POWER_SUPPLY_ATTR(temp_ambient),
@@ -189,6 +192,7 @@ static struct device_attribute power_supply_attrs[] = {
189 POWER_SUPPLY_ATTR(time_to_full_avg), 192 POWER_SUPPLY_ATTR(time_to_full_avg),
190 POWER_SUPPLY_ATTR(type), 193 POWER_SUPPLY_ATTR(type),
191 POWER_SUPPLY_ATTR(scope), 194 POWER_SUPPLY_ATTR(scope),
195 POWER_SUPPLY_ATTR(charge_term_current),
192 /* Properties of type `const char *' */ 196 /* Properties of type `const char *' */
193 POWER_SUPPLY_ATTR(model_name), 197 POWER_SUPPLY_ATTR(model_name),
194 POWER_SUPPLY_ATTR(manufacturer), 198 POWER_SUPPLY_ATTR(manufacturer),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index f2b76aeaf4e4..f3dea41dbcd2 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -120,6 +120,7 @@ enum power_supply_property {
120 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, 120 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
121 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, 121 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
122 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, 122 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
123 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
123 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 124 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
124 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 125 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
125 POWER_SUPPLY_PROP_ENERGY_FULL, 126 POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -131,6 +132,8 @@ enum power_supply_property {
131 POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */ 132 POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */
132 POWER_SUPPLY_PROP_CAPACITY_LEVEL, 133 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
133 POWER_SUPPLY_PROP_TEMP, 134 POWER_SUPPLY_PROP_TEMP,
135 POWER_SUPPLY_PROP_TEMP_MAX,
136 POWER_SUPPLY_PROP_TEMP_MIN,
134 POWER_SUPPLY_PROP_TEMP_ALERT_MIN, 137 POWER_SUPPLY_PROP_TEMP_ALERT_MIN,
135 POWER_SUPPLY_PROP_TEMP_ALERT_MAX, 138 POWER_SUPPLY_PROP_TEMP_ALERT_MAX,
136 POWER_SUPPLY_PROP_TEMP_AMBIENT, 139 POWER_SUPPLY_PROP_TEMP_AMBIENT,
@@ -142,6 +145,7 @@ enum power_supply_property {
142 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, 145 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
143 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ 146 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
144 POWER_SUPPLY_PROP_SCOPE, 147 POWER_SUPPLY_PROP_SCOPE,
148 POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
145 /* Properties of type `const char *' */ 149 /* Properties of type `const char *' */
146 POWER_SUPPLY_PROP_MODEL_NAME, 150 POWER_SUPPLY_PROP_MODEL_NAME,
147 POWER_SUPPLY_PROP_MANUFACTURER, 151 POWER_SUPPLY_PROP_MANUFACTURER,