From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-bn1on0116.outbound.protection.outlook.com ([157.56.110.116] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAn8W-00018p-Q8 for linux-mtd@lists.infradead.org; Mon, 12 Jan 2015 22:07:01 +0000 From: To: , , , Subject: [PATCH 1/1 v2] mtd: spi-nor: fsl-qspi: support deep sleep mode for imx6 sx chip Date: Tue, 13 Jan 2015 04:56:40 +0800 Message-ID: <1421096200-28174-1-git-send-email-Frank.Li@freescale.com> MIME-Version: 1.0 Content-Type: text/plain Cc: Allen Xu , Frank Li List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Allen Xu 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 Signed-off-by: Frank Li --- Change from v1 to v2 - fix typo fro - remove term DSM. drivers/mtd/spi-nor/fsl-quadspi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 39763b9..9d608007 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); -- 1.9.1