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 /drivers/mfd/88pm860x-core.c | |
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 'drivers/mfd/88pm860x-core.c')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 59d117e9fa31..8fa86edf70d4 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/mfd/core.h> | 24 | #include <linux/mfd/core.h> |
25 | #include <linux/mfd/88pm860x.h> | 25 | #include <linux/mfd/88pm860x.h> |
26 | #include <linux/regulator/machine.h> | 26 | #include <linux/regulator/machine.h> |
27 | #include <linux/power/charger-manager.h> | ||
27 | 28 | ||
28 | #define INT_STATUS_NUM 3 | 29 | #define INT_STATUS_NUM 3 |
29 | 30 | ||
@@ -150,7 +151,8 @@ static struct resource battery_resources[] __devinitdata = { | |||
150 | static struct resource charger_resources[] __devinitdata = { | 151 | static struct resource charger_resources[] __devinitdata = { |
151 | {PM8607_IRQ_CHG, PM8607_IRQ_CHG, "charger detect", IORESOURCE_IRQ,}, | 152 | {PM8607_IRQ_CHG, PM8607_IRQ_CHG, "charger detect", IORESOURCE_IRQ,}, |
152 | {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,}, | 153 | {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,}, |
153 | {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging timeout", IORESOURCE_IRQ,}, | 154 | {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,}, |
155 | {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,}, | ||
154 | {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,}, | 156 | {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,}, |
155 | {PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,}, | 157 | {PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,}, |
156 | {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, | 158 | {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, |
@@ -318,10 +320,15 @@ static struct regulator_init_data preg_init_data = { | |||
318 | .consumer_supplies = &preg_supply[0], | 320 | .consumer_supplies = &preg_supply[0], |
319 | }; | 321 | }; |
320 | 322 | ||
323 | static struct charger_regulator chg_desc_regulator_data[] = { | ||
324 | { .regulator_name = "preg", }, | ||
325 | }; | ||
326 | |||
321 | static struct mfd_cell power_devs[] = { | 327 | static struct mfd_cell power_devs[] = { |
322 | {"88pm860x-battery", -1,}, | 328 | {"88pm860x-battery", -1,}, |
323 | {"88pm860x-charger", -1,}, | 329 | {"88pm860x-charger", -1,}, |
324 | {"88pm860x-preg", -1,}, | 330 | {"88pm860x-preg", -1,}, |
331 | {"charger-manager", -1,}, | ||
325 | }; | 332 | }; |
326 | 333 | ||
327 | static struct mfd_cell rtc_devs[] = { | 334 | static struct mfd_cell rtc_devs[] = { |
@@ -929,6 +936,19 @@ static void __devinit device_power_init(struct pm860x_chip *chip, | |||
929 | NULL, chip->irq_base, NULL); | 936 | NULL, chip->irq_base, NULL); |
930 | if (ret < 0) | 937 | if (ret < 0) |
931 | dev_err(chip->dev, "Failed to add preg subdev\n"); | 938 | dev_err(chip->dev, "Failed to add preg subdev\n"); |
939 | |||
940 | if (pdata->chg_desc) { | ||
941 | pdata->chg_desc->charger_regulators = | ||
942 | &chg_desc_regulator_data[0]; | ||
943 | pdata->chg_desc->num_charger_regulators = | ||
944 | ARRAY_SIZE(chg_desc_regulator_data), | ||
945 | power_devs[3].platform_data = pdata->chg_desc; | ||
946 | power_devs[3].pdata_size = sizeof(*pdata->chg_desc); | ||
947 | ret = mfd_add_devices(chip->dev, 0, &power_devs[3], 1, | ||
948 | NULL, chip->irq_base, NULL); | ||
949 | if (ret < 0) | ||
950 | dev_err(chip->dev, "Failed to add chg-manager subdev\n"); | ||
951 | } | ||
932 | } | 952 | } |
933 | 953 | ||
934 | static void __devinit device_onkey_init(struct pm860x_chip *chip, | 954 | static void __devinit device_onkey_init(struct pm860x_chip *chip, |