Skip to content

Commit

Permalink
spi: dw: Move num-of retries parameter to the header file
Browse files Browse the repository at this point in the history
The parameter will be needed for another wait-done method being added in
the framework of the SPI memory operation modification in a further
commit.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201007235511.4935-16-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Serge Semin authored and Mark Brown committed Oct 8, 2020
1 parent 49d7d69 commit cf75bae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/spi/spi-dw-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "spi-dw.h"

#define WAIT_RETRIES 5
#define RX_BUSY 0
#define RX_BURST_LEVEL 16
#define TX_BUSY 1
Expand Down Expand Up @@ -240,7 +239,7 @@ static inline bool dw_spi_dma_tx_busy(struct dw_spi *dws)
static int dw_spi_dma_wait_tx_done(struct dw_spi *dws,
struct spi_transfer *xfer)
{
int retry = WAIT_RETRIES;
int retry = SPI_WAIT_RETRIES;
struct spi_delay delay;
u32 nents;

Expand Down Expand Up @@ -324,7 +323,7 @@ static inline bool dw_spi_dma_rx_busy(struct dw_spi *dws)

static int dw_spi_dma_wait_rx_done(struct dw_spi *dws)
{
int retry = WAIT_RETRIES;
int retry = SPI_WAIT_RETRIES;
struct spi_delay delay;
unsigned long ns, us;
u32 nents;
Expand Down
2 changes: 2 additions & 0 deletions drivers/spi/spi-dw.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
#define SPI_DMA_RDMAE (1 << 0)
#define SPI_DMA_TDMAE (1 << 1)

#define SPI_WAIT_RETRIES 5

enum dw_ssi_type {
SSI_MOTO_SPI = 0,
SSI_TI_SSP,
Expand Down

0 comments on commit cf75bae

Please sign in to comment.