]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi/pl022: Activate resourses before deactivate them in suspend
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 17 Oct 2012 12:27:16 +0000 (14:27 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 17 Oct 2012 13:14:24 +0000 (22:14 +0900)
To be able to deactivate resourses in suspend, the resourses must
first be surely active. This is done with a pm_runtime_get_sync.
Once the resourses are restored to active state again in resume,
the runtime pm usage count can be decreased with a pm_runtime_put.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/spi/spi-pl022.c

index a9106c936edbeb21bfb87dfab798b77993cf1c3f..c220c234627605f06e1371009430d7a5e1897a28 100644 (file)
@@ -2349,6 +2349,8 @@ static int pl022_suspend(struct device *dev)
                dev_warn(dev, "cannot suspend master\n");
                return ret;
        }
+
+       pm_runtime_get_sync(dev);
        pl022_suspend_resources(pl022);
 
        dev_dbg(dev, "suspended\n");
@@ -2361,6 +2363,7 @@ static int pl022_resume(struct device *dev)
        int ret;
 
        pl022_resume_resources(pl022);
+       pm_runtime_put(dev);
 
        /* Start the queue running */
        ret = spi_master_resume(pl022->master);