summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAllen Xu <b45815@freescale.com>2014-05-08 14:56:42 -0500
committerb45815 <b45815@WORLDCUP2014.(none)>2014-06-23 10:16:48 -0500
commit8c99f4a76eae6314fe5b5a732b79f053ad70344c (patch)
treedd51da545532c91d32b1869f9b0aa8aecfde6731 /drivers/mtd
parent7fe758a1306dcf7f88d342607671a7e19869d9b7 (diff)
ENGR00319582 iMX6SX: qspi code change to support DSM
add suspend/resume functions and reset qspi controller when resume. Signed-off-by: Allen Xu <b45815@freescale.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 091b2ed99f86..02051622ef74 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -1110,6 +1110,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",
@@ -1119,6 +1135,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);