Thread (10 messages) 10 messages, 4 authors, 2012-09-27
STALE4994d

[PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

From: Vipul Kumar Samar <hidden>
Date: 2012-09-26 11:24:06
Also in: linux-arm-kernel
Subsystem: arm primecell ssp pl022 spi driver, spi subsystem, the rest · Maintainers: Linus Walleij, Mark Brown, Linus Torvalds

SPI functional clock must be disalble/enable in non RTPM suspend/resume
hooks. Currently it is only done for RTPM cases.

This patch add support to disable/enbale clock for conventional
suspend/resume calls.

Signed-off-by: Vipul Kumar Samar <redacted>
---
 drivers/spi/spi-pl022.c |    8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f2a80ff..09fb09e 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2310,6 +2310,8 @@ static int pl022_suspend(struct device *dev)
 	}
 
 	dev_dbg(dev, "suspended\n");
+	clk_disable(pl022->clk);
+
 	return 0;
 }
 
@@ -2318,6 +2320,12 @@ static int pl022_resume(struct device *dev)
 	struct pl022 *pl022 = dev_get_drvdata(dev);
 	int ret;
 
+	ret = clk_enable(pl022->clk);
+	if (ret) {
+		dev_err(dev, "could not enable SSP/SPI bus clock\n");
+		return ret;
+	}
+
 	/* Start the queue running */
 	ret = spi_master_resume(pl022->master);
 	if (ret)
-- 
1.7.10


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help