Commit 7a4e28ab authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'spi/fix/imx' and 'spi/fix/sh-msiof' into spi-linus

...@@ -1668,12 +1668,23 @@ static int spi_imx_remove(struct platform_device *pdev) ...@@ -1668,12 +1668,23 @@ static int spi_imx_remove(struct platform_device *pdev)
{ {
struct spi_master *master = platform_get_drvdata(pdev); struct spi_master *master = platform_get_drvdata(pdev);
struct spi_imx_data *spi_imx = spi_master_get_devdata(master); struct spi_imx_data *spi_imx = spi_master_get_devdata(master);
int ret;
spi_bitbang_stop(&spi_imx->bitbang); 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); writel(0, spi_imx->base + MXC_CSPICTRL);
clk_unprepare(spi_imx->clk_ipg); clk_disable_unprepare(spi_imx->clk_ipg);
clk_unprepare(spi_imx->clk_per); clk_disable_unprepare(spi_imx->clk_per);
spi_imx_sdma_exit(spi_imx); spi_imx_sdma_exit(spi_imx);
spi_master_put(master); spi_master_put(master);
......
...@@ -784,11 +784,21 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx, ...@@ -784,11 +784,21 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
goto stop_dma; 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); ret = sh_msiof_wait_for_completion(p);
if (ret) if (ret)
goto stop_reset; 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 */ /* clear status bits */
sh_msiof_reset_str(p); sh_msiof_reset_str(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment