All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: linux-kernel@vger.kernel.org, maxime.ripard@free-electrons.com,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Trent Piepho <tpiepho@kymetacorp.com>
Subject: Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver
Date: Thu, 17 Mar 2016 11:26:28 +0000	[thread overview]
Message-ID: <56EA9464.4030107@linaro.org> (raw)
In-Reply-To: <CAHQ1cqEHz=B5g==jRoV2bKFHOQKf6MXQ3HMipFxqM8PJ58nt=Q@mail.gmail.com>



On 02/03/16 18:33, Andrey Smirnov wrote:
> On Wed, Mar 2, 2016 at 5:59 AM, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>>
>> On 01/03/16 16:59, Andrey Smirnov wrote:
>>>
>>> Add 'nvmem-composite' driver which allows to combine multiple chunks of
>>> various NVMEM cells into a single continuous NVMEM device.
>>
>>
>> My plan on this feature was add support inside the nvmem_cell_get itself,
>> this makes the nvmem bindings more inline with bindings like pinctrl.
>> Also I still want to keep nvmem simple as it can.
>
> That's perfectly fine with me, I can change my patch to do that. My
> thinking on implementing it as a standalone module was that this seems
> to be a very niche functionality which not a lot of people would use,
> so the code would be a part of your kernel only if you directly use
> this feature.
>
>>
>> DT would look something like this.
>>
>> nvmem-provider-a {
>>          cell_a {
>>                  reg = <0 2>;
>>          };
>> };
>>
>> nvmem-provider-b {
>>          cell_b: cell_c {
>>                  reg = <0 1>;
>>          };
>> };
>>
>> nvmem-provider-c {
>>          cell_c: cell_c {
>>                  reg = <3 2>;
>>          }
>> };
>>
>> a-node {
>>          nvmem-cells = <&cell_a &cell_b &cell_c>
>>          nvmem-cell-names = "some-data";
>> };
>>
>
> It's not very clear to me, possibly to my DT ignorance, how this would
> handle the case of multiple variables. Say we have
>
> a-node {
>           nvmem-cells = <&cell_a &cell_b>, ????;
>           nvmem-cell-names = "some-data", "more-data";
> };
>
Should have replied you long back :-)
> and I want "more-data" to reference only one phandle, how would this be handled?
>
yes this would fail.

The device tree compiler would concatenate all the cells and we have no 
means to know where did "more-data" starts.

sounds like composite driver is the way forward.


--srini
> Another minor nitpick about his is that if one's goal is to just
> byteswap already defined nvmem_cell:
>    - N, where N is the length of the variable, new nvmem cells would
> have to be defined
>    - All of them would have to use absolute address within the nvmem
> provided, instead of referencing a byte relative to the position of
> pre-defined cell
>
> Thanks,
> Andrey
>

  reply	other threads:[~2016-03-17 11:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 16:59 [RESEND RFC 0/3] Proposed extensions for NVMEM Andrey Smirnov
2016-03-01 16:59 ` [RESEND RFC 1/3] nvmem: Add 'of_nvmem_cell_from_device_node()' Andrey Smirnov
2016-03-02 13:58   ` Srinivas Kandagatla
2016-03-02 18:11     ` Andrey Smirnov
2016-03-01 16:59 ` [RESEND RFC 2/3] nvmem: Add 'nvmem-blob' driver Andrey Smirnov
2016-03-02 13:58   ` Srinivas Kandagatla
2016-03-02 17:21     ` Andrey Smirnov
2016-03-07  8:18       ` Maxime Ripard
2016-03-08  4:07         ` Andrey Smirnov
2016-03-08 22:28           ` Maxime Ripard
2016-03-08 22:46             ` Andrey Smirnov
2016-03-08 23:24               ` Trent Piepho
2016-03-09 10:13                 ` Maxime Ripard
2016-03-09 19:50                   ` Trent Piepho
2016-03-09  9:58               ` Maxime Ripard
2016-03-09 17:04                 ` Andrey Smirnov
2016-03-09  7:59             ` Sascha Hauer
2016-03-01 16:59 ` [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver Andrey Smirnov
2016-03-02 13:59   ` Srinivas Kandagatla
2016-03-02 18:33     ` Andrey Smirnov
2016-03-17 11:26       ` Srinivas Kandagatla [this message]
2016-03-21 16:12         ` Andrey Smirnov
2016-03-21 16:56           ` Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EA9464.4030107@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=s.hauer@pengutronix.de \
    --cc=tpiepho@kymetacorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.