diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-07 04:29:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-07 04:29:24 -0400 |
| commit | e665faa424a4a782aa986274920c1fc5b76f5560 (patch) | |
| tree | 2cf64abadecbbeadcffc02cb7671cb593fc45488 /include/linux | |
| parent | ca4da6948bc6a7010ecf916dad528c177dcb9a81 (diff) | |
| parent | 18766f0936d444fd7ff2e0064bd6e69a89d5c6fc (diff) | |
Merge tag 'for-v3.7' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov:
"1. New drivers:
- Marvell 88pm860x charger and battery drivers;
- Texas Instruments LP8788 charger driver;
2. Two new power supply properties: whether a battery is authentic,
and chargers' maximal currents and voltages;
3. A lot of TI LP8727 Charger cleanups;
4. New features for Charger Manager, mainly now we can disable
specific regulators;
5. Random fixes and cleanups for other drivers."
Fix up trivial conflicts in <linux/mfd/88pm860x.h>
* tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits)
pda_power: Remove ac_draw_failed goto and label
charger-manager: Add support sysfs entry for charger
charger-manager: Support limit of maximum possible
charger-manager: Check fully charged state of battery periodically
lp8727_charger: More pure cosmetic improvements
lp8727_charger: Fix checkpatch warning
lp8727_charger: Add description in the private data
lp8727_charger: Fix a typo - chg_parm to chg_param
lp8727_charger: Make some cosmetic changes in lp8727_delayed_func()
lp8727_charger: Clean up lp8727_charger_changed()
lp8727_charger: Return if the battery is discharging
lp8727_charger: Make lp8727_charger_get_propery() simpler
lp8727_charger: Make lp8727_ctrl_switch() inline
lp8727_charger: Make lp8727_init_device() shorter
lp8727_charger: Clean up lp8727_is_charger_attached()
lp8727_charger: Use specific definition
lp8727_charger: Clean up lp8727 definitions
lp8727_charger: Use the definition rather than enum
lp8727_charger: Fix code for getting battery temp
lp8727_charger: Clear interrrupts at inital time
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mfd/88pm860x.h | 84 | ||||
| -rw-r--r-- | include/linux/platform_data/lp8727.h | 51 | ||||
| -rw-r--r-- | include/linux/power/charger-manager.h | 47 | ||||
| -rw-r--r-- | include/linux/power_supply.h | 5 |
4 files changed, 157 insertions, 30 deletions
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index ef3e6b701179..cd97530205c2 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
| @@ -39,6 +39,21 @@ enum { | |||
| 39 | #define PM8606_DCM_BOOST (0x00) | 39 | #define PM8606_DCM_BOOST (0x00) |
| 40 | #define PM8606_PWM (0x01) | 40 | #define PM8606_PWM (0x01) |
| 41 | 41 | ||
| 42 | #define PM8607_MISC2 (0x42) | ||
| 43 | |||
| 44 | /* Power Up Log Register */ | ||
| 45 | #define PM8607_POWER_UP_LOG (0x3F) | ||
| 46 | |||
| 47 | /* Charger Control Registers */ | ||
| 48 | #define PM8607_CCNT (0x47) | ||
| 49 | #define PM8607_CHG_CTRL1 (0x48) | ||
| 50 | #define PM8607_CHG_CTRL2 (0x49) | ||
| 51 | #define PM8607_CHG_CTRL3 (0x4A) | ||
| 52 | #define PM8607_CHG_CTRL4 (0x4B) | ||
| 53 | #define PM8607_CHG_CTRL5 (0x4C) | ||
| 54 | #define PM8607_CHG_CTRL6 (0x4D) | ||
| 55 | #define PM8607_CHG_CTRL7 (0x4E) | ||
| 56 | |||
| 42 | /* Backlight Registers */ | 57 | /* Backlight Registers */ |
| 43 | #define PM8606_WLED1A (0x02) | 58 | #define PM8606_WLED1A (0x02) |
| 44 | #define PM8606_WLED1B (0x03) | 59 | #define PM8606_WLED1B (0x03) |
| @@ -189,6 +204,71 @@ enum { | |||
| 189 | #define PM8607_PD_PREBIAS (0x56) /* prebias time */ | 204 | #define PM8607_PD_PREBIAS (0x56) /* prebias time */ |
| 190 | #define PM8607_GPADC_MISC1 (0x57) | 205 | #define PM8607_GPADC_MISC1 (0x57) |
| 191 | 206 | ||
| 207 | /* bit definitions of MEAS_EN1*/ | ||
| 208 | #define PM8607_MEAS_EN1_VBAT (1 << 0) | ||
| 209 | #define PM8607_MEAS_EN1_VCHG (1 << 1) | ||
| 210 | #define PM8607_MEAS_EN1_VSYS (1 << 2) | ||
| 211 | #define PM8607_MEAS_EN1_TINT (1 << 3) | ||
| 212 | #define PM8607_MEAS_EN1_RFTMP (1 << 4) | ||
| 213 | #define PM8607_MEAS_EN1_TBAT (1 << 5) | ||
| 214 | #define PM8607_MEAS_EN1_GPADC2 (1 << 6) | ||
| 215 | #define PM8607_MEAS_EN1_GPADC3 (1 << 7) | ||
| 216 | |||
| 217 | /* Battery Monitor Registers */ | ||
| 218 | #define PM8607_GP_BIAS2 (0x5A) | ||
| 219 | #define PM8607_VBAT_LOWTH (0x5B) | ||
| 220 | #define PM8607_VCHG_LOWTH (0x5C) | ||
| 221 | #define PM8607_VSYS_LOWTH (0x5D) | ||
| 222 | #define PM8607_TINT_LOWTH (0x5E) | ||
| 223 | #define PM8607_GPADC0_LOWTH (0x5F) | ||
| 224 | #define PM8607_GPADC1_LOWTH (0x60) | ||
| 225 | #define PM8607_GPADC2_LOWTH (0x61) | ||
| 226 | #define PM8607_GPADC3_LOWTH (0x62) | ||
| 227 | #define PM8607_VBAT_HIGHTH (0x63) | ||
| 228 | #define PM8607_VCHG_HIGHTH (0x64) | ||
| 229 | #define PM8607_VSYS_HIGHTH (0x65) | ||
| 230 | #define PM8607_TINT_HIGHTH (0x66) | ||
| 231 | #define PM8607_GPADC0_HIGHTH (0x67) | ||
| 232 | #define PM8607_GPADC1_HIGHTH (0x68) | ||
| 233 | #define PM8607_GPADC2_HIGHTH (0x69) | ||
| 234 | #define PM8607_GPADC3_HIGHTH (0x6A) | ||
| 235 | #define PM8607_IBAT_MEAS1 (0x6B) | ||
| 236 | #define PM8607_IBAT_MEAS2 (0x6C) | ||
| 237 | #define PM8607_VBAT_MEAS1 (0x6D) | ||
| 238 | #define PM8607_VBAT_MEAS2 (0x6E) | ||
| 239 | #define PM8607_VCHG_MEAS1 (0x6F) | ||
| 240 | #define PM8607_VCHG_MEAS2 (0x70) | ||
| 241 | #define PM8607_VSYS_MEAS1 (0x71) | ||
| 242 | #define PM8607_VSYS_MEAS2 (0x72) | ||
| 243 | #define PM8607_TINT_MEAS1 (0x73) | ||
| 244 | #define PM8607_TINT_MEAS2 (0x74) | ||
| 245 | #define PM8607_GPADC0_MEAS1 (0x75) | ||
| 246 | #define PM8607_GPADC0_MEAS2 (0x76) | ||
| 247 | #define PM8607_GPADC1_MEAS1 (0x77) | ||
| 248 | #define PM8607_GPADC1_MEAS2 (0x78) | ||
| 249 | #define PM8607_GPADC2_MEAS1 (0x79) | ||
| 250 | #define PM8607_GPADC2_MEAS2 (0x7A) | ||
| 251 | #define PM8607_GPADC3_MEAS1 (0x7B) | ||
| 252 | #define PM8607_GPADC3_MEAS2 (0x7C) | ||
| 253 | #define PM8607_CCNT_MEAS1 (0x95) | ||
| 254 | #define PM8607_CCNT_MEAS2 (0x96) | ||
| 255 | #define PM8607_VBAT_AVG (0x97) | ||
| 256 | #define PM8607_VCHG_AVG (0x98) | ||
| 257 | #define PM8607_VSYS_AVG (0x99) | ||
| 258 | #define PM8607_VBAT_MIN (0x9A) | ||
| 259 | #define PM8607_VCHG_MIN (0x9B) | ||
| 260 | #define PM8607_VSYS_MIN (0x9C) | ||
| 261 | #define PM8607_VBAT_MAX (0x9D) | ||
| 262 | #define PM8607_VCHG_MAX (0x9E) | ||
| 263 | #define PM8607_VSYS_MAX (0x9F) | ||
| 264 | |||
| 265 | #define PM8607_GPADC_MISC2 (0x59) | ||
| 266 | #define PM8607_GPADC0_GP_BIAS_A0 (1 << 0) | ||
| 267 | #define PM8607_GPADC1_GP_BIAS_A1 (1 << 1) | ||
| 268 | #define PM8607_GPADC2_GP_BIAS_A2 (1 << 2) | ||
| 269 | #define PM8607_GPADC3_GP_BIAS_A3 (1 << 3) | ||
| 270 | #define PM8607_GPADC2_GP_BIAS_OUT2 (1 << 6) | ||
| 271 | |||
| 192 | /* RTC Control Registers */ | 272 | /* RTC Control Registers */ |
| 193 | #define PM8607_RTC1 (0xA0) | 273 | #define PM8607_RTC1 (0xA0) |
| 194 | #define PM8607_RTC_COUNTER1 (0xA1) | 274 | #define PM8607_RTC_COUNTER1 (0xA1) |
| @@ -350,7 +430,8 @@ struct pm860x_touch_pdata { | |||
| 350 | }; | 430 | }; |
| 351 | 431 | ||
| 352 | struct pm860x_power_pdata { | 432 | struct pm860x_power_pdata { |
| 353 | unsigned fast_charge; /* charge current */ | 433 | int max_capacity; |
| 434 | int resistor; | ||
| 354 | }; | 435 | }; |
| 355 | 436 | ||
| 356 | struct pm860x_platform_data { | 437 | struct pm860x_platform_data { |
| @@ -375,6 +456,7 @@ struct pm860x_platform_data { | |||
| 375 | struct regulator_init_data *ldo12; | 456 | struct regulator_init_data *ldo12; |
| 376 | struct regulator_init_data *ldo_vibrator; | 457 | struct regulator_init_data *ldo_vibrator; |
| 377 | struct regulator_init_data *ldo14; | 458 | struct regulator_init_data *ldo14; |
| 459 | struct charger_desc *chg_desc; | ||
| 378 | 460 | ||
| 379 | int companion_addr; /* I2C address of companion chip */ | 461 | int companion_addr; /* I2C address of companion chip */ |
| 380 | int i2c_port; /* Controlled by GI2C or PI2C */ | 462 | int i2c_port; /* Controlled by GI2C or PI2C */ |
diff --git a/include/linux/platform_data/lp8727.h b/include/linux/platform_data/lp8727.h index ea98c6133d32..47128a50e04e 100644 --- a/include/linux/platform_data/lp8727.h +++ b/include/linux/platform_data/lp8727.h | |||
| @@ -13,32 +13,32 @@ | |||
| 13 | #define _LP8727_H | 13 | #define _LP8727_H |
| 14 | 14 | ||
| 15 | enum lp8727_eoc_level { | 15 | enum lp8727_eoc_level { |
| 16 | EOC_5P, | 16 | LP8727_EOC_5P, |
| 17 | EOC_10P, | 17 | LP8727_EOC_10P, |
| 18 | EOC_16P, | 18 | LP8727_EOC_16P, |
| 19 | EOC_20P, | 19 | LP8727_EOC_20P, |
| 20 | EOC_25P, | 20 | LP8727_EOC_25P, |
| 21 | EOC_33P, | 21 | LP8727_EOC_33P, |
| 22 | EOC_50P, | 22 | LP8727_EOC_50P, |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | enum lp8727_ichg { | 25 | enum lp8727_ichg { |
| 26 | ICHG_90mA, | 26 | LP8727_ICHG_90mA, |
| 27 | ICHG_100mA, | 27 | LP8727_ICHG_100mA, |
| 28 | ICHG_400mA, | 28 | LP8727_ICHG_400mA, |
| 29 | ICHG_450mA, | 29 | LP8727_ICHG_450mA, |
| 30 | ICHG_500mA, | 30 | LP8727_ICHG_500mA, |
| 31 | ICHG_600mA, | 31 | LP8727_ICHG_600mA, |
| 32 | ICHG_700mA, | 32 | LP8727_ICHG_700mA, |
| 33 | ICHG_800mA, | 33 | LP8727_ICHG_800mA, |
| 34 | ICHG_900mA, | 34 | LP8727_ICHG_900mA, |
| 35 | ICHG_1000mA, | 35 | LP8727_ICHG_1000mA, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * struct lp8727_chg_param | 39 | * struct lp8727_chg_param |
| 40 | * @eoc_level : end of charge level setting | 40 | * @eoc_level : end of charge level setting |
| 41 | * @ichg : charging current | 41 | * @ichg : charging current |
| 42 | */ | 42 | */ |
| 43 | struct lp8727_chg_param { | 43 | struct lp8727_chg_param { |
| 44 | enum lp8727_eoc_level eoc_level; | 44 | enum lp8727_eoc_level eoc_level; |
| @@ -47,19 +47,22 @@ struct lp8727_chg_param { | |||
| 47 | 47 | ||
| 48< | |||
