Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3822949ybt; Tue, 23 Jun 2020 11:33:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym5Y/KmhU937xC+oy707OdvUC6Q7d4BkYXgAS2gNECmaRHYL/JUISYb6DjUUN8cSsNL/st X-Received: by 2002:aa7:c450:: with SMTP id n16mr23509388edr.6.1592937237483; Tue, 23 Jun 2020 11:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592937237; cv=none; d=google.com; s=arc-20160816; b=e38DeyFx7qqKjppjkj8WnP3jg2A4B+pf3mWtA+KAE73AN1s+TrAVqsIqIbkIM6n0z0 vjqHJhzvLOgXxVkFpsA8IM+4gfZROrWE85DRieTyAcFV2tsBTW6wkZ2cp6A0+6QtkFN/ 6fyE68rezJGHbNl9wVrcns8i/Eq9iO6nqixUOPc+jbwc2l2oaDncf5Co2H/qo+2mJR/o 2OajMiLy0e8yfqovSMJDXWpdZRj4GrsTvxqgThIyAoxsCdmWNn8Ejebid38tImoqOHK9 uxQr6dy0m8oeg9i0sfOhWizQCPwLkRtGvQTxQh28ZUzw3kHdyC3T0popwdQSBJ18LIb6 OjdQ== 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=9a5FEjuyRl6f2sP4FwKkYMtIIcrxgkw6eAbSpOG2tMI=; b=fCDA1P9XPlr9EmZOOZjgyAWQsP9Qq5fyzhGpO+iDEDfRl358QxO1zIX5sFCbbf6S2q mszUR+o7vp369dnpsEXQpYM74hdLID7X5IuiVsyM0Ldy1n6Or4vbVlxiLtTVebaPg4cb UBfvNyNz4E/yUiJvhtmzSobQAJcWnR7WGlRBWmXQ3lah3XjSySU3dpsXig80zD674VW9 klUGfzRKpkFN/lUPTPYdsqjOtQm09fSmQjZfZTes2HdYp4ShNwqK21t+V+oDEG4ge82N ioINMvd42+J06bFj2reQU4XCXuMHm71ElZI+rlCKiBoiGxUhI6Uu/Em9qeP/GalDibO5 IQ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="capr/+SO"; 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 cy20si1403355edb.344.2020.06.23.11.33.33; Tue, 23 Jun 2020 11:33:57 -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="capr/+SO"; 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 S2387688AbgFWScC (ORCPT + 99 others); Tue, 23 Jun 2020 14:32:02 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54690 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387678AbgFWScB (ORCPT ); Tue, 23 Jun 2020 14:32:01 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05NIVqXg015544; Tue, 23 Jun 2020 13:31:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592937112; bh=9a5FEjuyRl6f2sP4FwKkYMtIIcrxgkw6eAbSpOG2tMI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=capr/+SOwq3f5WEgk2tgfSxroBJnam6gvYGi60BOsdBshuJxnXVb2JEGWM7Znrzg+ pYPY103Mdewgp3H9mLhvBiXf4bHUg3Rnf7QTuMc16b3d9YiI3NFrLwxJry3TDHzwYE fBsG6JN7WGPuZ9wsOla2pBvEAZOWhXP/9B+6d9Uw= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05NIVq4c040341 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jun 2020 13:31:52 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE102.ent.ti.com (10.64.6.23) 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:52 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) 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:52 -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 05NIUVJT000942; Tue, 23 Jun 2020 13:31:47 -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 15/17] mtd: spi-nor: core: expose spi_nor_default_setup() in core.h Date: Wed, 24 Jun 2020 00:00:28 +0530 Message-ID: <20200623183030.26591-16-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 Flashes might want to add a custom setup hook to configure the flash in the proper mode for operation. But after that, they would still want to run the default setup hook because it selects the read, program, and erase operations. Since there is little point in repeating all that code, expose the spi_nor_default_setup() in core.h to manufacturer-specific files. Signed-off-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 4 ++-- drivers/mtd/spi-nor/core.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 369d754988f0..0bc897274278 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2790,8 +2790,8 @@ static int spi_nor_select_erase(struct spi_nor *nor) return 0; } -static int spi_nor_default_setup(struct spi_nor *nor, - const struct spi_nor_hwcaps *hwcaps) +int spi_nor_default_setup(struct spi_nor *nor, + const struct spi_nor_hwcaps *hwcaps) { struct spi_nor_flash_parameter *params = nor->params; u32 ignored_mask, shared_mask; diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 79ce952c0539..d37a9b1d111f 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -452,6 +452,9 @@ int spi_nor_post_bfpt_fixups(struct spi_nor *nor, const struct sfdp_bfpt *bfpt, struct spi_nor_flash_parameter *params); +int spi_nor_default_setup(struct spi_nor *nor, + const struct spi_nor_hwcaps *hwcaps); + static struct spi_nor __maybe_unused *mtd_to_spi_nor(struct mtd_info *mtd) { return mtd->priv; -- 2.27.0