diff mbox

[1/1,v2] spi: fsl-dspi: Use pinctrl PM helpers

Message ID 1434128122-773-1-git-send-email-mirza.krak@hostmobility.com (mailing list archive)
State Accepted
Commit 432a17d77a77009736f4dce84d3386398665fd29
Headers show

Commit Message

Mirza Krak June 12, 2015, 4:55 p.m. UTC
From: Mirza Krak <mirza.krak@hostmobility.com>

Add support for "sleep" state of pinctrl.

Signed-off-by: Mirza Krak <mirza.krak@hostmobility.com>
---

Changes V2:
- Added missing header

 drivers/spi/spi-fsl-dspi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mark Brown June 12, 2015, 5:28 p.m. UTC | #1
On Fri, Jun 12, 2015 at 06:55:22PM +0200, Mirza Krak wrote:
> From: Mirza Krak <mirza.krak@hostmobility.com>
> 
> Add support for "sleep" state of pinctrl.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index d1a39249704a..d6f362f37016 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -23,6 +23,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>
@@ -429,6 +430,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;
 }
 
@@ -437,6 +440,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);