diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:08:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:08:25 -0400 |
commit | 4b24ff71108164e047cf2c95990b77651163e315 (patch) | |
tree | 4b478906379adf22ff259fc1f2cce0da796df415 /include | |
parent | bca1a5c0eabe0f17081760c61e8d08e73dd6b6a6 (diff) | |
parent | 4b1bf5871f7d59de6484cc887e205d6d2f1e6fbd (diff) |
Merge tag 'for-v3.6' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov:
"The tag contains just a few battery-related changes for v3.6. It's is
all pretty straightforward, except one thing.
One of our patches added thermal support for power supply class, but
thermal/ subsystem changed under our feet. We (well, Stephen, that
is) caught the issue and it was decided[1] that I'd just delay the
battery pull request, and then will fix it up by merging upstream back
into battery tree at the specific commit.
That's not all though: another[2] small fixup for thermal subsystem
was needed to get rid of a warning in power supply subsystem (the
warning was not drivers/power's "fault", the thermal registration
function just needed a proper const annotation, which is also done by
a small commit on top of the merge.
So, to sum this up:
- The 'master' branch of the battery tree was in the -next tree for
weeks, was never rebased, altered etc. It should be all OK;
- Although, for-v3.6 tag contains the 'master' branch + merge + the
warning fix.
[1] http://lkml.org/lkml/2012/6/19/23
[2] http://lkml.org/lkml/2012/6/18/28"
* tag 'for-v3.6' of git://git.infradead.org/battery-2.6: (23 commits)
thermal: Constify 'type' argument for the registration routine
olpc-battery: update CHARGE_FULL_DESIGN property for BYD LiFe batteries
olpc-battery: Add VOLTAGE_MAX_DESIGN property
charger-manager: Fix build break related to EXTCON
lp8727_charger: Move header file into platform_data directory
power_supply: Add min/max alert properties for CAPACITY, TEMP, TEMP_AMBIENT
bq27x00_battery: Add support for BQ27425 chip
charger-manager: Set current limit of regulator for over current protection
charger-manager: Use EXTCON Subsystem to detect charger cables for charging
test_power: Add VOLTAGE_NOW and BATTERY_TEMP properties
test_power: Add support for USB AC source
gpio-charger: Use cansleep version of gpio_set_value
bq27x00_battery: Add support for power average and health properties
sbs-battery: Don't trigger false supply_changed event
twl4030_charger: Allow charger to control the regulator that feeds it
twl4030_charger: Add backup-battery charging
twl4030_charger: Fix some typos
max17042_battery: Support CHARGE_COUNTER power supply attribute
smb347-charger: Add constant charge and current properties
power_supply: Add constant charge_current and charge_voltage properties
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c/twl.h | 2 | ||||
-rw-r--r-- | include/linux/platform_data/lp8727.h (renamed from include/linux/lp8727.h) | 0 | ||||
-rw-r--r-- | include/linux/power/charger-manager.h | 67 | ||||
-rw-r--r-- | include/linux/power_supply.h | 13 | ||||
-rw-r--r-- | include/linux/thermal.h | 2 |
5 files changed, 82 insertions, 2 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 555382660bc4..7ea898c55a60 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -555,6 +555,8 @@ struct twl4030_clock_init_data { | |||
555 | struct twl4030_bci_platform_data { | 555 | struct twl4030_bci_platform_data { |
556 | int *battery_tmp_tbl; | 556 | int *battery_tmp_tbl; |
557 | unsigned int tblsize; | 557 | unsigned int tblsize; |
558 | int bb_uvolt; /* voltage to charge backup battery */ | ||
559 | int bb_uamp; /* current for backup battery charging */ | ||
558 | }; | 560 | }; |
559 | 561 | ||
560 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | 562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ |
diff --git a/include/linux/lp8727.h b/include/linux/platform_data/lp8727.h index ea98c6133d32..ea98c6133d32 100644 --- a/include/linux/lp8727.h +++ b/include/linux/platform_data/lp8727.h | |||
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 241065c9ce51..cd22029e32aa 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define _CHARGER_MANAGER_H | 16 | #define _CHARGER_MANAGER_H |
17 | 17 | ||
18 | #include <linux/power_supply.h> | 18 | #include <linux/power_supply.h> |
19 | #include <linux/extcon.h> | ||
19 | 20 | ||
20 | enum data_source { | 21 | enum data_source { |
21 | CM_BATTERY_PRESENT, | 22 | CM_BATTERY_PRESENT, |
@@ -65,6 +66,70 @@ struct charger_global_desc { | |||
65 | }; | 66 | }; |
66 | 67 | ||
67 | /** | 68 | /** |
69 | * struct charger_cable | ||
70 | * @extcon_name: the name of extcon device. | ||
71 | * @name: the name of charger cable(external connector). | ||
72 | * @extcon_dev: the extcon device. | ||
73 | * @wq: the workqueue to control charger according to the state of | ||
74 | * charger cable. If charger cable is attached, enable charger. | ||
75 | * But if charger cable is detached, disable charger. | ||
76 | * @nb: the notifier block to receive changed state from EXTCON | ||
77 | * (External Connector) when charger cable is attached/detached. | ||
78 | * @attached: the state of charger cable. | ||
79 | * true: the charger cable is attached | ||
80 | * false: the charger cable is detached | ||
81 | * @charger: the instance of struct charger_regulator. | ||
82 | * @cm: the Charger Manager representing the battery. | ||
83 | */ | ||
84 | struct charger_cable { | ||
85 | const char *extcon_name; | ||
86 | const char *name; | ||
87 | |||
88 | /* The charger-manager use Exton framework*/ | ||
89 | struct extcon_specific_cable_nb extcon_dev; | ||
90 | struct work_struct wq; | ||
91 | struct notifier_block nb; | ||
92 | |||
93 | /* The state of charger cable */ | ||
94 | bool attached; | ||
95 | |||
96 | struct charger_regulator *charger; | ||
97 | |||
98 | /* | ||
99 | * Set min/max current of regulator to protect over-current issue | ||
100 | * according to a kind of charger cable when cable is attached. | ||
101 | */ | ||
102 | int min_uA; | ||
103 | int max_uA; | ||
104 | |||
105 | struct charger_manager *cm; | ||
106 | }; | ||
107 | |||
108 | /** | ||
109 | * struct charger_regulator | ||
110 | * @regulator_name: the name of regulator for using charger. | ||
111 | * @consumer: the regulator consumer for the charger. | ||
112 | * @cables: | ||
113 | * the array of charger cables to enable/disable charger | ||
114 | * and set current limit according to constratint data of | ||
115 | * struct charger_cable if only charger cable included | ||
116 | * in the array of charger cables is attached/detached. | ||
117 | * @num_cables: the number of charger cables. | ||
118 | */ | ||
119 | struct charger_regulator { | ||
120 | /* The name of regulator for charging */ | ||
121 | const char *regulator_name; | ||
122 | struct regulator *consumer; | ||
123 | |||
124 | /* | ||
125 | * Store constraint information related to current limit, | ||
126 | * each cable have different condition for charging. | ||
127 | */ | ||
128 | struct charger_cable *cables; | ||
129 | int num_cables; | ||
130 | }; | ||
131 | |||
132 | /** | ||
68 | * struct charger_desc | 133 | * struct charger_desc |
69 | * @psy_name: the name of power-supply-class for charger manager | 134 | * @psy_name: the name of power-supply-class for charger manager |
70 | * @polling_mode: | 135 | * @polling_mode: |
@@ -109,7 +174,7 @@ struct charger_desc { | |||
109 | char **psy_charger_stat; | 174 | char **psy_charger_stat; |
110 | 175 | ||
111 | int num_charger_regulators; | 176 | int num_charger_regulators; |
112 | struct regulator_bulk_data *charger_regulators; | 177 | struct charger_regulator *charger_regulators; |
113 | 178 | ||
114 | char *psy_fuel_gauge; | 179 | char *psy_fuel_gauge; |
115 | 180 | ||
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 3b912bee28d1..0bafbb15f29c 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -109,6 +109,8 @@ enum power_supply_property { | |||
109 | POWER_SUPPLY_PROP_CHARGE_NOW, | 109 | POWER_SUPPLY_PROP_CHARGE_NOW, |
110 | POWER_SUPPLY_PROP_CHARGE_AVG, | 110 | POWER_SUPPLY_PROP_CHARGE_AVG, |
111 | POWER_SUPPLY_PROP_CHARGE_COUNTER, | 111 | POWER_SUPPLY_PROP_CHARGE_COUNTER, |
112 | POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, | ||
113 | POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, | ||
112 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 114 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
113 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, | 115 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, |
114 | POWER_SUPPLY_PROP_ENERGY_FULL, | 116 | POWER_SUPPLY_PROP_ENERGY_FULL, |
@@ -116,9 +118,15 @@ enum power_supply_property { | |||
116 | POWER_SUPPLY_PROP_ENERGY_NOW, | 118 | POWER_SUPPLY_PROP_ENERGY_NOW, |
117 | POWER_SUPPLY_PROP_ENERGY_AVG, | 119 | POWER_SUPPLY_PROP_ENERGY_AVG, |
118 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | 120 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ |
121 | POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN, /* in percents! */ | ||
122 | POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */ | ||
119 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | 123 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, |
120 | POWER_SUPPLY_PROP_TEMP, | 124 | POWER_SUPPLY_PROP_TEMP, |
125 | POWER_SUPPLY_PROP_TEMP_ALERT_MIN, | ||
126 | POWER_SUPPLY_PROP_TEMP_ALERT_MAX, | ||
121 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | 127 | POWER_SUPPLY_PROP_TEMP_AMBIENT, |
128 | POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN, | ||
129 | POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX, | ||
122 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | 130 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, |
123 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, | 131 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, |
124 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | 132 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, |
@@ -173,6 +181,9 @@ struct power_supply { | |||
173 | /* private */ | 181 | /* private */ |
174 | struct device *dev; | 182 | struct device *dev; |
175 | struct work_struct changed_work; | 183 | struct work_struct changed_work; |
184 | #ifdef CONFIG_THERMAL | ||
185 | struct thermal_zone_device *tzd; | ||
186 | #endif | ||
176 | 187 | ||
177 | #ifdef CONFIG_LEDS_TRIGGERS | 188 | #ifdef CONFIG_LEDS_TRIGGERS |
178 | struct led_trigger *charging_full_trig; | 189 | struct led_trigger *charging_full_trig; |
@@ -236,6 +247,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp) | |||
236 | case POWER_SUPPLY_PROP_CHARGE_NOW: | 247 | case POWER_SUPPLY_PROP_CHARGE_NOW: |
237 | case POWER_SUPPLY_PROP_CHARGE_AVG: | 248 | case POWER_SUPPLY_PROP_CHARGE_AVG: |
238 | case POWER_SUPPLY_PROP_CHARGE_COUNTER: | 249 | case POWER_SUPPLY_PROP_CHARGE_COUNTER: |
250 | case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: | ||
239 | case POWER_SUPPLY_PROP_CURRENT_MAX: | 251 | case POWER_SUPPLY_PROP_CURRENT_MAX: |
240 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 252 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
241 | case POWER_SUPPLY_PROP_CURRENT_AVG: | 253 | case POWER_SUPPLY_PROP_CURRENT_AVG: |
@@ -263,6 +275,7 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp) | |||
263 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | 275 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: |
264 | case POWER_SUPPLY_PROP_VOLTAGE_AVG: | 276 | case POWER_SUPPLY_PROP_VOLTAGE_AVG: |
265 | case POWER_SUPPLY_PROP_VOLTAGE_OCV: | 277 | case POWER_SUPPLY_PROP_VOLTAGE_OCV: |
278 | case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: | ||
266 | case POWER_SUPPLY_PROP_POWER_NOW: | 279 | case POWER_SUPPLY_PROP_POWER_NOW: |
267 | return 1; | 280 | return 1; |
268 | default: | 281 | default: |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index cfc8d908892e..4b94a61955df 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -151,7 +151,7 @@ enum { | |||
151 | }; | 151 | }; |
152 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | 152 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) |
153 | 153 | ||
154 | struct thermal_zone_device *thermal_zone_device_register(char *, int, int, | 154 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, |
155 | void *, const struct thermal_zone_device_ops *, int tc1, | 155 | void *, const struct thermal_zone_device_ops *, int tc1, |
156 | int tc2, int passive_freq, int polling_freq); | 156 | int tc2, int passive_freq, int polling_freq); |
157 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 157 | void thermal_zone_device_unregister(struct thermal_zone_device *); |