]> Git Repo - linux.git/commitdiff
spi: atmel: add deepest PM support to SAMA5D2
authorQuentin Schulz <[email protected]>
Fri, 14 Apr 2017 08:22:43 +0000 (10:22 +0200)
committerMark Brown <[email protected]>
Tue, 18 Apr 2017 17:50:05 +0000 (18:50 +0100)
This adds deepest (Backup+Self-Refresh) PM support to the ATMEL SAMA5D2
SoC's SPI controller.

When resuming from deepest state, it is required to restore MR register
as the registers are lost since VDD core has been shut down when
entering deepest state on the SAMA5D2.

Signed-off-by: Quentin Schulz <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
drivers/spi/spi-atmel.c

index 247d920a512f6926ba7bc386e4ee14a88782bae7..1eb83c9613d59cb0a3ab709aea61516e59226c4a 100644 (file)
@@ -1702,8 +1702,17 @@ static int atmel_spi_suspend(struct device *dev)
 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;
 
+       ret = clk_prepare_enable(as->clk);
+       if (ret)
+               return ret;
+
+       atmel_spi_init(as);
+
+       clk_disable_unprepare(as->clk);
+
        if (!pm_runtime_suspended(dev)) {
                ret = atmel_spi_runtime_resume(dev);
                if (ret)
This page took 0.061754 seconds and 4 git commands to generate.