mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks
@ 2014-03-05  3:29 Wenyou Yang
  2014-03-05  4:00 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Wenyou Yang @ 2014-03-05  3:29 UTC (permalink / raw)
  To: broonie, nicolas.ferre
  Cc: linux-spi, linux-kernel, linux-arm-kernel, wenyou.yang

The PM callbacks implemented by the spi-atmel driver don't call
spi_master_{resume,suspend}, fix that.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
Hi Mark, 

The patch is based on the branch: for-next
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

Best Regards,
Wenyou Yang

 drivers/spi/spi-atmel.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 47e7aeb..bda961e 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1440,6 +1440,14 @@ static int atmel_spi_suspend(struct device *dev)
 {
 	struct spi_master	*master = dev_get_drvdata(dev);
 	struct atmel_spi	*as = spi_master_get_devdata(master);
+	int ret;
+
+	/* Stop the queue running */
+	ret = spi_master_suspend(master);
+	if (ret) {
+		dev_warn(dev, "cannot suspend master\n");
+		return ret;
+	}
 
 	clk_disable_unprepare(as->clk);
 
@@ -1452,11 +1460,18 @@ static int atmel_spi_resume(struct device *dev)
 {
 	struct spi_master	*master = dev_get_drvdata(dev);
 	struct atmel_spi	*as = spi_master_get_devdata(master);
+	int ret;
 
 	pinctrl_pm_select_default_state(dev);
 
 	clk_prepare_enable(as->clk);
-	return 0;
+
+	/* Start the queue running */
+	ret = spi_master_resume(master);
+	if (ret)
+		dev_err(dev, "problem starting queue (%d)\n", ret);
+
+	return ret;
 }
 
 static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume);
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks
  2014-03-05  3:29 [PATCH] spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks Wenyou Yang
@ 2014-03-05  4:00 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-03-05  4:00 UTC (permalink / raw)
  To: Wenyou Yang; +Cc: nicolas.ferre, linux-spi, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

On Wed, Mar 05, 2014 at 11:29:01AM +0800, Wenyou Yang wrote:
> The PM callbacks implemented by the spi-atmel driver don't call
> spi_master_{resume,suspend}, fix that.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-05  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05  3:29 [PATCH] spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks Wenyou Yang
2014-03-05  4:00 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®