lkml.org 
[lkml]   [2020]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH v14 13/15] mtd: spi-nor: core: disable Octal DTR mode on suspend.
Date
On 9/30/20 9:57 PM, Pratyush Yadav wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On resume, the init procedure will be run that will re-enable it.
>
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
> drivers/mtd/spi-nor/core.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 9de811b33125..17b6f833e920 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -3217,6 +3217,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)
> {
> @@ -3420,6 +3434,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) {
> --
> 2.28.0
>

\
 
 \ /
  Last update: 2020-10-01 10:27    [W:0.144 / U:29.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site