OSDN Git Service

ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP
[uclinux-h8/linux.git] / arch / arm / mach-pxa / csb726.c
index 271aeda..45d5dd5 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/partitions.h>
@@ -134,6 +134,19 @@ static struct pxamci_platform_data csb726_mci = {
        .gpio_power             = -1,
 };
 
+static struct gpiod_lookup_table csb726_mci_gpio_table = {
+       .dev_id = "pxa2xx-mci.0",
+       .table = {
+               /* Card detect on GPIO 100 */
+               GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_DETECT,
+                           "cd", GPIO_ACTIVE_LOW),
+               /* Write protect on GPIO 101 */
+               GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_RO,
+                           "wp", GPIO_ACTIVE_LOW),
+               { },
+       },
+};
+
 static struct pxaohci_platform_data csb726_ohci_platform_data = {
        .port_mode      = PMM_NPS_MODE,
        .flags          = ENABLE_PORT1 | NO_OC_PROTECTION,
@@ -264,6 +277,7 @@ static void __init csb726_init(void)
        pxa_set_stuart_info(NULL);
        pxa_set_i2c_info(NULL);
        pxa27x_set_i2c_power_info(NULL);
+       gpiod_add_lookup_table(&csb726_mci_gpio_table);
        pxa_set_mci_info(&csb726_mci);
        pxa_set_ohci_info(&csb726_ohci_platform_data);
        pxa_set_ac97_info(NULL);