Skip to content

Commit

Permalink
Merge remote-tracking branch 'spi/fix/rockchip' into spi-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Oct 3, 2014
2 parents fe82dce + a24e70c commit 62d02e4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/spi/spi-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static void rockchip_spi_dma_txcb(void *data)
spin_unlock_irqrestore(&rs->lock, flags);
}

static int rockchip_spi_dma_transfer(struct rockchip_spi *rs)
static void rockchip_spi_prepare_dma(struct rockchip_spi *rs)
{
unsigned long flags;
struct dma_slave_config rxconf, txconf;
Expand Down Expand Up @@ -474,8 +474,6 @@ static int rockchip_spi_dma_transfer(struct rockchip_spi *rs)
dmaengine_submit(txdesc);
dma_async_issue_pending(rs->dma_tx.ch);
}

return 1;
}

static void rockchip_spi_config(struct rockchip_spi *rs)
Expand Down Expand Up @@ -557,16 +555,17 @@ static int rockchip_spi_transfer_one(
else if (rs->rx)
rs->tmode = CR0_XFM_RO;

if (master->can_dma && master->can_dma(master, spi, xfer))
/* we need prepare dma before spi was enabled */
if (master->can_dma && master->can_dma(master, spi, xfer)) {
rs->use_dma = 1;
else
rockchip_spi_prepare_dma(rs);
} else {
rs->use_dma = 0;
}

rockchip_spi_config(rs);

if (rs->use_dma)
ret = rockchip_spi_dma_transfer(rs);
else
if (!rs->use_dma)
ret = rockchip_spi_pio_transfer(rs);

return ret;
Expand Down

0 comments on commit 62d02e4

Please sign in to comment.