Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1293085pxb; Fri, 18 Feb 2022 04:57:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8Mw+yAAj4TaEdv6Xe7o60QKsIpl52URr8eU3Q8/w3S30ch20yXm94n10uZh2BZtYvarJM X-Received: by 2002:aa7:d2da:0:b0:410:b9f1:ff35 with SMTP id k26-20020aa7d2da000000b00410b9f1ff35mr8135811edr.217.1645189055213; Fri, 18 Feb 2022 04:57:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645189055; cv=none; d=google.com; s=arc-20160816; b=E2Kqhgc4zo4Yiqv/vHh37kT38ULxYXzxp3LzCJs3ncCK6FSrC18QVANrO/WMbWW9Mo CI6tVguYxfocMk8ZU2xhhRk81xQPey1O4T0qWMqj/E4PEFUwuB73N2Q8kEpwQ81hJJE1 de9HdQW0oFu129Dk4j7GsRPlrV8+iydyZCIyV481Yn3WUa5mHrZbScVTmuNuAmqhCiXa N37xjJKVl2880Wu5CEzmwzHHWpJVT5GhashWZ1zBIMylGwHK1EAp3Gt+WamhMVrIDB9H vxo+pb8BRUc0LfyC3i0sdb7nj9cSEDKziQie8ZD6aVgwJr7m3ISGFBw8aSZoH01L7dRN W/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BewPUYl7ALanqbEPhDcl7g1lZEpz+MjVY87ZkoEXHuI=; b=Q/6bx8R2WW+7D+z5d6fo5uyqwE9+BxxwpPYzRwiZ89o+Co3XzaDf6Tgzer5MnVky3y 3z6vdK3nS7zm+M+aU/b7zQJW+78tfHboGSEXeYreH/Kp0qu7aIZdzFMeyHvqK2nkwNqj qfT6BixyfJwdFJpSO6tS4cYDZdb+LQXD2Ijq2vA3FbZ+P1KF2Ex5lp6e76wLJBB1tp+/ hfM6nhxJ2es9J+ABxm6SBj6YQblQDcpu8VTDa8FByWJBMFrgoFdRgiwJOIknZn2qX2yT lVpHbxmbjTfhZqAXUy96hBXcKQmhIidJEdIqyFsrqMxDy09mHOaFXBtLEoxC3Wzr1226 2hEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DeSUu72N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd29si6293362ejc.75.2022.02.18.04.57.12; Fri, 18 Feb 2022 04:57:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DeSUu72N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234726AbiBRLh5 (ORCPT + 99 others); Fri, 18 Feb 2022 06:37:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234598AbiBRLgp (ORCPT ); Fri, 18 Feb 2022 06:36:45 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CDE42B1655 for ; Fri, 18 Feb 2022 03:36:24 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 719CA2247C; Fri, 18 Feb 2022 12:36:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645184180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BewPUYl7ALanqbEPhDcl7g1lZEpz+MjVY87ZkoEXHuI=; b=DeSUu72NBNCsIi5ghE+i1z9fen3B9PCpcp2o+UOFW3SZltwum8qDiVdENV0Z4FRGpQ4PlQ oPgT3LRlH9ieWEJFwmpJDZrqpKyJLpS8//vu66mNaoikE8MOqF5+fb2U7weDOjHC9mWDuy +Qt3kb7J6szvOK/tii3aD57e5PV4wDk= From: Michael Walle To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , yaliang.wang@windriver.com, Michael Walle Subject: [PATCH v2 19/32] mtd: spi-nor: export more function to be used in vendor modules Date: Fri, 18 Feb 2022 12:35:54 +0100 Message-Id: <20220218113607.1360020-20-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218113607.1360020-1-michael@walle.cc> References: <20220218113607.1360020-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will move vendor specific code into the vendor modules and thus we will have to export these functions so they can be called. Signed-off-by: Michael Walle Reviewed-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 10 +++++----- drivers/mtd/spi-nor/core.h | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 390a9ab413b7..8481272533a3 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -157,8 +157,8 @@ static int spi_nor_spimem_exec_op(struct spi_nor *nor, struct spi_mem_op *op) return spi_mem_exec_op(nor->spimem, op); } -static int spi_nor_controller_ops_read_reg(struct spi_nor *nor, u8 opcode, - u8 *buf, size_t len) +int spi_nor_controller_ops_read_reg(struct spi_nor *nor, u8 opcode, + u8 *buf, size_t len) { if (spi_nor_protocol_is_dtr(nor->reg_proto)) return -EOPNOTSUPP; @@ -166,8 +166,8 @@ static int spi_nor_controller_ops_read_reg(struct spi_nor *nor, u8 opcode, return nor->controller_ops->read_reg(nor, opcode, buf, len); } -static int spi_nor_controller_ops_write_reg(struct spi_nor *nor, u8 opcode, - const u8 *buf, size_t len) +int spi_nor_controller_ops_write_reg(struct spi_nor *nor, u8 opcode, + const u8 *buf, size_t len) { if (spi_nor_protocol_is_dtr(nor->reg_proto)) return -EOPNOTSUPP; @@ -683,7 +683,7 @@ static void spi_nor_clear_sr(struct spi_nor *nor) * * Return: 1 if ready, 0 if not ready, -errno on errors. */ -static int spi_nor_sr_ready(struct spi_nor *nor) +int spi_nor_sr_ready(struct spi_nor *nor) { int ret = spi_nor_read_sr(nor, nor->bouncebuf); diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index fdc8c0f31f5c..446218b0e017 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -558,6 +558,7 @@ int spi_nor_sr1_bit6_quad_enable(struct spi_nor *nor); int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor); int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor); int spi_nor_read_sr(struct spi_nor *nor, u8 *sr); +int spi_nor_sr_ready(struct spi_nor *nor); int spi_nor_read_cr(struct spi_nor *nor, u8 *cr); int spi_nor_write_sr(struct spi_nor *nor, const u8 *sr, size_t len); int spi_nor_write_sr_and_check(struct spi_nor *nor, u8 sr1); @@ -603,6 +604,11 @@ void spi_nor_try_unlock_all(struct spi_nor *nor); void spi_nor_set_mtd_locking_ops(struct spi_nor *nor); void spi_nor_set_mtd_otp_ops(struct spi_nor *nor); +int spi_nor_controller_ops_read_reg(struct spi_nor *nor, u8 opcode, + u8 *buf, size_t len); +int spi_nor_controller_ops_write_reg(struct spi_nor *nor, u8 opcode, + const u8 *buf, size_t len); + static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd) { return container_of(mtd, struct spi_nor, mtd); -- 2.30.2