Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4294856pxb; Mon, 27 Sep 2021 13:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlkx/IZh+alSJFZeBcfE8l7EVbOaGhUvu5irujin3Kh95hOyr0z0hW26Ca4IaH59Zk2yCT X-Received: by 2002:a17:906:c7d0:: with SMTP id dc16mr2447443ejb.555.1632775605750; Mon, 27 Sep 2021 13:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632775605; cv=none; d=google.com; s=arc-20160816; b=zI4onKxjOmmA/FcnTvng6AG1G0je/tw7eLNDonZf29lFGNYKFvFSq2ubjEUgS7HCV5 wBTEwCeuCAKNvcqFKw23asp/pZX5RPSM96aOOw4eSwuJJZUL74SUxmjgfapyreIt9pvE U/nju4bwQfk1PicylaigMdlJJVlef3isJ/O6IOwLIn9pf6eCPWbCh4qJ9o7WbinTvddT FufjzyHu5w/nBT9cbn1AVx1riY/ONftl4lkTclJe0FtGOuqRDy/tL8nqVMzbqGH0O5vh aIFpV3M/jEw74AZhQU6keBXQwd998sK7wmqMG/7kLhS2WMoMskMpw1MSvEy/Dp1G6bM6 ZA6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hji7akcvuO5eM1UUp+RrEAX7mi3AxOo6kOuq/SkIGuQ=; b=VggQS/g+4/t/9eg45ioOspc+Jl+9v6SQ+SyV6NZuiI0ZZEeSbDeCCGf3p69JX1atiN OKqXw6iIp+TlnEXju1txe2B22/4Sgv8G21hmSBKeHMVO/dXqu7P9wjKJ/iXoTnCwav1z JeVXDyNrPAx+/4/KZ7rH5zXaBDqPrIc/XHK87AFGMYFgj1zuAE6wY5EeON/tEzRhssMm Pga2jGbwGGtdmktQ1SHZJVkx/U2+UlThzN7+RPl4k1+K7Bs+zrQGOTT6ZixqylkWU/ex 6cScV9Lawl77kf2a1EWwRdInu/NX/Uu894SzVvQtek/m/m/vuR4ewk1eiWRZYGOR8fUk U+vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si23836525ejo.68.2021.09.27.13.46.22; Mon, 27 Sep 2021 13:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236743AbhI0UoB (ORCPT + 99 others); Mon, 27 Sep 2021 16:44:01 -0400 Received: from mail-ot1-f45.google.com ([209.85.210.45]:40563 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236470AbhI0UoA (ORCPT ); Mon, 27 Sep 2021 16:44:00 -0400 Received: by mail-ot1-f45.google.com with SMTP id l16-20020a9d6a90000000b0053b71f7dc83so26137547otq.7; Mon, 27 Sep 2021 13:42:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hji7akcvuO5eM1UUp+RrEAX7mi3AxOo6kOuq/SkIGuQ=; b=JeMnYMrTpBs6XYBGKqJr6ekop8eFGrOI7Skiwns8HDlyhA3YOuASc731tGlAdkSpB4 YeODoTFImf2R2ogeTygv2t6B3TG2aKoZmBpnwcSNaxpUgJ2tEEEQfcRFKLRpLN8yUBiI 4/uBQL9QHS0LboManTjFZyLRjxjsi+NAJbxJIKuFcxSE/mxRR6RqGf7XP+3ZTL5PrwLy 2BUMQvIztSa/GoLxF1HQrz47zLvJ4kto+wos0/GXKSFJDN/hIaU8G/ACdC62yQm+kBlu xUMO4DvW0kwQlmpHEHLOiV5zEvuoSrkj8otq00Ka7bPeyzWOOiGr+3Fy/AUtev0zurO4 OWNw== X-Gm-Message-State: AOAM531hs5xhFSpzps/zBtHplkIK8wdNgyPj8wAjfIOVmXci7H8NSoS2 tHMooo+DCC6xhrQSbUaTq8X9+CJbUw== X-Received: by 2002:a9d:6a85:: with SMTP id l5mr1841811otq.122.1632775341311; Mon, 27 Sep 2021 13:42:21 -0700 (PDT) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id i23sm4079356oof.4.2021.09.27.13.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 13:42:20 -0700 (PDT) Received: (nullmailer pid 3842138 invoked by uid 1000); Mon, 27 Sep 2021 20:42:19 -0000 Date: Mon, 27 Sep 2021 15:42:19 -0500 From: Rob Herring To: Joakim Zhang Cc: srinivas.kandagatla@linaro.org, shawnguo@kernel.org, a.fatoum@pengutronix.de, kernel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: Re: [PATCH V2 1/6] dt-bindings: nvmem: add cell-type to nvmem cells Message-ID: References: <20210923110109.29785-1-qiangqing.zhang@nxp.com> <20210923110109.29785-2-qiangqing.zhang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210923110109.29785-2-qiangqing.zhang@nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23, 2021 at 07:01:04PM +0800, Joakim Zhang wrote: > From: Srinivas Kandagatla > > Some of the nvmem providers encode data for certain type of nvmem cell, > example mac-address is stored in ascii or with delimiter or in reverse order. > > This is much specific to vendor, so having a cell-type would allow nvmem > provider drivers to post-process this before using it. > > Signed-off-by: Srinivas Kandagatla > Signed-off-by: Joakim Zhang > --- > Documentation/devicetree/bindings/nvmem/nvmem.yaml | 11 +++++++++++ > include/dt-bindings/nvmem/nvmem.h | 8 ++++++++ > 2 files changed, 19 insertions(+) > create mode 100644 include/dt-bindings/nvmem/nvmem.h > > diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml > index b8dc3d2b6e92..8cf6c7e72b0a 100644 > --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml > +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml > @@ -60,6 +60,11 @@ patternProperties: > - minimum: 1 > description: > Size in bit within the address range specified by reg. > + cell-type: > + $ref: /schemas/types.yaml#/definitions/uint32 > + maxItems: 1 > + description: > + Type of nvmem, Use defines in dt-bindings/nvmem/nvmem.h. I don't think magic numbers are the right approach here. Actually, I don't think we need any DT additions. Why not just have the consumer side just tell the nvmem provider what the data is and to translate it. The consumer side already has a name (e.g. mac-address) which defines what the data is and I think is pretty standard. If that name is standard, then you could pass it to the nvmem core. If not, define some kernel internal types to use. Rob