summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGao Pan <gaopan@freescale.com>2015-06-04 16:57:47 +0800
committerGao Pan <pandy.gao@nxp.com>2016-02-26 16:04:32 +0800
commit107ea037b85a15187a3e683076a885540bcf90a7 (patch)
tree406dcaa75214fc847297cbe5d3c7e2a6f845b34b
parenta2eb2786d72a15af3fab1856787e20af20f58385 (diff)
MLK-11405 spi: imx : sets spi IOMUX to default state
SPI IOMUX is changed into reset state in LPSR mode. As a result, spi can't work again. This patch sets spi IOMUX to default state. (cherry-picked from commit 2c8603c31831bb355f6be5b015377fb8fbd89844) Signed-off-by: Gao Pan <b54642@freescale.com>
-rw-r--r--drivers/spi/spi-imx.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 3e10ca8a50ef..8c0e0ccff1de 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1315,11 +1315,31 @@ static int spi_imx_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int spi_imx_suspend(struct device *dev)
+{
+ pinctrl_pm_select_sleep_state(dev);
+ return 0;
+}
+
+static int spi_imx_resume(struct device *dev)
+{
+ pinctrl_pm_select_default_state(dev);
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(imx_spi_pm, spi_imx_suspend, spi_imx_resume);
+#define IMX_SPI_PM (&imx_spi_pm)
+#else
+#define IMX_SPI_PM NULL
+#endif
+
static struct platform_driver spi_imx_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spi_imx_dt_ids,
- },
+ .pm = IMX_SPI_PM,
+ },
.id_table = spi_imx_devtype,
.probe = spi_imx_probe,
.remove = spi_imx_remove,