Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3822885ybt; Tue, 23 Jun 2020 11:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk5gTcLnI6Umzx/DZFi3iFqkZD0NmpeQkrVRTMKH3Ht8Lnuksuk3IdUKsdBplR0W7x+hGd X-Received: by 2002:aa7:c403:: with SMTP id j3mr23428669edq.294.1592937229868; Tue, 23 Jun 2020 11:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592937229; cv=none; d=google.com; s=arc-20160816; b=DX6xRwGvCacisWr8SveUyiPdZAbuOpdzSXe5XUP5OF0iG514yjHffey5YreoA4AVSX OtHv37XBuo13Qll/Yn+BTk/N9VnwfYRqIq3wvNLWBsVVa7DdNwb8gszHE1TVcPVZjtej ZnYrG1bGp1Xhif2ENN2rXGDQQbxIiuz1eDeICDQBfIBhd96uhyE2r5V3+E0+TYoNwQ9K tpcxrEsMCpLjWY5AJT/ffwEowHprCJ+Ko1c26UxMg2mNBnWp/BO/MVButpG+gzbBhG+o WPjw2DsvhP966QR3YrYFGdhOz9Bkt60+PYDjHvh31UahUEFPj4BEUjtp3c4Es7CljKcg xpJQ== 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=AwUgqPJTAs+lgXrKPWqUFSnfe1vMo44ULoEq8QGuMCc=; b=URwlE7ILuMLbB82s9wupDtWtvMOSteIOMcJ0Yf2Wa2dILihlkiOBejyO6E4JHA3/kI Ojr/djDsLKykEhwBzwy80LvRN3L9C4KFI32X1r9roDoIk0d9IL1f4kStCXVu1xrnDUAR CCa000dgHjSVdYebPb0QU+m7w+QKA72sXc7muNeurwjbXKRPAI3q+8Z3XWvsdcDCxQiK 8v3/+x5iavTV4gP18I4JQI3waCTLFQxLRbDbDqBYc1mdg5I4dxoGUMM1UtMJEZX+fWLh Q/x0qveYofkMl3QfSwLTvLtUTtlvqDzbUges058sNQ9i1F1Exlhp64rHvec4sJIEZVZG 6sYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cken3QH3; 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 dg18si11652921edb.211.2020.06.23.11.33.26; Tue, 23 Jun 2020 11:33:49 -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=cken3QH3; 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 S2387656AbgFWSb7 (ORCPT + 99 others); Tue, 23 Jun 2020 14:31:59 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:58488 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387676AbgFWSb6 (ORCPT ); Tue, 23 Jun 2020 14:31:58 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05NIVl8R085802; Tue, 23 Jun 2020 13:31:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592937107; bh=AwUgqPJTAs+lgXrKPWqUFSnfe1vMo44ULoEq8QGuMCc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cken3QH39jOCdwrsZCBLQJYMhxBEZx3SVdecq45EyP2Ak5UEOB2rba+nlsjdShCS5 Z2+H408PWWUayFDKR13nnA9/+xTgTbGJ+qkafHJtnqXqRpSuCyRpUY9Rcsa4WREkfL lHVnG0F5nw8OnJHIb9GNkcDJeSety5TCe9dTK8ms= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05NIVlIT040247 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jun 2020 13:31:47 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 23 Jun 2020 13:31:47 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE100.ent.ti.com (157.170.170.30) 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, 23 Jun 2020 13:31:47 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05NIUVJS000942; Tue, 23 Jun 2020 13:31:42 -0500 From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Matthias Brugger , Michal Simek , , , , , CC: Pratyush Yadav , Sekhar Nori , Boris Brezillon Subject: [PATCH v10 14/17] mtd: spi-nor: core: disable Octal DTR mode on suspend. Date: Wed, 24 Jun 2020 00:00:27 +0530 Message-ID: <20200623183030.26591-15-p.yadav@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200623183030.26591-1-p.yadav@ti.com> References: <20200623183030.26591-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 27ad9bab06dc..369d754988f0 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.27.0