Merge tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[sfrench/cifs-2.6.git] / arch / arm / mach-pxa / magician.c
index 08b079653c3f9017c621047af79f836a06a9c430..75abc21083ebb2efd613a060ccc9ddd1c1da7630 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
  */
@@ -932,7 +940,7 @@ struct pxa2xx_spi_chip tsc2046_chip_info = {
        .gpio_cs        = GPIO14_MAGICIAN_TSC2046_CS,
 };
 
-static struct pxa2xx_spi_master magician_spi_info = {
+static struct pxa2xx_spi_controller magician_spi_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
@@ -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));
 }