linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadym Kochan <vadym.kochan@plvision.eu>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Taras Chornyi <taras.chornyi@plvision.eu>
Subject: Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Date: Fri, 14 Aug 2020 14:56:50 +0300	[thread overview]
Message-ID: <20200814115650.GE17795@plvision.eu> (raw)
In-Reply-To: <9f73d7ea-1f1f-9820-a9d1-55baa984873e@linaro.org>

Hi Srinivas,

On Mon, Jun 15, 2020 at 12:06:11PM +0100, Srinivas Kandagatla wrote:
> 
> 
> On 05/06/2020 11:53, Vadym Kochan wrote:
> > > One of the example is atmel eeprom (at24), but there might be different
> > > devices.
> > > 
> > > But can you please explain what is the technical/conceptual issue with
> > > this approach ?
> > > 
> > > Thanks,
> > I just I'd like to clarify if there is a way it can be acceptable. The
> > problem is that there is TLV format which  might be used on any nvmem
> > device which contains for example mac address which needs to be exposed
> > as nvmem cell. If to populate cells via nvmem_config then anyway I need
> > to parse these cells from the "target" nvmem device.
> 
> 
> 
> As a first step this need to be part of the provider logic to parse this
> before nvmem provider is registered. If there are more users for such
> parsing, we can think of adding some level of parsing to nvmem core itself.
> 
> Hope this answers your query.
> 
> Thanks,
> srini

Thank you for suggestion, I did not answered because I was not sure
about the way how to provide this cell parser registering, still
I am not sure about the preferred way. What about the following way:

    1) nvmem provides API for registering cell-parser.

       Looks like it might be similar to the API for adding the
       cell-table by using device's name.

    2) cell-parser driver registers itself using API from above
       (I am not sure on which initcall stage better to perform
       registration to be registered before the nvmem drivers probe)

    3) during nvmem_register() (before adding cells from table) core
       tries to find parser by matching on device's name.
       
       If parser is found - then core calls the callback with passing the pointer to
       nvmem device.

    4) cell-driver is called via on-parse callback.

       During this callback the cell-parser driver can parse the nvmem
       device and register cell table.

    5) core adds cells from registered tables.


Thank you,

      reply	other threads:[~2020-08-14 11:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 23:04 [PATCH v2 0/2] nvmem: add ONIE NVMEM cells provider Vadym Kochan
2020-05-29 23:04 ` [PATCH v2 1/2] nvmem: core: allow to register cells for existing device Vadym Kochan
2020-05-29 23:04 ` [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support Vadym Kochan
2020-06-01  8:50   ` Srinivas Kandagatla
2020-06-01  9:03     ` Vadym Kochan
2020-06-01  9:13       ` Srinivas Kandagatla
2020-06-01 10:27         ` Vadym Kochan
2020-06-05 10:53           ` Vadym Kochan
2020-06-15 11:06             ` Srinivas Kandagatla
2020-08-14 11:56               ` Vadym Kochan [this message]

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=20200814115650.GE17795@plvision.eu \
    --to=vadym.kochan@plvision.eu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=taras.chornyi@plvision.eu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).