spi: fsl-dspi: Use pinctrl PM helpers
authorMirza Krak <mirza.krak@hostmobility.com>
Fri, 12 Jun 2015 16:55:22 +0000 (18:55 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 12 Jun 2015 17:28:13 +0000 (18:28 +0100)
Add support for "sleep" state of pinctrl.

Signed-off-by: Mirza Krak <mirza.krak@hostmobility.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c

index 451a837e5613ca6b53f328b9f87a7fd61c38b985..86bcdd68c1fe09f1640fc352cc2d94f0aa53566d 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
@@ -613,6 +614,8 @@ static int dspi_suspend(struct device *dev)
        spi_master_suspend(master);
        clk_disable_unprepare(dspi->clk);
 
+       pinctrl_pm_select_sleep_state(dev);
+
        return 0;
 }
 
@@ -621,6 +624,8 @@ static int dspi_resume(struct device *dev)
        struct spi_master *master = dev_get_drvdata(dev);
        struct fsl_dspi *dspi = spi_master_get_devdata(master);
 
+       pinctrl_pm_select_default_state(dev);
+
        clk_prepare_enable(dspi->clk);
        spi_master_resume(master);