spi: dw: DW SPI DMA Driver updates
Merge series from Joy Chakraborty <joychakr@google.com>: This Patch series adds support for 32 bits per word trasfers using DMA and some defensive checks around dma controller capabilities.
This commit is contained in:
commit
057e1ae744
|
@ -198,6 +198,20 @@ static irqreturn_t dw_spi_dma_transfer_handler(struct dw_spi *dws)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes)
|
||||
{
|
||||
switch (n_bytes) {
|
||||
case 1:
|
||||
return DMA_SLAVE_BUSWIDTH_1_BYTE;
|
||||
case 2:
|
||||
return DMA_SLAVE_BUSWIDTH_2_BYTES;
|
||||
case 4:
|
||||
return DMA_SLAVE_BUSWIDTH_4_BYTES;
|
||||
default:
|
||||
return DMA_SLAVE_BUSWIDTH_UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
static bool dw_spi_can_dma(struct spi_controller *master,
|
||||
struct spi_device *spi, struct spi_transfer *xfer)
|
||||
{
|
||||
|
@ -206,16 +220,6 @@ static bool dw_spi_can_dma(struct spi_controller *master,
|
|||
return xfer->len > dws->fifo_len;
|
||||
}
|
||||
|
||||
static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes)
|
||||
{
|
||||
if (n_bytes == 1)
|
||||
return DMA_SLAVE_BUSWIDTH_1_BYTE;
|
||||
else if (n_bytes == 2)
|
||||
return DMA_SLAVE_BUSWIDTH_2_BYTES;
|
||||
|
||||
return DMA_SLAVE_BUSWIDTH_UNDEFINED;
|
||||
}
|
||||
|
||||
static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)
|
||||
{
|
||||
unsigned long long ms;
|
||||
|
|
Loading…
Reference in New Issue