Skip to contentSkip to conversation

pxa2xx_spi: restore DRCMR on resume

PATCH New David Brownell 1 participant 1 message Apr 16, 2009 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa2xx_spi: restore DRCMR on resume

From: Daniel Ribeiro <[email protected]>

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.

---
 drivers/spi/pxa2xx_spi.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/spi/pxa2xx_spi.c +7 -0
@@ -1700,6 +1700,13 @@ static int pxa2xx_spi_resume(struct plat
 	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);
 

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p