Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: core: Add power_supply_prop_precharge

Battery chargers use POWER_SUPPLY_PROP_PRECHARGE_CURRENT
Clarify related item POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT

Signed-off-by: Liam Breck <kernel@networkimprov.net>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

authored by

Liam Breck and committed by
Sebastian Reichel
413de34a c08b1f45

+16 -7
+12 -7
Documentation/power/power_supply_class.txt
··· 115 115 charge when battery considered full/empty at given conditions (temperature, 116 116 age)". I.e. these attributes represents real thresholds, not design values. 117 117 118 + ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. 119 + 118 120 CHARGE_COUNTER - the current charge counter (in µAh). This could easily 119 121 be negative; there is no empty or full value. It is only useful for 120 122 relative, time-based measurements. 121 123 124 + PRECHARGE_CURRENT - the maximum charge current during precharge phase 125 + of charge cycle (typically 20% of battery capacity). 126 + CHARGE_TERM_CURRENT - Charge termination current. The charge cycle 127 + terminates when battery voltage is above recharge threshold, and charge 128 + current is below this setting (typically 10% of battery capacity). 129 + 122 130 CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger. 123 131 CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the 124 132 power supply object. 125 - INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates 126 - the current drawn from a charging source. 127 - CHARGE_TERM_CURRENT - Charge termination current used to detect the end of charge 128 - condition. 129 - 130 - CALIBRATE - battery or coulomb counter calibration status 131 133 132 134 CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger. 133 135 CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the 134 136 power supply object. 135 137 138 + INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates 139 + the current drawn from a charging source. 140 + 136 141 CHARGE_CONTROL_LIMIT - current charge control limit setting 137 142 CHARGE_CONTROL_LIMIT_MAX - maximum charge control limit setting 138 143 139 - ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. 144 + CALIBRATE - battery or coulomb counter calibration status 140 145 141 146 CAPACITY - capacity in percents. 142 147 CAPACITY_ALERT_MIN - minimum capacity alert value in percents.
+1
drivers/power/supply/power_supply_sysfs.c
··· 242 242 POWER_SUPPLY_ATTR(time_to_full_avg), 243 243 POWER_SUPPLY_ATTR(type), 244 244 POWER_SUPPLY_ATTR(scope), 245 + POWER_SUPPLY_ATTR(precharge_current), 245 246 POWER_SUPPLY_ATTR(charge_term_current), 246 247 POWER_SUPPLY_ATTR(calibrate), 247 248 /* Properties of type `const char *' */
+3
include/linux/power_supply.h
··· 146 146 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, 147 147 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ 148 148 POWER_SUPPLY_PROP_SCOPE, 149 + POWER_SUPPLY_PROP_PRECHARGE_CURRENT, 149 150 POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, 150 151 POWER_SUPPLY_PROP_CALIBRATE, 151 152 /* Properties of type `const char *' */ ··· 383 382 case POWER_SUPPLY_PROP_CHARGE_NOW: 384 383 case POWER_SUPPLY_PROP_CHARGE_AVG: 385 384 case POWER_SUPPLY_PROP_CHARGE_COUNTER: 385 + case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: 386 + case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: 386 387 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: 387 388 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: 388 389 case POWER_SUPPLY_PROP_CURRENT_MAX: