From 32d1544880aa87aebe4d20babb48615c65874b02 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sun, 2 Dec 2018 09:43:22 +0100 Subject: ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP This adds GPIO descriptor look-up tables for a whole bunch of PXA boards with MMC card detect (CD) and write protect (WP) GPIO lines, so we can move away from the hard-coded GPIO numberspace. In some cases the platforms were compulsively including the header even if they weren't actually using it, and in these cases I simply replaced that inclusion with the more appropriate which is what board files should be including most of the time. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson --- arch/arm/mach-pxa/tosa.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch/arm/mach-pxa/tosa.c') diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index cb5cd8e78c94..e53128e88be8 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -296,6 +297,17 @@ static struct pxamci_platform_data tosa_mci_platform_data = { .gpio_power = TOSA_GPIO_PWR_ON, }; +static struct gpiod_lookup_table tosa_mci_gpio_table = { + .dev_id = "pxa2xx-mci.0", + .table = { + GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_nSD_DETECT, + "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_SD_WP, + "wp", GPIO_ACTIVE_LOW), + { }, + }, +}; + /* * Irda */ @@ -908,6 +920,7 @@ static void __init tosa_init(void) /* enable batt_fault */ PMCR = 0x01; + gpiod_add_lookup_table(&tosa_mci_gpio_table); pxa_set_mci_info(&tosa_mci_platform_data); pxa_set_ficp_info(&tosa_ficp_platform_data); pxa_set_i2c_info(NULL); -- cgit v1.2.3