spi: sirf: Add missing spi_master_{resume,suspend} calls to PM callbacks
authorAxel Lin <axel.lin@ingics.com>
Wed, 5 Mar 2014 07:19:09 +0000 (15:19 +0800)
committerMark Brown <broonie@linaro.org>
Thu, 13 Mar 2014 09:57:29 +0000 (09:57 +0000)
This is required since commit 2025172e3280 "spi/bitbang: Use core message pump".
spi-bitbang now uses core message pump, so it needs to call spi_master_suspend/
spi_master_resume to stop/start the queue while suspend/resume.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-sirf.c

index a72b8f87a156c6b151504de30035081c8514cc3e..1a77ad52812fd79d3a2524264e7a2a8678ca1464 100644 (file)
@@ -748,6 +748,11 @@ static int spi_sirfsoc_suspend(struct device *dev)
 {
        struct spi_master *master = dev_get_drvdata(dev);
        struct sirfsoc_spi *sspi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = spi_master_suspend(master);
+       if (ret)
+               return ret;
 
        clk_disable(sspi->clk);
        return 0;
@@ -764,7 +769,7 @@ static int spi_sirfsoc_resume(struct device *dev)
        writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_RXFIFO_OP);
        writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
 
-       return 0;
+       return spi_master_resume(master);
 }
 #endif