[U-Boot] [PATCH 3/3] spi/kirkwood: add weak functions board_spi_claim/release_bus

Valentin Longchamp valentin.longchamp at keymile.com
Wed May 16 12:53:43 CEST 2012


This allows a final, board specific, step in the claim/relase_bus
function for the SPI controller, which may be needed for some hardware
designs.

Signed-off-by: Valentin Longchamp <valentin.longchamp at keymile.com>
cc: Holger Brunck <holger.brunck at keymile.com>
cc: Prafulla Wadaskar <prafulla at marvell.com>
---
 drivers/spi/kirkwood_spi.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 0877915..0e4db45 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -86,6 +86,11 @@ void spi_free_slave(struct spi_slave *slave)
 	free(slave);
 }
 
+__attribute__((weak)) int board_spi_claim_bus(struct spi_slave *slave)
+{
+	return 0;
+}
+
 int spi_claim_bus(struct spi_slave *slave)
 {
 	u32 config;
@@ -121,12 +126,18 @@ int spi_claim_bus(struct spi_slave *slave)
 	/* finally set chosen mpp spi configuration */
 	kirkwood_mpp_conf(spi_mpp_config);
 
-	return 0;
+	return board_spi_claim_bus(slave);
+}
+
+__attribute__((weak)) void board_spi_release_bus(struct spi_slave *slave)
+{
 }
 
 void spi_release_bus(struct spi_slave *slave)
 {
 	kirkwood_mpp_restore();
+
+	board_spi_release_bus(slave);
 }
 
 #ifndef CONFIG_SPI_CS_IS_VALID
-- 
1.7.1



More information about the U-Boot mailing list