ARM: OMAP2+: fix N810 MMC gpiod table
authorAaro Koskinen <aaro.koskinen@iki.fi>
Fri, 23 Feb 2024 18:14:36 +0000 (20:14 +0200)
committerTony Lindgren <tony@atomide.com>
Fri, 8 Mar 2024 08:50:02 +0000 (10:50 +0200)
Trying to append a second table for the same dev_id doesn't seem to work.
The second table is just silently ignored. As a result eMMC GPIOs are not
present.

Fix by using separate tables for N800 and N810.

Fixes: e519f0bb64ef ("ARM/mmc: Convert old mmci-omap to GPIO descriptors")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Message-ID: <20240223181439.1099750-3-aaro.koskinen@iki.fi>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-n8x0.c

index 3e48f34016c1920b7b2546c737b41d82acbc5e97..c933a91751e4fc29902999342d4e1d009201d070 100644 (file)
@@ -140,7 +140,7 @@ static int slot1_cover_open;
 static int slot2_cover_open;
 static struct device *mmc_device;
 
-static struct gpiod_lookup_table nokia8xx_mmc_gpio_table = {
+static struct gpiod_lookup_table nokia800_mmc_gpio_table = {
        .dev_id = "mmci-omap.0",
        .table = {
                /* Slot switch, GPIO 96 */
@@ -152,6 +152,8 @@ static struct gpiod_lookup_table nokia8xx_mmc_gpio_table = {
 static struct gpiod_lookup_table nokia810_mmc_gpio_table = {
        .dev_id = "mmci-omap.0",
        .table = {
+               /* Slot switch, GPIO 96 */
+               GPIO_LOOKUP("gpio-96-127", 0, "switch", GPIO_ACTIVE_HIGH),
                /* Slot index 1, VSD power, GPIO 23 */
                GPIO_LOOKUP_IDX("gpio-0-31", 23, "vsd", 1, GPIO_ACTIVE_HIGH),
                /* Slot index 1, VIO power, GPIO 9 */
@@ -412,8 +414,6 @@ static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];
 
 static void __init n8x0_mmc_init(void)
 {
-       gpiod_add_lookup_table(&nokia8xx_mmc_gpio_table);
-
        if (board_is_n810()) {
                mmc1_data.slots[0].name = "external";
 
@@ -426,6 +426,8 @@ static void __init n8x0_mmc_init(void)
                mmc1_data.slots[1].name = "internal";
                mmc1_data.slots[1].ban_openended = 1;
                gpiod_add_lookup_table(&nokia810_mmc_gpio_table);
+       } else {
+               gpiod_add_lookup_table(&nokia800_mmc_gpio_table);
        }
 
        mmc1_data.nr_slots = 2;