From 9877841f6bba3723f5d21cc58eb99f3417e90725 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 31 Oct 2011 06:51:36 +0000 Subject: tegra2: Modify MMC driver to handle power and cd GPIOs Pass the GPIO numbers for power and card detect to tegra2_mmc_init(), and modify that function to perform all required GPIO initialization. This removes the need for board files to perform these operations. Move board_mmc_getcd() into tegra2_mmc.c now that the driver knows which GPIOs to use. Update affected call-sites in seaboard.c and harmony.c. Note that this change should make all SD ports work on Harmony, since the required GPIO setup is now being performed. v4: Fix prototype of tegra2_mmc_init() in board.h to match driver change. Remove prototype of gpio_config_mmc() from board.h Signed-off-by: Stephen Warren Cc: Andy Fleming Tested-by: Simon Glass Acked-by: Simon Glass Acked-by: Andy Fleming Signed-off-by: Tom Warren --- board/nvidia/harmony/harmony.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'board/nvidia/harmony') diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c index f2c3867..3cbe820 100644 --- a/board/nvidia/harmony/harmony.c +++ b/board/nvidia/harmony/harmony.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef CONFIG_TEGRA2_MMC #include #endif @@ -72,15 +73,6 @@ static void pin_mux_mmc(void) pinmux_tristate_disable(PINGRP_ATC); } -/* - * Routine: gpio_config_mmc - * Description: Set GPIOs for SD card - */ -void gpio_config_mmc(void) -{ - /* Not implemented for now */ -} - /* this is a weak define that we are overriding */ int board_mmc_init(bd_t *bd) { @@ -88,29 +80,16 @@ int board_mmc_init(bd_t *bd) /* Enable muxes, etc. for SDMMC controllers */ pin_mux_mmc(); - gpio_config_mmc(); debug("board_mmc_init: init SD slot J26\n"); /* init dev 0, SD slot J26, with 4-bit bus */ /* The board has an 8-bit bus, but 8-bit doesn't work yet */ - tegra2_mmc_init(0, 4); + tegra2_mmc_init(0, 4, GPIO_PI6, GPIO_PH2); debug("board_mmc_init: init SD slot J5\n"); /* init dev 2, SD slot J5, with 4-bit bus */ - tegra2_mmc_init(2, 4); + tegra2_mmc_init(2, 4, GPIO_PT3, GPIO_PI5); return 0; } - -/* this is a weak define that we are overriding */ -int board_mmc_getcd(u8 *cd, struct mmc *mmc) -{ - debug("board_mmc_getcd called\n"); - /* - * Hard-code CD presence for now. Need to add GPIO inputs - * for Harmony - */ - *cd = 1; - return 0; -} #endif -- cgit v1.1