[PATCH v2 03/14] spi: ath79: move spidelay from spi-bitbang-txrx

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Mon Apr 20 13:11:15 PDT 2015


Bitbang helpers for SPI require spidelay. This should be set
by the user and not the helper itself. Move it to ath79_spi
instead.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
Cc: barebox at lists.infradead.org
Cc: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 drivers/spi/ath79_spi.c        | 2 ++
 drivers/spi/spi-bitbang-txrx.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c
index d9ab269da770..4d71eba695a5 100644
--- a/drivers/spi/ath79_spi.c
+++ b/drivers/spi/ath79_spi.c
@@ -100,6 +100,8 @@ static inline u32 getmiso(struct spi_device *spi)
 	return !!((ath79_spi_rr(sc, AR71XX_SPI_REG_RDS) & 1));
 }
 
+#define spidelay(nsecs) udelay(nsecs/1000)
+
 #include "spi-bitbang-txrx.h"
 
 static inline void ath79_spi_chipselect(struct ath79_spi *sp, int chipselect)
diff --git a/drivers/spi/spi-bitbang-txrx.h b/drivers/spi/spi-bitbang-txrx.h
index 4c74d4e0c514..078ab8c6c000 100644
--- a/drivers/spi/spi-bitbang-txrx.h
+++ b/drivers/spi/spi-bitbang-txrx.h
@@ -42,8 +42,6 @@
  * particular CPU clock rate.
  */
 
-#define spidelay(nsecs) udelay(nsecs/1000)
-
 static inline u32
 bitbang_txrx_be_cpha0(struct spi_device *spi,
 		unsigned nsecs, unsigned cpol,
-- 
2.1.0




More information about the barebox mailing list