Merge remote-tracking branch 'spi/for-next'
[linux] / arch / arm / mach-pxa / magician.c
index 618bcff..75abc21 100644 (file)
@@ -645,9 +645,8 @@ static struct regulator_init_data bq24022_init_data = {
        .consumer_supplies      = bq24022_consumers,
 };
 
-static struct gpio bq24022_gpios[] = {
-       { EGPIO_MAGICIAN_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
-};
+
+static enum gpiod_flags bq24022_gpiod_gflags[] = { GPIOD_OUT_LOW };
 
 static struct gpio_regulator_state bq24022_states[] = {
        { .value = 100000, .gpios = (0 << 0) },
@@ -657,12 +656,10 @@ static struct gpio_regulator_state bq24022_states[] = {
 static struct gpio_regulator_config bq24022_info = {
        .supply_name            = "bq24022",
 
-       .enable_gpio            = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
-       .enable_high            = 0,
        .enabled_at_boot        = 1,
 
-       .gpios                  = bq24022_gpios,
-       .nr_gpios               = ARRAY_SIZE(bq24022_gpios),
+       .gflags = bq24022_gpiod_gflags,
+       .ngpios = ARRAY_SIZE(bq24022_gpiod_gflags),
 
        .states                 = bq24022_states,
        .nr_states              = ARRAY_SIZE(bq24022_states),
@@ -679,6 +676,17 @@ static struct platform_device bq24022 = {
        },
 };
 
+static struct gpiod_lookup_table bq24022_gpiod_table = {
+       .dev_id = "gpio-regulator",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", EGPIO_MAGICIAN_BQ24022_ISET2,
+                           NULL, GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
+                           "enable", GPIO_ACTIVE_LOW),
+               { },
+       },
+};
+
 /*
  * fixed regulator for ads7846
  */
@@ -1027,6 +1035,7 @@ static void __init magician_init(void)
        regulator_register_always_on(0, "power", pwm_backlight_supply,
                ARRAY_SIZE(pwm_backlight_supply), 5000000);
 
+       gpiod_add_lookup_table(&bq24022_gpiod_table);
        platform_add_devices(ARRAY_AND_SIZE(devices));
 }