From patchwork Wed Nov 23 18:01:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 13054104 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 169FBC433FE for ; Wed, 23 Nov 2022 18:31:18 +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=+lDB2wilO6SGRKwtcfX9jOgctDBmZ9nGpYRigOkeWF8=; b=V/DZbPX3Y2iJ80 q2DWUH4QDT7h65vgDuoUQyV87n1oOQugP0vy5qbsvHMYh2zgl5Z0L6yhAe3LupPGj/qsIJf+7eP2k ZEM8BBwmgOIRYQ/pZfv/2bq55WwLmA7OEpVVgzI5C8fKnuvQWlJlDvQM2ueYB9f4jELWfaK+preD+ 5hQujCvqGzEJne6zu5KT+Pif25noBjIgSFtybFs036FYuV/DVBPYSs2LTX0Wfa/ElhQFUgNwEcpEJ J3mD9Amxy4oDQ1abp9jpTBeFtA+jwD7N4T56FnkdyzELje/Iu2t/gY4yQuvmHTTny73DQXKYGQBlA 1ajazLZng8C/4fJ73pfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxuVW-001csv-R0; Wed, 23 Nov 2022 18:30:03 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxuS7-001b24-P6 for linux-arm-kernel@bombadil.infradead.org; Wed, 23 Nov 2022 18:26:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=GlKtoulrQImwZ0J+jmUcVt5fZ5o3JIoWsQTVPvtUMg0=; b=ElzK/Ks5dTvMheg89DAGPEoJ5k cHZnC/4JhaXZMoWhdMHBglm05SffcRLA2k+Kz/3NOPfY27U7u5MScJYK4S1ZCSeLwgWnaWhrKog4I NliP3WtHLZftWs862uDK5SEEueEV6rk/G+DC3jS/6GE1NBlkq4dIIApdDf9DzDJ9fLXIiOc+NzFOz qDZKBKX5zUkIxjFujUMtTYYRieuuDuRNgEGUXsp246TbrzxDCm0lRpZc1KPZThxdQY+QEeFcRDvzW 1aiLVkHTd1s2bAkFbHEU5fsSpwX3oqQy5ARJLkK26oj5i3n/uUX46OVSW45m3FytNJu0caedJLNz5 c19KpqAg==; Received: from 0001.3ffe.de ([2a01:4f8:c0c:9d57::1] helo=mail.3ffe.de) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxu4s-003sQ5-Ac for linux-arm-kernel@lists.infradead.org; Wed, 23 Nov 2022 18:02:32 +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 B41AF3B1C; Wed, 23 Nov 2022 19:02:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1669226541; 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=GlKtoulrQImwZ0J+jmUcVt5fZ5o3JIoWsQTVPvtUMg0=; b=zl7B4JwpgH+/znHNfGRB+U6ZMhMZywwF7gL+2fNTVCyqzw2iTKu7eWrbOa5taU0KQgXM3C FQmd4G+Jb46q9XYoBtZtXZjgZhbtKAh/o1Xm5yajU9TEcUs8yQXhd/hEhycCDXYf1tk8cq ePC3DBiIcsjN8QufETNg8AJAUGA1AXFmtRzMFbBYsoHRqHG6k+L4/yTVv65ogK3fv7/Xwf VYsMVmVgHOOfP4MKFR1i/KYUF/m3JHkMr4xmzt0BiidlmNKNU59XTXlGUUfZZXb3pi4+ey LlKYARQaqNXZVhTZUVdFBykWQgMDU0BrpL9PjOdLIvUL0inP1dMCdMvmWPV7cQ== 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 Subject: [PATCH v4 07/20] nvmem: core: move struct nvmem_cell_info to nvmem-provider.h Date: Wed, 23 Nov 2022 19:01:38 +0100 Message-Id: <20221123180151.2160033-8-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221123180151.2160033-1-michael@walle.cc> References: <20221123180151.2160033-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-20221123_180230_491060_31BB26F6 X-CRM114-Status: GOOD ( 14.25 ) 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 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 *