Skip to content

Commit

Permalink
Merge remote-tracking branches 'spi/fix/imx' and 'spi/fix/sh-msiof' i…
Browse files Browse the repository at this point in the history
…nto spi-linus
  • Loading branch information
Mark Brown committed Jan 26, 2018
3 parents 0c5b9b5 + d593574 + 89434c3 commit 7a4e28a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
15 changes: 13 additions & 2 deletions drivers/spi/spi-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,12 +1668,23 @@ static int spi_imx_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct spi_imx_data *spi_imx = spi_master_get_devdata(master);
int ret;

spi_bitbang_stop(&spi_imx->bitbang);

ret = clk_enable(spi_imx->clk_per);
if (ret)
return ret;

ret = clk_enable(spi_imx->clk_ipg);
if (ret) {
clk_disable(spi_imx->clk_per);
return ret;
}

writel(0, spi_imx->base + MXC_CSPICTRL);
clk_unprepare(spi_imx->clk_ipg);
clk_unprepare(spi_imx->clk_per);
clk_disable_unprepare(spi_imx->clk_ipg);
clk_disable_unprepare(spi_imx->clk_per);
spi_imx_sdma_exit(spi_imx);
spi_master_put(master);

Expand Down
12 changes: 11 additions & 1 deletion drivers/spi/spi-sh-msiof.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,21 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
goto stop_dma;
}

/* wait for tx fifo to be emptied / rx fifo to be filled */
/* wait for tx/rx DMA completion */
ret = sh_msiof_wait_for_completion(p);
if (ret)
goto stop_reset;

if (!rx) {
reinit_completion(&p->done);
sh_msiof_write(p, IER, IER_TEOFE);

/* wait for tx fifo to be emptied */
ret = sh_msiof_wait_for_completion(p);
if (ret)
goto stop_reset;
}

/* clear status bits */
sh_msiof_reset_str(p);

Expand Down

0 comments on commit 7a4e28a

Please sign in to comment.