aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/hx4700.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/hx4700.c')
-rw-r--r--arch/arm/mach-pxa/hx4700.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 208eef1c0485..8a1ef2734d58 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -28,7 +28,8 @@
28#include <linux/mtd/physmap.h> 28#include <linux/mtd/physmap.h>
29#include <linux/pda_power.h> 29#include <linux/pda_power.h>
30#include <linux/pwm_backlight.h> 30#include <linux/pwm_backlight.h>
31#include <linux/regulator/bq24022.h> 31#include <linux/regulator/driver.h>
32#include <linux/regulator/gpio-regulator.h>
32#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
33#include <linux/regulator/max1586.h> 34#include <linux/regulator/max1586.h>
34#include <linux/spi/ads7846.h> 35#include <linux/spi/ads7846.h>
@@ -682,14 +683,34 @@ static struct regulator_init_data bq24022_init_data = {
682 .consumer_supplies = bq24022_consumers, 683 .consumer_supplies = bq24022_consumers,
683}; 684};
684 685
685static struct bq24022_mach_info bq24022_info = { 686static struct gpio bq24022_gpios[] = {
686 .gpio_nce = GPIO72_HX4700_BQ24022_nCHARGE_EN, 687 { GPIO96_HX4700_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
687 .gpio_iset2 = GPIO96_HX4700_BQ24022_ISET2, 688};
688 .init_data = &bq24022_init_data, 689
690static struct gpio_regulator_state bq24022_states[] = {
691 { .value = 100000, .gpios = (0 << 0) },
692 { .value = 500000, .gpios = (1 << 0) },
693};
694
695static struct gpio_regulator_config bq24022_info = {
696 .supply_name = "bq24022",
697
698 .enable_gpio = GPIO72_HX4700_BQ24022_nCHARGE_EN,
699 .enable_high = 0,
700 .enabled_at_boot = 0,
701
702 .gpios = bq24022_gpios,
703 .nr_gpios = ARRAY_SIZE(bq24022_gpios),
704
705 .states = bq24022_states,
706 .nr_states = ARRAY_SIZE(bq24022_states),
707
708 .type = REGULATOR_CURRENT,
709 .init_data = &bq24022_init_data,
689}; 710};
690 711
691static struct platform_device bq24022 = { 712static struct platform_device bq24022 = {
692 .name = "bq24022", 713 .name = "gpio-regulator",
693 .id = -1, 714 .id = -1,
694 .dev = { 715 .dev = {
695 .platform_data = &bq24022_info, 716 .platform_data = &bq24022_info,