summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAllen Xu <b45815@freescale.com>2015-01-13 04:56:40 +0800
committerBrian Norris <computersforpeace@gmail.com>2015-01-15 19:30:30 -0800
commit45c6a0caeb2bde9e043bcd833af322db57a37498 (patch)
tree5ee56173e088019b4f92e39bcc16ad6b78f1816b /drivers/mtd
parent7c272ac5eefb329501aadbd9f21f86232c0f66a9 (diff)
downloadlinux-45c6a0caeb2bde9e043bcd833af322db57a37498.tar.gz
linux-45c6a0caeb2bde9e043bcd833af322db57a37498.tar.xz
mtd: spi-nor: fsl-qspi: support deep sleep mode for imx6 sx chip
i.mx6 sx support turn off fastmix and megamix power. qpsi controller can be turned off and all status lost when suspend/resume. add suspend/resume functions and reset qspi controller when resume. Signed-off-by: Allen Xu <b45815@freescale.com> Signed-off-by: Frank Li <Frank.Li@freescale.com> Acked-by: Huang Shijie <shijie.huang@intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi-nor/fsl-quadspi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 39763b94f67d..9d6080079a45 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -972,6 +972,22 @@ static int fsl_qspi_remove(struct platform_device *pdev)
return 0;
}
+static int fsl_qspi_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ return 0;
+}
+
+static int fsl_qspi_resume(struct platform_device *pdev)
+{
+ struct fsl_qspi *q = platform_get_drvdata(pdev);
+
+ fsl_qspi_nor_setup(q);
+ fsl_qspi_set_map_addr(q);
+ fsl_qspi_nor_setup_last(q);
+
+ return 0;
+}
+
static struct platform_driver fsl_qspi_driver = {
.driver = {
.name = "fsl-quadspi",
@@ -980,6 +996,8 @@ static struct platform_driver fsl_qspi_driver = {
},
.probe = fsl_qspi_probe,
.remove = fsl_qspi_remove,
+ .suspend = fsl_qspi_suspend,
+ .resume = fsl_qspi_resume,
};
module_platform_driver(fsl_qspi_driver);