Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336417

Re: [PATCHv4 2/7] nvmem: Add backwards compatibility support for older EEPROM drivers.

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCHv4 2/7] nvmem: Add backwards compatibility support for older EEPROM drivers.
Date 2016-02-17 14:30 +0100
Message-ID <r3al4-704-15@gated-at.bofh.it> (permalink)
References <r2Xxv-6pr-3@gated-at.bofh.it> <r2Xxw-6pr-17@gated-at.bofh.it> <r37wS-51u-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCHv4 2/7] nvmem: Add backwards compatibility support for older EEPROM drivers. Andrew Lunn <andrew@lunn.ch> - 2016-02-17 00:50 +0100
  Re: [PATCHv4 2/7] nvmem: Add backwards compatibility support for  older EEPROM drivers. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-17 11:30 +0100
    Re: [PATCHv4 2/7] nvmem: Add backwards compatibility support for  older EEPROM drivers. Andrew Lunn <andrew@lunn.ch> - 2016-02-17 14:30 +0100

csiph-web