pxa2xx_spi: restore DRCMR on resume
authorDaniel Ribeiro <drwyrm@gmail.com>
Tue, 21 Apr 2009 19:24:43 +0000 (12:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Apr 2009 20:41:49 +0000 (13:41 -0700)
If DMA is enabled, any spi_sync call after suspend/resume would block
forever, because DRCMR is lost on suspend.  This patch restores DRCMR to
the same values set by probe.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/pxa2xx_spi.c

index c76feea5fe259bccd30daff57c8293a1f61bb2e9..1a00b415bcc4846927dc399c32fed9be3832275f 100644 (file)
@@ -1700,6 +1700,13 @@ static int pxa2xx_spi_resume(struct platform_device *pdev)
        struct ssp_device *ssp = drv_data->ssp;
        int status = 0;
 
+       if (drv_data->rx_channel != -1)
+               DRCMR(drv_data->ssp->drcmr_rx) =
+                       DRCMR_MAPVLD | drv_data->rx_channel;
+       if (drv_data->tx_channel != -1)
+               DRCMR(drv_data->ssp->drcmr_tx) =
+                       DRCMR_MAPVLD | drv_data->tx_channel;
+
        /* Enable the SSP clock */
        clk_enable(ssp->clk);