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
<linux/gpio.h> header even if they weren't actually using
it, and in these cases I simply replaced that inclusion with
the more appropriate <linux/gpio/machine.h> which is what
board files should be including most of the time.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Linus Walleij
2018-12-02 09:43:22 +01:00
committed by Ulf Hansson
parent 5128f8d445
commit 32d1544880
21 changed files with 322 additions and 11 deletions

View File

@@ -21,7 +21,7 @@
#include <linux/serial_8250.h>
#include <linux/dm9000.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/platform_data/i2c-pxa.h>
#include <linux/platform_data/mtd-nand-pxa3xx.h>
@@ -331,8 +331,22 @@ static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
.gpio_power = -1
};
static struct gpiod_lookup_table mxm_8x10_mci_gpio_table = {
.dev_id = "pxa2xx-mci.0",
.table = {
/* Card detect on GPIO 72 */
GPIO_LOOKUP("gpio-pxa", MXM_8X10_SD_nCD,
"cd", GPIO_ACTIVE_LOW),
/* Write protect on GPIO 84 */
GPIO_LOOKUP("gpio-pxa", MXM_8X10_SD_WP,
"wp", GPIO_ACTIVE_LOW),
{ },
},
};
void __init mxm_8x10_mmc_init(void)
{
gpiod_add_lookup_table(&mxm_8x10_mci_gpio_table);
pxa_set_mci_info(&mxm_8x10_mci_platform_data);
}
#endif