From patchwork Mon May 25 09:15:42 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pratyush Yadav
X-Patchwork-Id: 214543
Return-Path:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,
INCLUDES_PATCH,
MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS,
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
by smtp.lore.kernel.org (Postfix) with ESMTP id 425ECC433DF
for ;
Mon, 25 May 2020 09:17:42 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
by mail.kernel.org (Postfix) with ESMTP id 21E772073B
for ;
Mon, 25 May 2020 09:17:42 +0000 (UTC)
Authentication-Results: mail.kernel.org;
dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com
header.b="RVVJ6Fat"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S2389522AbgEYJRl (ORCPT );
Mon, 25 May 2020 05:17:41 -0400
Received: from fllv0015.ext.ti.com ([198.47.19.141]:53232 "EHLO
fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S2389526AbgEYJRi (ORCPT
); Mon, 25 May 2020 05:17:38 -0400
Received: from lelv0266.itg.ti.com ([10.180.67.225])
by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04P9HPdf095712;
Mon, 25 May 2020 04:17:25 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
s=ti-com-17Q1; t=1590398245;
bh=GBF2MWapCKmZFTAre7roOt4HKKaEU6l6dFGpC8mxpeo=;
h=From:To:CC:Subject:Date:In-Reply-To:References;
b=RVVJ6FatmWE0eiJC+yfoE7m+iXYBzNnldrZ+nXWHXXjvXly0N8K5gWNPlw1sBlbmN
m9y3SvrWUNHnRWSid+vXjLtxPSv7+76zuVTIAh/caoRe5l44N7vzzYmueAkv3zgwM1
jmy6iB7VqOnDkn/cftOU+A96Nl9ohks/SNSQ5LBA=
Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23])
by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04P9HPrO014295
(version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
Mon, 25 May 2020 04:17:25 -0500
Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE112.ent.ti.com
(157.170.170.23) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3;
Mon, 25 May 2020 04:17:25 -0500
Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com
(157.170.170.25) 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; Mon, 25 May 2020 04:17:25 -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 04P9FjAH034800;
Mon, 25 May 2020 04:17:19 -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 ,
Mason Yang
Subject: [PATCH v9 17/19] mtd: spi-nor: core: expose spi_nor_default_setup()
in core.h
Date: Mon, 25 May 2020 14:45:42 +0530
Message-ID: <20200525091544.17270-18-p.yadav@ti.com>
X-Mailer: git-send-email 2.25.0
In-Reply-To: <20200525091544.17270-1-p.yadav@ti.com>
References: <20200525091544.17270-1-p.yadav@ti.com>
MIME-Version: 1.0
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180
Sender: linux-spi-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-spi@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 63ab588299f4..30d9149fd17b 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;