[U-Boot] [PATCH v4 3/4] tegra2: Modify MMC driver to handle power and cd GPIOs
Thierry Reding
thierry.reding at avionic-design.de
Wed Nov 16 21:29:08 CET 2011
* 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 <swarren at nvidia.com>
> Tested-by: Simon Glass <sjg at chromium.org>
> ---
> 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
More information about the U-Boot
mailing list