diff options
Diffstat (limited to 'arch/arm/mach-pxa/magician.c')
-rw-r--r-- | arch/arm/mach-pxa/magician.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 3d6baf91396c..6f4785b347c2 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -25,7 +25,8 @@ | |||
25 | #include <linux/mtd/physmap.h> | 25 | #include <linux/mtd/physmap.h> |
26 | #include <linux/pda_power.h> | 26 | #include <linux/pda_power.h> |
27 | #include <linux/pwm_backlight.h> | 27 | #include <linux/pwm_backlight.h> |
28 | #include <linux/regulator/bq24022.h> | 28 | #include <linux/regulator/driver.h> |
29 | #include <linux/regulator/gpio-regulator.h> | ||
29 | #include <linux/regulator/machine.h> | 30 | #include <linux/regulator/machine.h> |
30 | #include <linux/usb/gpio_vbus.h> | 31 | #include <linux/usb/gpio_vbus.h> |
31 | #include <linux/i2c/pxa-i2c.h> | 32 | #include <linux/i2c/pxa-i2c.h> |
@@ -33,6 +34,7 @@ | |||
33 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
37 | #include <asm/system_info.h> | ||
36 | 38 | ||
37 | #include <mach/pxa27x.h> | 39 | #include <mach/pxa27x.h> |
38 | #include <mach/magician.h> | 40 | #include <mach/magician.h> |
@@ -596,14 +598,34 @@ static struct regulator_init_data bq24022_init_data = { | |||
596 | .consumer_supplies = bq24022_consumers, | 598 | .consumer_supplies = bq24022_consumers, |
597 | }; | 599 | }; |
598 | 600 | ||
599 | static struct bq24022_mach_info bq24022_info = { | 601 | static struct gpio bq24022_gpios[] = { |
600 | .gpio_nce = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN, | 602 | { EGPIO_MAGICIAN_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" }, |
601 | .gpio_iset2 = EGPIO_MAGICIAN_BQ24022_ISET2, | 603 | }; |
602 | .init_data = &bq24022_init_data, | 604 | |
605 | static struct gpio_regulator_state bq24022_states[] = { | ||
606 | { .value = 100000, .gpios = (0 << 0) }, | ||
607 | { .value = 500000, .gpios = (1 << 0) }, | ||
608 | }; | ||
609 | |||
610 | static struct gpio_regulator_config bq24022_info = { | ||
611 | .supply_name = "bq24022", | ||
612 | |||
613 | .enable_gpio = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN, | ||
614 | .enable_high = 0, | ||
615 | .enabled_at_boot = 0, | ||
616 | |||
617 | .gpios = bq24022_gpios, | ||
618 | .nr_gpios = ARRAY_SIZE(bq24022_gpios), | ||
619 | |||
620 | .states = bq24022_states, | ||
621 | .nr_states = ARRAY_SIZE(bq24022_states), | ||
622 | |||
623 | .type = REGULATOR_CURRENT, | ||
624 | .init_data = &bq24022_init_data, | ||
603 | }; | 625 | }; |
604 | 626 | ||
605 | static struct platform_device bq24022 = { | 627 | static struct platform_device bq24022 = { |
606 | .name = "bq24022", | 628 | .name = "gpio-regulator", |
607 | .id = -1, | 629 | .id = -1, |
608 | .dev = { | 630 | .dev = { |
609 | .platform_data = &bq24022_info, | 631 | .platform_data = &bq24022_info, |