diff options
author | Pratyush Yadav <p.yadav@ti.com> | 2020-10-05 17:31:36 +0200 |
---|---|---|
committer | Vignesh Raghavendra <vigneshr@ti.com> | 2020-11-09 07:26:17 +0100 |
commit | 1b65c43f7078eb6e4c2c0231c543a88c272bcb0c (patch) | |
tree | c4db9b24831666f71146c48b54e6a42a89575235 /drivers/mtd/spi-nor | |
parent | mtd: spi-nor: core: perform a Soft Reset on shutdown (diff) | |
download | linux-1b65c43f7078eb6e4c2c0231c543a88c272bcb0c.tar.xz linux-1b65c43f7078eb6e4c2c0231c543a88c272bcb0c.zip |
mtd: spi-nor: core: disable Octal DTR mode on suspend.
On resume, the init procedure will be run that will re-enable it.
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20201005153138.6437-14-p.yadav@ti.com
Diffstat (limited to 'drivers/mtd/spi-nor')
-rw-r--r-- | drivers/mtd/spi-nor/core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 633a1af8a0fe..5bee7c8da4dc 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3216,6 +3216,20 @@ static void spi_nor_soft_reset(struct spi_nor *nor) usleep_range(SPI_NOR_SRST_SLEEP_MIN, SPI_NOR_SRST_SLEEP_MAX); } +/* mtd suspend handler */ +static int spi_nor_suspend(struct mtd_info *mtd) +{ + struct spi_nor *nor = mtd_to_spi_nor(mtd); + int ret; + + /* Disable octal DTR mode if we enabled it. */ + ret = spi_nor_octal_dtr_enable(nor, false); + if (ret) + dev_err(nor->dev, "suspend() failed\n"); + + return ret; +} + /* mtd resume handler */ static void spi_nor_resume(struct mtd_info *mtd) { @@ -3421,6 +3435,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, mtd->size = nor->params->size; mtd->_erase = spi_nor_erase; mtd->_read = spi_nor_read; + mtd->_suspend = spi_nor_suspend; mtd->_resume = spi_nor_resume; if (nor->params->locking_ops) { |