power: supply: gpio-charger: Convert to GPIO descriptors
[sfrench/cifs-2.6.git] / arch / arm / mach-pxa / tosa.c
index 3d2c108e911e29397c1a1ea2e482a22b884cf359..431709725d02bbd5878502f5f17b147e8fa0c341 100644 (file)
@@ -369,6 +369,15 @@ static struct pxaficp_platform_data tosa_ficp_platform_data = {
 /*
  * Tosa AC IN
  */
+static struct gpiod_lookup_table tosa_power_gpiod_table = {
+       .dev_id = "gpio-charger",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_AC_IN,
+                           NULL, GPIO_ACTIVE_LOW),
+               { },
+       },
+};
+
 static char *tosa_ac_supplied_to[] = {
        "main-battery",
        "backup-battery",
@@ -378,8 +387,6 @@ static char *tosa_ac_supplied_to[] = {
 static struct gpio_charger_platform_data tosa_power_data = {
        .name                   = "charger",
        .type                   = POWER_SUPPLY_TYPE_MAINS,
-       .gpio                   = TOSA_GPIO_AC_IN,
-       .gpio_active_low        = 1,
        .supplied_to            = tosa_ac_supplied_to,
        .num_supplicants        = ARRAY_SIZE(tosa_ac_supplied_to),
 };
@@ -951,6 +958,7 @@ static void __init tosa_init(void)
        clk_add_alias("CLK_CK3P6MI", tc6393xb_device.name, "GPIO11_CLK", NULL);
 
        gpiod_add_lookup_table(&tosa_udc_gpiod_table);
+       gpiod_add_lookup_table(&tosa_power_gpiod_table);
        platform_add_devices(devices, ARRAY_SIZE(devices));
 }