linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	wsa@the-dreams.de, srinivas.kandagatla@linaro.org
Subject: Re: [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework
Date: Sun, 16 Aug 2015 15:11:30 +0200	[thread overview]
Message-ID: <20150816131130.GC10094@lunn.ch> (raw)
In-Reply-To: <2080648987.23864.1439713686409.JavaMail.open-xchange@oxbsltgw04.schlund.de>

On Sun, Aug 16, 2015 at 10:28:06AM +0200, Stefan Wahren wrote:
> Hi Andrew,
> 
> > Andrew Lunn <andrew@lunn.ch> hat am 16. August 2015 um 04:54 geschrieben:
> >
> >
> > Add a read only regmap for accessing the EEPROM, and then use that
> > with the NVMEM framework.
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> > drivers/misc/eeprom/at24.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 65 insertions(+)
> >
> > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> > index 2d3db81be099..0e80c0c09d4e 100644
> > --- a/drivers/misc/eeprom/at24.c
> > +++ b/drivers/misc/eeprom/at24.c
> > @@ -22,6 +22,8 @@
> > #include <linux/jiffies.h>
> > #include <linux/of.h>
> > #include <linux/i2c.h>
> > +#include <linux/nvmem-provider.h>
> > +#include <linux/regmap.h>
> 
> shouldn't the dependancies in Kconfig updated (depends on REGMAP) too?

Hi Stefan

This is why the patch is RFC.

REGMAP has stub implementations for when it is not. NVMEM also has
stub implementations. NVMEM does however select REGMAP. So it should
be possible to compile this driver without NVMEM support. Hopefully
0day will find my git branch and compile it in different ways to see
if i've got this right.

As part of RFC, is this O.K?

Another question which spring to mind is, do we want the eeprom to be
in /sys twice, the old and the new way? Backwards compatibility says
the old must stay. Do we want a way to suppress the new? Or should we
be going as far as refractoring the code into a core library, and two
wrapper drivers, old and new?
 
> > +static int at24_regmap_write(void *context, const void *data, size_t count)
> > +{
> > + struct at24_data *at24 = context;
> > +
> > + return at24_write(at24, data, 0, count);
> 
> Since the patch only provides read only support this function could return 0.

Humm, the comment is out of date. Regmap does not work too well
without a write method. So i ended up implementing it. But it has
hardly been tested, where as i have hammered on read.

Thanks
	Andrew

  reply	other threads:[~2015-08-16 13:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-16  2:54 [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework Andrew Lunn
     [not found] ` <1439693649-10809-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2015-08-16  8:28   ` Stefan Wahren
2015-08-16 13:11     ` Andrew Lunn [this message]
     [not found]       ` <20150816131130.GC10094-g2DYL2Zd6BY@public.gmane.org>
2015-08-16 15:37         ` Stefan Wahren
     [not found]           ` <1511754934.28154.1439739426390.JavaMail.open-xchange-0SF9iQWekqLZ78VGacPtK8gmgJlYmuWJ@public.gmane.org>
2015-08-17 13:01             ` Srinivas Kandagatla
     [not found]               ` <55D1DB24.8090602-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-08-17 13:09                 ` Andrew Lunn
     [not found]                   ` <20150817130945.GE7537-g2DYL2Zd6BY@public.gmane.org>
2015-08-17 14:59                     ` Srinivas Kandagatla
     [not found]                       ` <55D1F6CB.2010606-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-08-17 15:25                         ` Andrew Lunn
     [not found]                           ` <20150817152504.GI7537-g2DYL2Zd6BY@public.gmane.org>
2015-08-17 15:41                             ` Srinivas Kandagatla
2015-08-20 20:33                             ` Wolfram Sang
2015-08-20 15:57                           ` Maxime Ripard
2015-08-20 16:38                             ` Andrew Lunn
     [not found]                               ` <20150820163851.GG27457-g2DYL2Zd6BY@public.gmane.org>
2015-08-20 21:52                                 ` Maxime Ripard
2015-08-17  9:48   ` 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=20150816131130.GC10094@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=stefan.wahren@i2se.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;
as well as URLs for NNTP newsgroup(s).