Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1253090rwe; Thu, 1 Sep 2022 15:23:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bjdxu0uzBBBFtXkzgZUT1yPFpfT5w3m3JmviXCQ12FHogMfV1/1wRxlBEvP3HUCIw/tVK X-Received: by 2002:a05:6402:4511:b0:43b:a182:8a0a with SMTP id ez17-20020a056402451100b0043ba1828a0amr30633639edb.410.1662071001972; Thu, 01 Sep 2022 15:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662071001; cv=none; d=google.com; s=arc-20160816; b=f/VukkXaZ/Bzn5Ra2BWDJHkvMf7a0n0Wy9cV3b9FPg1NJChgBhLabe5jS+uqES9UEU uiDnrQofN72t5JbTv09iCXOpI77LHeQkAL5fYsQuWVoUr4KF9qOXReN221ZGnUoRKrB9 Myk7whmiJWQqSDabGXc/zipQpw/nxbW3I7KrOj0RZ6UC0gAjaG0SFGPZzrXScQi9357S 07Di0ILUG2X1Aj9zJiPP4WE5qzIJApGTUldO3dPz+X8hoXHGt0iHaIodDavr/+bAb2IR cUbDpyOx2f8P1n3F2TY7f7yMrqzO1TNhNCzMp+akpEgGTH4d8tPNPnjJ87EcgyIsiwp+ RbqA== 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=jgDOWLqHqJzz1nUsUJVPJH/GeDuSfhFT531Ll207Vjc=; b=RFALp4yxAu5MJLRZRGWDp2g6RReSpHuHIf1cbvGjGXwEgZ3HQKFJOJtRWgPCb5+vZS bjpIgr+pvRKwuKDBkS+Ba1TDIJa9eaFZKtRS6tnZT/rFvviqvBbKcXzcBDmhpORZReLg a940GB9hmvsUcalMoSqOud4+mUcq7LTK8wumb48Hese8QK+BzhmtKsHUZOfva29LZnNr kYrGoktUTjVAoELNKaBSjKYSliemto0d5oAFXdvDHK/xBFxZ/CXXaUo06hdORT3Ge6d1 QPYdss3rg2opDFq9jp+tEmWFuWMnNiHFJa1agj6T4gp2xEai0tdYO99Mz8cZKOas/giV m2bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=YlTsLPYH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056402351400b004485cce26d6si307917edd.190.2022.09.01.15.22.56; Thu, 01 Sep 2022 15:23:21 -0700 (PDT) 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=YlTsLPYH; 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 S234772AbiIAWVg (ORCPT + 99 others); Thu, 1 Sep 2022 18:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235034AbiIAWUp (ORCPT ); Thu, 1 Sep 2022 18:20:45 -0400 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 976C8A1A7D; Thu, 1 Sep 2022 15:19:12 -0700 (PDT) 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 F109321AC; Fri, 2 Sep 2022 00:19:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1662070750; 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=jgDOWLqHqJzz1nUsUJVPJH/GeDuSfhFT531Ll207Vjc=; b=YlTsLPYHXzE41fxjgLTvg8ha8vBrNGgdjudoQW76wZh2BkH8IWsXv1ZDGa/OYwMvNODZeo Dcd11In1QBgFWOzVOsuO42ma6Uhpsat534Ipupk+1YLKjRjncN2kU5AS5goRBYtBa/LYPP S2KwrZ4EFmF4WQszSBgyNUAaqmkH/xz+raelh7iuXhP4wIfDfx4p58RMgbcf76zH4OS5+y NMxNB4gdcx5Gug6L73hIcLb6eD4Sy510kmuBB0BHArRLSMnDiGQSmNXsqQkiG1tTQ75g3V 6YxSqOdw1ZNdqbOGdm/XQd9NUSiYqSj10wlx6d9mUqvXRwoozXikhX93Fxxr6A== From: Michael Walle To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Shawn Guo , Li Yang , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Frank Rowand Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ahmad Fatoum , Philipp Zabel , Michael Walle Subject: [PATCH v2 04/20] nvmem: core: move struct nvmem_cell_info to nvmem-provider.h Date: Fri, 2 Sep 2022 00:18:41 +0200 Message-Id: <20220901221857.2600340-5-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220901221857.2600340-1-michael@walle.cc> References: <20220901221857.2600340-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 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 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 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 * -- 2.30.2