From: Thierry Reding Date: Wed, 16 Nov 2011 21:29:08 +0100 Subject: [U-Boot] [PATCH v4 3/4] tegra2: Modify MMC driver to handle power and cd GPIOs In-Reply-To: <1318432727-32446-3-git-send-email-swarren@nvidia.com> References: <1318432727-32446-1-git-send-email-swarren@nvidia.com> <1318432727-32446-3-git-send-email-swarren@nvidia.com> Message-ID: <20111116202908.GA10067@avionic-0098.mockup.avionic-design.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de * Stephen Warren wrote: > 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 > Tested-by: Simon Glass > --- > board/nvidia/common/board.h | 3 +- > board/nvidia/harmony/harmony.c | 27 ++--------------------- > board/nvidia/seaboard/seaboard.c | 33 +---------------------------- > drivers/mmc/tegra2_mmc.c | 42 ++++++++++++++++++++++++++++++++----- > drivers/mmc/tegra2_mmc.h | 4 ++- > 5 files changed, 45 insertions(+), 64 deletions(-) > > diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h > index 344e702..35acbca 100644 > --- a/board/nvidia/common/board.h > +++ b/board/nvidia/common/board.h > @@ -26,7 +26,6 @@ > > void tegra2_start(void); > void gpio_config_uart(void); > -void gpio_config_mmc(void); > -int tegra2_mmc_init(int dev_index, int bus_width); > +int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio); [...] Can we move tegra2_start() and tegra2_mmc_init() into a common Tegra2 header instead of a board-specific one, please? Both functions are not implemented below board/nvidia/common, so there is no need to make their prototype only visible for board/nvidia. Otherwise other boards will have to duplicate this prototype and need to keep it in sync. tegra2_start() can probably go into arch/arm/include/asm/arch-tegra2/tegra2.h and tegra2_mmc_init() could for example go into a new mmc.h in the same directory. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20111116/8d7b5649/attachment.pgp