pxa2xx_spi: restore DRCMR on resume

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, April 21, 2009 - 3:00 pm

Gitweb:     http://git.kernel.org/linus/148da331200a0df8195e10eb8a38fd77bd7003af
Commit:     148da331200a0df8195e10eb8a38fd77bd7003af
Parent:     aa0b8f3687f06ac0e5a2b24547fdf431e923c475
Author:     Daniel Ribeiro <drwyrm@gmail.com>
AuthorDate: Tue Apr 21 12:24:43 2009 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Tue Apr 21 13:41:49 2009 -0700

    pxa2xx_spi: restore DRCMR on resume
    
    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 |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index c76feea..1a00b41 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -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);
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pxa2xx_spi: restore DRCMR on resume, Linux Kernel Mailing ..., (Tue Apr 21, 3:00 pm)