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>
这个提交包含在:
@@ -31,6 +31,7 @@
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/machine.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/pda_power.h>
|
||||
@@ -402,6 +403,19 @@ static struct pxamci_platform_data mioa701_mci_info = {
|
||||
.gpio_power = GPIO91_SDIO_EN,
|
||||
};
|
||||
|
||||
static struct gpiod_lookup_table mioa701_mci_gpio_table = {
|
||||
.dev_id = "pxa2xx-mci.0",
|
||||
.table = {
|
||||
/* Card detect on GPIO 15 */
|
||||
GPIO_LOOKUP("gpio-pxa", GPIO15_SDIO_INSERT,
|
||||
"cd", GPIO_ACTIVE_LOW),
|
||||
/* Write protect on GPIO 78 */
|
||||
GPIO_LOOKUP("gpio-pxa", GPIO78_SDIO_RO,
|
||||
"wp", GPIO_ACTIVE_LOW),
|
||||
{ },
|
||||
},
|
||||
};
|
||||
|
||||
/* FlashRAM */
|
||||
static struct resource docg3_resource = {
|
||||
.start = PXA_CS0_PHYS,
|
||||
@@ -743,6 +757,7 @@ static void __init mioa701_machine_init(void)
|
||||
pr_err("MioA701: Failed to request GPIOs: %d", rc);
|
||||
bootstrap_init();
|
||||
pxa_set_fb_info(NULL, &mioa701_pxafb_info);
|
||||
gpiod_add_lookup_table(&mioa701_mci_gpio_table);
|
||||
pxa_set_mci_info(&mioa701_mci_info);
|
||||
pxa_set_keypad_info(&mioa701_keypad_info);
|
||||
pxa_set_udc_info(&mioa701_udc_info);
|
||||
|
在新工单中引用
屏蔽一个用户