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: 25117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2942283wrr; Wed, 23 Nov 2022 10:05:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wioEznHG5B4o+PPaWeLMrU9ge9zFx138MXSWI0QGowCGhehE7i5MMZe1KZc5u9fL2FMpy X-Received: by 2002:a17:906:f207:b0:7ab:777:a7d7 with SMTP id gt7-20020a170906f20700b007ab0777a7d7mr8531630ejb.757.1669226735379; Wed, 23 Nov 2022 10:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669226735; cv=none; d=google.com; s=arc-20160816; b=0RsidP5nfwb+SJEabwc8lRkXSgehAc6TZ1CXmdWX7MjsfBpgWD0Wr/OmJbNTsqX3aA DiLwLXuP2dKvEsMXeLKcqyFfUcVnp0/xPbwsg0u3UtyGEDOAHK8dMAid5BrcKq3anpVm mGOmDcFC85QxaLxNoxhWOq9xZT4rlzA8m0X5glOtmzJXOL9D4t60iszoWYH3dzb1iFC7 dyZpJd6CsD3jK7fTDYzB/XcuByY5YI8+l6D5PVcNWafBqrhWQ7gJ8a+4vCFQwW2i7XbD TLbL/NOB2d/2uQUcFEnBCDkok5H9+wblCyHSAavrlpRxiWeGt6gVOoqzVKxagD0G9n9A FiKg== 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=GlKtoulrQImwZ0J+jmUcVt5fZ5o3JIoWsQTVPvtUMg0=; b=gWRitokfU1mbtlfif9g3U5ZJh3cd7eEUhOeZ8w5lQ0v6Lj+En3kNwW8X3en9hAhkGl I5HKdQF/hRXu/5+tdjW6aIvBv5/uvo8pOesWApWVJBuX6PYixuw5q33DsRWMUV8ruZw1 8emuN4khRxdTj3PB+k69NzXERebqeXIUXXC69qRYhisc4cnMbRZiz6uAYE3dPrdYV6m3 HdPRVHYtvKO64z6EoLUewmOqUJjH+mGjew4ePAJ66fsnbQY46dxeIcU5sdgvWxKwtVeN eGjwV4O5a8XboppviGUKLzoH2hr3GsOHypowK4zaN8tv3l5AkIZ9R2JQvugH8Qq4Sy0K 9n/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=zl7B4Jwp; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds21-20020a170907725500b007adfc1509afsi207950ejc.34.2022.11.23.10.05.01; Wed, 23 Nov 2022 10:05: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=mail2022082101 header.b=zl7B4Jwp; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239374AbiKWSEJ (ORCPT + 99 others); Wed, 23 Nov 2022 13:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239253AbiKWSCZ (ORCPT ); Wed, 23 Nov 2022 13:02:25 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B28D160F9; Wed, 23 Nov 2022 10:02:23 -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 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750311093497119446?= X-GMAIL-MSGID: =?utf-8?q?1750311093497119446?= 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 *