Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3557230ybk; Tue, 19 May 2020 07:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoOgu7AjGOidlFayLCjbKNhPqmYEhO7Jwph45byNExUiDbIrP/T8kFL3dtP9Qsij34ZqHh X-Received: by 2002:a50:9d46:: with SMTP id j6mr8512123edk.362.1589898804910; Tue, 19 May 2020 07:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589898804; cv=none; d=google.com; s=arc-20160816; b=tde5tLXwnhGQyjz5BhNSLuQuHZlWSur3FnTlaGZHAJ63B+Qm7nudwJFKx8QdIEMVIq gV7NU+0vxTlMHFwoAf0ho12Oqx1Az9NE9vIvAosdtOUcp+vH+eey6WoXB5ifsvtBgE5r zeQhlYgC+pgdR2jszhUvpp/gBDej7rAFnFfRTSpdgWGR4ffwVTkEZEHn84Isso/tVMtn rTXdZPaGf11vSdKIksIbxXLTMqi9hvimGt6I3oEpqWo2LigUmrsSUkCta6HGrbBcmGwL VjOpCfEjLCKlpO7VnrXx57LLbWcXkgNSrqCowT+/PTxjMdDT4DELisCw4XWDdqolC3sr cXEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=70FeLQTtJkyVxVIkf8YVfc8xOxYWAvnHPgHRRqee0UU=; b=qWNB6s3DfpgoSDEw3AhR0GJcjNUZOT1fDHjSmHKz7SWt+pODslk3dJPcDaB+cQ82u2 1VCnU9aL54VD3BNkwvei/s4M/HWVMjUFrL4Q8WpE7681SqMQeDphWGebfrFoW7zd7GRx SyPdTAvFE08y90yi4oew1jrrdAwruGO0DLbkDgSu/jiU/5PyRiQH9q5emWtqg1V1bTwz bZOLs9Xt51IUGjiKefSIqp8VJPQQ696M30JCqynkS2rSYiAguwNYx2Y26Idm2+iEi0g8 QGjlK3OeKI6EwhH7vuOz0MhEH8if7ymwV9rgJFd4sxLn2z8VwaZKRPORH+rBvwVjRkCU rumQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jmB5xyhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si5675100edl.184.2020.05.19.07.32.59; Tue, 19 May 2020 07:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jmB5xyhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729295AbgESO2W (ORCPT + 99 others); Tue, 19 May 2020 10:28:22 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:43666 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729057AbgESO2U (ORCPT ); Tue, 19 May 2020 10:28:20 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04JES852005391; Tue, 19 May 2020 09:28:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589898488; bh=70FeLQTtJkyVxVIkf8YVfc8xOxYWAvnHPgHRRqee0UU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jmB5xyhOOK+ovbliuLlg19+s6/dkkq+DnPTORUzo2HDGwo+2VorZInvi1B4F0hIjS ZGm71XOQJuP3nRcmaF2UwbbN+RA/BG4PO/3YVL9zkB529qEwe8W2ipaN9yEh7cUlER HQ/nPATbj5oiuo51XbVUw9/J1oK+gPIajZLxMJmk= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04JES8cK083364 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 May 2020 09:28:08 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 19 May 2020 09:28:08 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 19 May 2020 09:28:08 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04JEQgjY008313; Tue, 19 May 2020 09:28:03 -0500 From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Matthias Brugger , , , , , CC: Pratyush Yadav , Sekhar Nori , Boris Brezillon , Mason Yang Subject: [PATCH v5 16/19] mtd: spi-nor: core: disable Octal DTR mode on suspend. Date: Tue, 19 May 2020 19:56:38 +0530 Message-ID: <20200519142642.24131-17-p.yadav@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200519142642.24131-1-p.yadav@ti.com> References: <20200519142642.24131-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On resume, the init procedure will be run that will re-enable it. Signed-off-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 68559386f6f8..63ab588299f4 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3239,6 +3239,23 @@ 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); + struct device *dev = nor->dev; + int ret; + + /* Disable octal DTR mode if we enabled it. */ + ret = spi_nor_octal_dtr_enable(nor, false); + if (ret) { + dev_err(dev, "suspend() failed\n"); + return ret; + } + + return 0; +} + /* mtd resume handler */ static void spi_nor_resume(struct mtd_info *mtd) { @@ -3432,6 +3449,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.26.2