diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 13:19:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 13:19:07 -0500 |
commit | 5a1203914a637b642442a861cf462d16401548e1 (patch) | |
tree | 894ea523ad45686b9103410f7daeb3a8e670553a /include/linux/mfd | |
parent | c560dc8793ecf4c3bb4ba6e7b8cae8a64486d96b (diff) | |
parent | ac6324e7021dfa917ce4f9a836318c3e46fbb84e (diff) |
Merge tag 'for-v3.9' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov:
"Four new drivers:
- goldfish_battery:
This is Android Emulator battery driver. Originally from Google,
but Intel folks reshaped it for mainline
- pm2301_charger:
A new driver for ST-Ericsson 2301 Power Management chip, uses
AB8500 battery management core
- qnap-poweroff:
The driver adds poweroff functionality for QNAP NAS boxes
- restart-poweroff:
A generic driver that implements 'power off by restarting'. The
actual poweroff functionality is implemented through a bootloader,
so Linux' task is just to restart the box. The driver is useful on
Buffalo Linkstation LS-XHL and LS-CHLv2 boards. Andrew Lunn worked
on submitting the driver (as well as qnap-poweroff above).
Additionally:
- A lot of fixes for ab8500 drivers. This is a part of efforts of
syncing internal ST-Ericsson development tree with the mainline.
Lee Jones @ Linaro worked on compilation and reshaping these
series.
- New health properties for the power supplies: "Watchdog timer
expire" and "Safety timer expire"
- As usual, a bunch of fixes/cleanups here and there"
* tag 'for-v3.9' of git://git.infradead.org/battery-2.6: (81 commits)
bq2415x_charger: Add support for offline and 100mA mode
generic-adc-battery: Fix forever loop in gab_remove()
goldfish_battery: Add missing GENERIC_HARDIRQS dependency
da9030_battery: Include notifier.h
bq27x00_battery: Fix reporting battery temperature
power/reset: Remove newly introduced __dev* annotations
lp8727_charger: Small cleanup in naming
ab8500_btemp: Demote initcall sequence
ds2782_battery: Add power_supply_changed() calls for proper uevent support
power: Add battery driver for goldfish emulator
u8500-charger: Delay for USB enumeration
ab8500-bm: Remove individual [charger|btemp|fg|chargalg] pdata structures
ab8500-charger: Do not touch VBUSOVV bits
ab8500-fg: Use correct battery charge full design
pm2301: LPN mode control support
pm2301: Enable vbat low monitoring
ab8500-bm: Flush all work queues before suspending
ab8500-fg: Go to INIT_RECOVERY when charger removed
ab8500-charger: Add support for autopower on AB8505 and AB9540
abx500-chargalg: Add new sysfs interface to get current charge status
...
Fix up fairly straightforward conflicts in the ab8500 driver. But since
it seems to be ARM-specific, I can't even compile-test the result..
Diffstat (limited to 'include/linux/mfd')
-rw-r--r-- | include/linux/mfd/abx500.h | 15 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500-bm.h | 37 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ux500_chargalg.h | 5 |
3 files changed, 21 insertions, 36 deletions
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index e53dcfeaee69..80e3b8683a84 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -131,7 +131,7 @@ struct abx500_maxim_parameters { | |||
131 | * @nominal_voltage: Nominal voltage of the battery in mV | 131 | * @nominal_voltage: Nominal voltage of the battery in mV |
132 | * @termination_vol: max voltage upto which battery can be charged | 132 | * @termination_vol: max voltage upto which battery can be charged |
133 | * @termination_curr battery charging termination current in mA | 133 | * @termination_curr battery charging termination current in mA |
134 | * @recharge_vol battery voltage limit that will trigger a new | 134 | * @recharge_cap battery capacity limit that will trigger a new |
135 | * full charging cycle in the case where maintenan- | 135 | * full charging cycle in the case where maintenan- |
136 | * -ce charging has been disabled | 136 | * -ce charging has been disabled |
137 | * @normal_cur_lvl: charger current in normal state in mA | 137 | * @normal_cur_lvl: charger current in normal state in mA |
@@ -160,7 +160,7 @@ struct abx500_battery_type { | |||
160 | int nominal_voltage; | 160 | int nominal_voltage; |
161 | int termination_vol; | 161 | int termination_vol; |
162 | int termination_curr; | 162 | int termination_curr; |
163 | int recharge_vol; | 163 | int recharge_cap; |
164 | int normal_cur_lvl; | 164 | int normal_cur_lvl; |
165 | int normal_vol_lvl; | 165 | int normal_vol_lvl; |
166 | int maint_a_cur_lvl; | 166 | int maint_a_cur_lvl; |
@@ -224,6 +224,7 @@ struct abx500_bm_charger_parameters { | |||
224 | * @bkup_bat_v voltage which we charge the backup battery with | 224 | * @bkup_bat_v voltage which we charge the backup battery with |
225 | * @bkup_bat_i current which we charge the backup battery with | 225 | * @bkup_bat_i current which we charge the backup battery with |
226 | * @no_maintenance indicates that maintenance charging is disabled | 226 | * @no_maintenance indicates that maintenance charging is disabled |
227 | * @capacity_scaling indicates whether capacity scaling is to be used | ||
227 | * @abx500_adc_therm placement of thermistor, batctrl or battemp adc | 228 | * @abx500_adc_therm placement of thermistor, batctrl or battemp adc |
228 | * @chg_unknown_bat flag to enable charging of unknown batteries | 229 | * @chg_unknown_bat flag to enable charging of unknown batteries |
229 | * @enable_overshoot flag to enable VBAT overshoot control | 230 | * @enable_overshoot flag to enable VBAT overshoot control |
@@ -253,7 +254,11 @@ struct abx500_bm_data { | |||
253 | int usb_safety_tmr_h; | 254 | int usb_safety_tmr_h; |
254 | int bkup_bat_v; | 255 | int bkup_bat_v; |
255 | int bkup_bat_i; | 256 | int bkup_bat_i; |
257 | bool autopower_cfg; | ||
258 | bool ac_enabled; | ||
259 | bool usb_enabled; | ||
256 | bool no_maintenance; | 260 | bool no_maintenance; |
261 | bool capacity_scaling; | ||
257 | bool chg_unknown_bat; | 262 | bool chg_unknown_bat; |
258 | bool enable_overshoot; | 263 | bool enable_overshoot; |
259 | bool auto_trig; | 264 | bool auto_trig; |
@@ -277,9 +282,9 @@ enum { | |||
277 | NTC_INTERNAL, | 282 | NTC_INTERNAL, |
278 | }; | 283 | }; |
279 | 284 | ||
280 | int bmdevs_of_probe(struct device *dev, | 285 | int ab8500_bm_of_probe(struct device *dev, |
281 | struct device_node *np, | 286 | struct device_node *np, |
282 | struct abx500_bm_data **battery); | 287 | struct abx500_bm_data *bm); |
283 | 288 | ||
284 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, | 289 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, |
285 | u8 value); | 290 | u8 value); |
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index 9bd037df97d9..8d35bfe164c8 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
@@ -23,6 +23,7 @@ | |||
23 | * Bank : 0x5 | 23 | * Bank : 0x5 |
24 | */ | 24 | */ |
25 | #define AB8500_USB_LINE_STAT_REG 0x80 | 25 | #define AB8500_USB_LINE_STAT_REG 0x80 |
26 | #define AB8500_USB_LINK1_STAT_REG 0x94 | ||
26 | 27 | ||
27 | /* | 28 | /* |
28 | * Charger / status register offfsets | 29 | * Charger / status register offfsets |
@@ -225,6 +226,8 @@ | |||
225 | /* BatCtrl Current Source Constants */ | 226 | /* BatCtrl Current Source Constants */ |
226 | #define BAT_CTRL_7U_ENA 0x01 | 227 | #define BAT_CTRL_7U_ENA 0x01 |
227 | #define BAT_CTRL_20U_ENA 0x02 | 228 | #define BAT_CTRL_20U_ENA 0x02 |
229 | #define BAT_CTRL_18U_ENA 0x01 | ||
230 | #define BAT_CTRL_16U_ENA 0x02 | ||
228 | #define BAT_CTRL_CMP_ENA 0x04 | 231 | #define BAT_CTRL_CMP_ENA 0x04 |
229 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 | 232 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 |
230 | #define BAT_CTRL_PULL_UP_ENA 0x10 | 233 | #define BAT_CTRL_PULL_UP_ENA 0x10 |
@@ -355,6 +358,7 @@ struct ab8500_bm_charger_parameters { | |||
355 | * @bkup_bat_v voltage which we charge the backup battery with | 358 | * @bkup_bat_v voltage which we charge the backup battery with |
356 | * @bkup_bat_i current which we charge the backup battery with | 359 | * @bkup_bat_i current which we charge the backup battery with |
357 | * @no_maintenance indicates that maintenance charging is disabled | 360 | * @no_maintenance indicates that maintenance charging is disabled |
361 | * @capacity_scaling indicates whether capacity scaling is to be used | ||
358 | * @adc_therm placement of thermistor, batctrl or battemp adc | 362 | * @adc_therm placement of thermistor, batctrl or battemp adc |
359 | * @chg_unknown_bat flag to enable charging of unknown batteries | 363 | * @chg_unknown_bat flag to enable charging of unknown batteries |
360 | * @enable_overshoot flag to enable VBAT overshoot control | 364 | * @enable_overshoot flag to enable VBAT overshoot control |
@@ -383,6 +387,7 @@ struct ab8500_bm_data { | |||
383 | int bkup_bat_v; | 387 | int bkup_bat_v; |
384 | int bkup_bat_i; | 388 | int bkup_bat_i; |
385 | bool no_maintenance; | 389 | bool no_maintenance; |
390 | bool capacity_scaling; | ||
386 | bool chg_unknown_bat; | 391 | bool chg_unknown_bat; |
387 | bool enable_overshoot; | 392 | bool enable_overshoot; |
388 | enum abx500_adc_therm adc_therm; | 393 | enum abx500_adc_therm adc_therm; |
@@ -399,26 +404,6 @@ struct ab8500_bm_data { | |||
399 | const struct ab8500_fg_parameters *fg_params; | 404 | const struct ab8500_fg_parameters *fg_params; |
400 | }; | 405 | }; |
401 | 406 | ||
402 | struct ab8500_charger_platform_data { | ||
403 | char **supplied_to; | ||
404 | size_t num_supplicants; | ||
405 | bool autopower_cfg; | ||
406 | }; | ||
407 | |||
408 | struct ab8500_btemp_platform_data { | ||
409 | char **supplied_to; | ||
410 | size_t num_supplicants; | ||
411 | }; | ||
412 | |||
413 | struct ab8500_fg_platform_data { | ||
414 | char **supplied_to; | ||
415 | size_t num_supplicants; | ||
416 | }; | ||
417 | |||
418 | struct ab8500_chargalg_platform_data { | ||
419 | char **supplied_to; | ||
420 | size_t num_supplicants; | ||
421 | }; | ||
422 | struct ab8500_btemp; | 407 | struct ab8500_btemp; |
423 | struct ab8500_gpadc; | 408 | struct ab8500_gpadc; |
424 | struct ab8500_fg; | 409 | struct ab8500_fg; |
@@ -434,20 +419,10 @@ struct ab8500_fg *ab8500_fg_get(void); | |||
434 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); | 419 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); |
435 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); | 420 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); |
436 | int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res); | 421 | int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res); |
422 | int ab8500_fg_inst_curr_started(struct ab8500_fg *di); | ||
437 | int ab8500_fg_inst_curr_done(struct ab8500_fg *di); | 423 | int ab8500_fg_inst_curr_done(struct ab8500_fg *di); |
438 | 424 | ||
439 | #else | 425 | #else |
440 | static struct abx500_bm_data ab8500_bm_data; | 426 | static struct abx500_bm_data ab8500_bm_data; |
441 | |||
442 | static inline int ab8500_fg_inst_curr_start(struct ab8500_fg *di) | ||
443 | { | ||
444 | return -ENODEV; | ||
445 | } | ||
446 | |||
447 | static inline int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res) | ||
448 | { | ||
449 | return -ENODEV; | ||
450 | } | ||
451 | |||
452 | #endif | 427 | #endif |
453 | #endif /* _AB8500_BM_H */ | 428 | #endif /* _AB8500_BM_H */ |
diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h index 9b07725750c9..d43ac0f35526 100644 --- a/include/linux/mfd/abx500/ux500_chargalg.h +++ b/include/linux/mfd/abx500/ux500_chargalg.h | |||
@@ -27,12 +27,17 @@ struct ux500_charger_ops { | |||
27 | * @ops ux500 charger operations | 27 | * @ops ux500 charger operations |
28 | * @max_out_volt maximum output charger voltage in mV | 28 | * @max_out_volt maximum output charger voltage in mV |
29 | * @max_out_curr maximum output charger current in mA | 29 | * @max_out_curr maximum output charger current in mA |
30 | * @enabled indicates if this charger is used or not | ||
31 | * @external external charger unit (pm2xxx) | ||
30 | */ | 32 | */ |
31 | struct ux500_charger { | 33 | struct ux500_charger { |
32 | struct power_supply psy; | 34 | struct power_supply psy; |
33 | struct ux500_charger_ops ops; | 35 | struct ux500_charger_ops ops; |
34 | int max_out_volt; | 36 | int max_out_volt; |
35 | int max_out_curr; | 37 | int max_out_curr; |
38 | int wdt_refresh; | ||
39 | bool enabled; | ||
40 | bool external; | ||
36 | }; | 41 | }; |
37 | 42 | ||
38 | #endif | 43 | #endif |