From: Andrew Lunn <andrew@lunn.ch>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: GregKH <greg@kroah.com>,
maxime.ripard@free-electrons.com, wsa@the-dreams.de,
broonie@kernel.org, vz@mleia.com, fd@ti.com,
linux-kernel@vger.kernel.org, pantelis.antoniou@konsulko.com,
bgolaszewski@baylibre.com
Subject: Re: [PATCHv4 2/7] nvmem: Add backwards compatibility support for older EEPROM drivers.
Date: Wed, 17 Feb 2016 14:27:18 +0100 [thread overview]
Message-ID: <20160217132718.GA17326@lunn.ch> (raw)
In-Reply-To: <56C448BE.30303@linaro.org>
On Wed, Feb 17, 2016 at 10:17:34AM +0000, Srinivas Kandagatla wrote:
>
>
> On 16/02/16 23:41, Andrew Lunn wrote:
> >Older drivers made an 'eeprom' file available in the /sys device
> >directory. Have the NVMEM core provide this to retain backwards
> >compatibility.
> >
> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> >---
> >v4: Add lockdep support
> >---
> > drivers/nvmem/core.c | 84 ++++++++++++++++++++++++++++++++++++++----
> > include/linux/nvmem-provider.h | 4 +-
> > 2 files changed, 79 insertions(+), 9 deletions(-)
> >
> >diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> >index 4ccf03da6467..9ad1c2cf75ac 100644
> >--- a/drivers/nvmem/core.c
> >+++ b/drivers/nvmem/core.c
> >@@ -38,8 +38,13 @@ struct nvmem_device {
> > int users;
> > size_t size;
> > bool read_only;
> >+ int flags;
> >+ struct bin_attribute eeprom;
> >+ struct device *base_dev;
>
> Any reason why should this base_dev be any different to the dev in
> the nvmem_config?
> Should we just not reuse dev? unless am missing something obvious.
Hi Srinivas
For backwards compatibility, we need the 'eeprom' file to be in the
i2c or spi device directory under /sys. This is the base_dev. The
nvmem file should be in the /sys/class/nvmem directory. This is the
dev in nvmem_device structure. I don't think you can merge them.
e.g. consider:
nvmem->dev.type = &nvmem_provider_type;
nvmem->dev.bus = &nvmem_bus_type;
nvmem->dev.parent = config->dev;
np = config->dev->of_node;
The base device is an i2c device on an i2c bus. Would it work if it
suddenly became an nvmem_provider on an nvmem_bus?
Thanks
Andrew
next prev parent reply other threads:[~2016-02-17 13:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 23:41 [PATCHv4 0/7] Convert exiting EEPROM drivers to NVMEM Andrew Lunn
2016-02-16 23:41 ` [PATCHv4 1/7] nvmem: Add flag to export NVMEM to root only Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-17 13:32 ` Andrew Lunn
2016-02-16 23:41 ` [PATCHv4 2/7] nvmem: Add backwards compatibility support for older EEPROM drivers Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-17 13:27 ` Andrew Lunn [this message]
2016-02-16 23:41 ` [PATCHv4 3/7] eeprom: at24: extend driver to plug into the NVMEM framework Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-17 10:21 ` Wolfram Sang
2016-02-17 11:00 ` Srinivas Kandagatla
2016-02-17 11:00 ` Srinivas Kandagatla
2016-02-16 23:41 ` [PATCHv4 4/7] eeprom: at25: Remove in kernel API for accessing the EEPROM Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-16 23:41 ` [PATCHv4 5/7] eeprom: at25: extend driver to plug into the NVMEM framework Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-17 13:42 ` Andrew Lunn
2016-02-17 13:45 ` Srinivas Kandagatla
2016-02-16 23:41 ` [PATCHv4 6/7] eeprom: 93xx46: " Andrew Lunn
2016-02-17 10:17 ` Srinivas Kandagatla
2016-02-17 13:46 ` Srinivas Kandagatla
2016-02-16 23:41 ` [PATCHv4 7/7] misc: at24: replace memory_accessor with nvmem_device_read Andrew Lunn
2016-02-17 10:18 ` Srinivas Kandagatla
2016-02-17 10:17 ` [PATCHv4 0/7] Convert exiting EEPROM drivers to NVMEM Srinivas Kandagatla
2016-02-17 13:39 ` Andrew Lunn
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=20160217132718.GA17326@lunn.ch \
--to=andrew@lunn.ch \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=fd@ti.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=pantelis.antoniou@konsulko.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=vz@mleia.com \
--cc=wsa@the-dreams.de \
/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