From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EEC8C433EF for ; Tue, 28 Sep 2021 13:16:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F0C61139 for ; Tue, 28 Sep 2021 13:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240895AbhI1NSS (ORCPT ); Tue, 28 Sep 2021 09:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240882AbhI1NSO (ORCPT ); Tue, 28 Sep 2021 09:18:14 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC6CBC061604 for ; Tue, 28 Sep 2021 06:16:34 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id g16so58007916wrb.3 for ; Tue, 28 Sep 2021 06:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mTy8p1FX9+52bZQjKRfzWopRlURae3gGJlw1jmoFHv8=; b=XW5F8YTXIshTrJRRmHPKLAH1WY0udi50bVo8C+w9H//C81wqcNN4N7h3wA0XA+wv4n svvOOjboDWloSRedXg/h5ngPkkK3rtVv/BJAXTIMU1YGKt9MAsvw1E9lZy3cZCK7yb9s F90Kr0X36aWSieu6mUPT8estmLI5B4uukt2itKtCqutBXErDapQw8aIe4zfuzs7M+I19 gIV10j9MVsJMEmrM17qXlBEjhTjEK2XgA359bZCmKCG1cbDOBv6MeAzphzQvP/l850xX 7ZvXYL2pfrObqddGk2Bn5O2vxdOcADlhSIjNJLUmaN4v7jF8BAotyUYWBoXLa/gOogqr UEWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mTy8p1FX9+52bZQjKRfzWopRlURae3gGJlw1jmoFHv8=; b=6yBYQtxfdFbPLWqOV2bH4rh3qX1NBfX6zOivDrcPvOPcOdmXu+e6VKK1Z1ujhhuVyh TvVW1aYwbd9xbN0EBgDy/Fz/27nXCoGM4Bau+JFi5hHZSzzUdHwQQKzvWET9vBbH3sGx Y9GeQ6JhVmM2wFSgIIjoYeaiY5BcF3Lwu2oxByvSKJEkxLFuxVPNtoC2NTGKmdFSDhbQ SiYIF98B2FJyo8glPXGeQhavjAPyBpN+KYWQivxWQ68zq86kaltoe+HtlBfbrtU1QfB4 Esfxm78fpXXnXxcmhy5W2K45uEOuxJ0AxPn8kP7FQNAVqqt9zR/RX1UVf5PNmpjwam7F +CxA== X-Gm-Message-State: AOAM532z/K5VxGYRaw+KBnSLEajnRMSjRCBYrRuXbW6TT3hTHfncZ26C p40AIk8m1omdSpUbOGQK83TofQ== X-Google-Smtp-Source: ABdhPJyXR9JiZ5AHF8bdJC7ezb76OdWc45UKcupfrQGAIiBT/OiPOP6QDIynGQXNx1a3yrE69MQmIQ== X-Received: by 2002:a05:6000:1865:: with SMTP id d5mr6698460wri.248.1632834993434; Tue, 28 Sep 2021 06:16:33 -0700 (PDT) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id g12sm3171123wmh.36.2021.09.28.06.16.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Sep 2021 06:16:32 -0700 (PDT) Subject: Re: [PATCH V2 1/6] dt-bindings: nvmem: add cell-type to nvmem cells To: Rob Herring , Joakim Zhang Cc: shawnguo@kernel.org, a.fatoum@pengutronix.de, kernel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com References: <20210923110109.29785-1-qiangqing.zhang@nxp.com> <20210923110109.29785-2-qiangqing.zhang@nxp.com> From: Srinivas Kandagatla Message-ID: <110991f8-13e8-665e-0cc7-c102b55cda0e@linaro.org> Date: Tue, 28 Sep 2021 14:16:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 27/09/2021 21:42, Rob Herring wrote: > 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. Thanks Rob for the inputs, There are potentially two sources for this information. 1> nvmem cell node name itself. 2> "nvmem-cell-names" I think nvmem-cell-names is much more consistent w.r.t naming, which should help us determine pretty much similar information. This might need bit of rework in core driver to be able to pass to provider drivers. --srini > > Rob >