From 58e2d877e37018b3804ab2601d9c9ad3fbcc74e7 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sun, 2 Dec 2018 09:43:23 +0100 Subject: ARM: pxa: Add GPIO descriptors for Palm27x The Palm27x devices set up the MMC card detect and write protect lines with a special helper function. Augment this helper function to also accept an optional GPIO descriptor table and pass and register this for all the Palm27x devices in that family. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Acked-by: Robert Jarzmik Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson --- arch/arm/mach-pxa/palmtreo.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-pxa/palmtreo.c') diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index b66b0b11d717..250e8e27cab9 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c @@ -480,23 +480,47 @@ void __init treo680_gpio_init(void) gpio_free(GPIO_NR_TREO680_LCD_EN_N); } +static struct gpiod_lookup_table treo680_mci_gpio_table = { + .dev_id = "pxa2xx-mci.0", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N, + "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO680_SD_READONLY, + "wp", GPIO_ACTIVE_LOW), + { }, + }, +}; + static void __init treo680_init(void) { pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); palmphone_common_init(); treo680_gpio_init(); - palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, - GPIO_NR_TREO680_SD_POWER, 0); + palm27x_mmc_init(&treo680_mci_gpio_table, + GPIO_NR_TREO_SD_DETECT_N, + GPIO_NR_TREO680_SD_READONLY, + GPIO_NR_TREO680_SD_POWER, 0); } #endif #ifdef CONFIG_MACH_CENTRO + +static struct gpiod_lookup_table centro685_mci_gpio_table = { + .dev_id = "pxa2xx-mci.0", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N, + "cd", GPIO_ACTIVE_LOW), + { }, + }, +}; + static void __init centro_init(void) { pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config)); palmphone_common_init(); - palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1, - GPIO_NR_CENTRO_SD_POWER, 1); + palm27x_mmc_init(¢ro685_mci_gpio_table, + GPIO_NR_TREO_SD_DETECT_N, -1, + GPIO_NR_CENTRO_SD_POWER, 1); } #endif -- cgit v1.2.1