From patchwork Tue Dec 6 20:07:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 13066250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76849C352A1 for ; Tue, 6 Dec 2022 20:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rWZw2RTBv1QOKDd2n7PqzmFeXKElrabqY8hB1r19u+o=; b=bID9kO4iASPw0L p/WNNu4wtulK1cfRBqvruwbGxQWUp3ZaJVwkCdJ7rgSSyTvf70BfT9JxqlomGjs1sqDalfITxOzrE nN1RHvCZYQJYIm2b8ZY/bPLAR2sVCB1tGrmOOsghVbPHQiJB1zatbMZxoJpP0E6Iz3QfkNEzElTD0 oqGR0kqzUhOoqfeuTyWKMWpNIyTvuahwGnYbOFd4BbNTC0ZEkHcSSmhyKP6j51TCiAH8/JlqZ60DJ hwIG1bRoP0lZke++o6jvVd/ZinJRvLrj6PT4hd3o/aCwOFthZZs9L+xcHZiK7+9QXKTG8zkIdCMdH iHOsagmyphwPqbd7CeTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2eGy-001nB7-66; Tue, 06 Dec 2022 20:10:36 +0000 Received: from 0001.3ffe.de ([159.69.201.130] helo=mail.3ffe.de) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2eEj-001k2q-KZ for linux-arm-kernel@lists.infradead.org; Tue, 06 Dec 2022 20:08:22 +0000 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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id C77293B2D; Tue, 6 Dec 2022 21:07:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1670357269; 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=PFEDTEXwsw2qqq6elYOKJxReUTOIeiJ26cX4UKFFZhU=; b=IsIO4ZeTGs/giCwkE4n+Iii9BjTI40C8PHHjOY/4aauaDAntY4B7sP8zdOeRbEyv3ZWC5y 5iZgZTeODbK055lb9RNszIdTL4gb1E4k+yPBuyaggp8Etw6eS8cOTOdDu9b2WRXQ3oxPJv k7OhiMYjec85gjmk3h0zXJhiNirIqSbebYti1qVCwrcrwqD98x30norhBJdWGVUDEWuq9B ltxVYomdCj+GS7QuKqagDxklZ6GDT/RsHhmLVOFwezSU0u0IBoQqp+4cbXhNKaGt8o/JTt Lkqn9xkk1SoYZXl39GtaTfKVdDG4kqXJh0Mvu+ANzQKA/uWHNQQKbHj0oJiVsg== From: Michael Walle To: Jonathan Corbet , Srinivas Kandagatla , Miquel Raynal , Rob Herring , Frank Rowand , Sascha Hauer Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Michael Walle , Dan Carpenter Subject: [PATCH v5 07/21] nvmem: core: move struct nvmem_cell_info to nvmem-provider.h Date: Tue, 6 Dec 2022 21:07:26 +0100 Message-Id: <20221206200740.3567551-8-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221206200740.3567551-1-michael@walle.cc> References: <20221206200740.3567551-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221206_120817_929693_A7E9DE3B X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org struct nvmem_cell_info is used to describe a cell. Thus this should really be in the nvmem-provider's header. There are two (unused) nvmem access methods which use the nvmem_cell_info to describe the cell to be accesses. One can argue, that they will create a cell before accessing, thus they are both a provider and a consumer. struct nvmem_cell_info will get used more and more by nvmem-providers, don't force them to also include the consumer header, although they are not. Signed-off-by: Michael Walle --- changes since v4: - none changes since v3: - none changes since v2: - none changes since v1: - new patch include/linux/nvmem-consumer.h | 10 +--------- include/linux/nvmem-provider.h | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index 980f9c9ac0bc..1f62f7ba71ca 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -18,15 +18,7 @@ struct device_node; /* consumer cookie */ struct nvmem_cell; struct nvmem_device; - -struct nvmem_cell_info { - const char *name; - unsigned int offset; - unsigned int bytes; - unsigned int bit_offset; - unsigned int nbits; - struct device_node *np; -}; +struct nvmem_cell_info; /** * struct nvmem_cell_lookup - cell lookup entry diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 8f964b394292..14a32a1bc249 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -14,7 +14,6 @@ #include struct nvmem_device; -struct nvmem_cell_info; typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset, void *val, size_t bytes); typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset, @@ -47,6 +46,24 @@ struct nvmem_keepout { unsigned char value; }; +/** + * struct nvmem_cell_info - NVMEM cell description + * @name: Name. + * @offset: Offset within the NVMEM device. + * @bytes: Length of the cell. + * @bit_offset: Bit offset if cell is smaller than a byte. + * @nbits: Number of bits. + * @np: Optional device_node pointer. + */ +struct nvmem_cell_info { + const char *name; + unsigned int offset; + unsigned int bytes; + unsigned int bit_offset; + unsigned int nbits; + struct device_node *np; +}; + /** * struct nvmem_config - NVMEM device configuration *