[U-Boot] [PATCH] spi_mmc: set default spi bus

Thomas Chou thomas at wytron.com.tw
Thu Apr 22 07:16:34 CEST 2010


This patch supports non-zero spi bus.

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
Tested spi_mmc on two nios2 boards.
Great job. Thanks.

 drivers/mmc/spi_mmc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/spi_mmc.c b/drivers/mmc/spi_mmc.c
index 90e583d..5791c13 100644
--- a/drivers/mmc/spi_mmc.c
+++ b/drivers/mmc/spi_mmc.c
@@ -992,6 +992,9 @@ static short mmc_spi_mmc_spi_get_card_old(struct mmc_spi_dev *pdev)
 #endif
 
 
+#ifndef CONFIG_SPI_MMC_DEFAULT_BUS
+# define CONFIG_SPI_MMC_DEFAULT_BUS 0
+#endif
 #ifndef CONFIG_SPI_MMC_DEFAULT_CS
 # define CONFIG_SPI_MMC_DEFAULT_CS 1
 #endif
@@ -1059,7 +1062,8 @@ static int spi_mmc_init(void)
 		spi_free_slave(slave);
 	}
 
-	slave = spi_setup_slave(0, CONFIG_SPI_MMC_DEFAULT_CS,
+	slave = spi_setup_slave(
+		CONFIG_SPI_MMC_DEFAULT_BUS, CONFIG_SPI_MMC_DEFAULT_CS,
 		CONFIG_SPI_MMC_DEFAULT_SPEED, CONFIG_SPI_MMC_DEFAULT_MODE);
 	if (!slave)
 		return -1;
-- 
1.6.6.1



More information about the U-Boot mailing list