Merge tag 'mmc-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[sfrench/cifs-2.6.git] / arch / mips / jz4740 / board-qi_lb60.c
index af0c8ace0141667337e39b615220da512ebc8586..6718efb400f43145974a0a545eeb486d8a58d25b 100644 (file)
@@ -43,9 +43,6 @@
 #include "clock.h"
 
 /* GPIOs */
-#define QI_LB60_GPIO_SD_CD             JZ_GPIO_PORTD(0)
-#define QI_LB60_GPIO_SD_VCC_EN_N       JZ_GPIO_PORTD(2)
-
 #define QI_LB60_GPIO_KEYOUT(x)         (JZ_GPIO_PORTC(10) + (x))
 #define QI_LB60_GPIO_KEYIN(x)          (JZ_GPIO_PORTD(18) + (x))
 #define QI_LB60_GPIO_KEYIN8            JZ_GPIO_PORTD(26)
@@ -386,10 +383,16 @@ static struct platform_device qi_lb60_gpio_keys = {
 };
 
 static struct jz4740_mmc_platform_data qi_lb60_mmc_pdata = {
-       .gpio_card_detect       = QI_LB60_GPIO_SD_CD,
-       .gpio_read_only         = -1,
-       .gpio_power             = QI_LB60_GPIO_SD_VCC_EN_N,
-       .power_active_low       = 1,
+       /* Intentionally left blank */
+};
+
+static struct gpiod_lookup_table qi_lb60_mmc_gpio_table = {
+       .dev_id = "jz4740-mmc.0",
+       .table = {
+               GPIO_LOOKUP("GPIOD", 0, "cd", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("GPIOD", 2, "power", GPIO_ACTIVE_LOW),
+               { },
+       },
 };
 
 /* beeper */
@@ -500,6 +503,7 @@ static int __init qi_lb60_init_platform_devices(void)
        gpiod_add_lookup_table(&qi_lb60_audio_gpio_table);
        gpiod_add_lookup_table(&qi_lb60_nand_gpio_table);
        gpiod_add_lookup_table(&qi_lb60_spigpio_gpio_table);
+       gpiod_add_lookup_table(&qi_lb60_mmc_gpio_table);
 
        spi_register_board_info(qi_lb60_spi_board_info,
                                ARRAY_SIZE(qi_lb60_spi_board_info));