Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1768819pxb; Wed, 2 Feb 2022 12:05:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyQKG6sjvRKRlOJx7XJSp+27yqNqaFcSa88h8fYR45tIMo5fe8Z+36Tn+fr/dRpNi/XZza X-Received: by 2002:a17:907:9722:: with SMTP id jg34mr26573189ejc.466.1643832313704; Wed, 02 Feb 2022 12:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643832313; cv=none; d=google.com; s=arc-20160816; b=WAofLlAM2Tg33vNiLXqrffWKgcxvOveMeYCCc0zftztbP1650Me+ZmXerSrPBVShvv 1wVPb53nlpD4q7LSKEenIG7RgxYs6UKKGzmHeROHD6BW3QzXLwMTThQKe6aHM1fxyWDl Fzgucb04Ostqk3WuTLwFbJYeB3Do/Hab1xblRp+oRzRC3eFr/+3QFG0pfsFjoaNfoCha Z9DpbOvgHySpAvgHf22y+4jVIOizPureinT1cCo/m04t7Ma+0Bn8XFdTVMonOg6+xvPT 67vPjFZw/Za7xaapIpCFbEkmvsCcB+r6e2K7QDxnKO0Py8aR2KQaOvmjU39nuageC5Ro Lz4w== 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=EUIHOXBwQHm3/QA8WoOrA7Z1KLYfmRbk62KHpOzNBV4=; b=QLCPkNsSyvqGoDbIDY/fKqImCSCShOe6fOgt1M5netJ4m7ZafE6Ab516R79Mmb1FB0 4py6gcVyLslCC+D83sziOx0VSy1b7Xfewg/j0roE0XrDK4ylrgQPvp6UmCKNdq1TbvZ2 /voN0dqOqcdHFnQPwNk4stEzo3YNWpUtM9w/P2qeUqYqLCUuiXi7BO/ELTRSIWTiKhvG lpD/mxfPiIRF+SruZ7F+Z6/CG4afiJZ0Zf0AWt22Ms91ZoJ8ltss/slJ/YyIZILvrsC2 D7vTXjhCCFjxi3KvuNjTHRRLqNwOgvPUugfT0nbxMtBKnCI2iyy0a5Gca9iDnNhbn/+S 6QsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ZWhTT6sJ; 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 du8si11541579ejc.430.2022.02.02.12.04.45; Wed, 02 Feb 2022 12:05:13 -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=ZWhTT6sJ; 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 S1345262AbiBBO7D (ORCPT + 99 others); Wed, 2 Feb 2022 09:59:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231985AbiBBO7D (ORCPT ); Wed, 2 Feb 2022 09:59:03 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBA01C061714 for ; Wed, 2 Feb 2022 06:59:02 -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 E661C223EA; Wed, 2 Feb 2022 15:59:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1643813941; 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=EUIHOXBwQHm3/QA8WoOrA7Z1KLYfmRbk62KHpOzNBV4=; b=ZWhTT6sJTrJpdFgN6/yNptFuqf5m3U72tOlXp95AXYnibvAC7SoXVnDo1wZZiSobeWvTUC FopPvK1P+9nnmdULxKGQFnwHHbooXY28fL/M4r5IOTd2gJlj4g+9leWktQLaeJnVUodBOe uaBhgUn3c7CpdKWbIJ5y/R68sEVItTM= 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 , Michael Walle Subject: [PATCH v1 01/14] mtd: spi-nor: export more function to be used in vendor modules Date: Wed, 2 Feb 2022 15:58:40 +0100 Message-Id: <20220202145853.4187726-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220202145853.4187726-1-michael@walle.cc> References: <20220202145853.4187726-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 04ea180118e3..f05ece6018dc 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 2afb610853a9..c6578d3f598b 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -554,6 +554,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); @@ -599,6 +600,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