From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Artem Bityutskiy
<dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
oliver-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: MTD EEPROM support and driver integration
Date: Mon, 8 Jul 2013 22:25:38 +0200 [thread overview]
Message-ID: <20130708202538.GK11243@lukather> (raw)
In-Reply-To: <20130708083426.GO27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3669 bytes --]
On Mon, Jul 08, 2013 at 09:34:26AM +0100, Mark Brown wrote:
> On Sat, Jul 06, 2013 at 09:06:49PM +0200, Arnd Bergmann wrote:
> > On Saturday 06 July 2013 14:01:12 Maxime Ripard wrote:
>
> > > > > > a) like interrupts, regs, dmas, clocks, pinctrl, reset, pwm: fixed property names
>
> > > > > > regmap = <&at25 0xstart 0xlen>;
> > > > > > regmap-names = "mac-address";
>
> > > > > > b) like gpio, regulator: variable property names
>
> > > > > > mac-storage = <&at25 0xstart 0xlen>;
>
> > > > > > It's unfortunate that we already have examples of both. They are largely
> > > > > > equivalent, but the tendency is towards the first.
>
> > > > > I don't have a strong feeling for one against another, so whatever works
> > > > > best. Both solutions will be a huge improvement anyway
>
> > > > > Just out of curiosity, is there any advantages besides having a fixed
> > > > > property name to the first solution?
>
> > > > I think it's mostly for consistency: trying to get most subsystems to
> > > > do it the same way to make it easier for people to write dts files.
>
> > > > A lesser point is that it simplifies the driver code if you don't
> > > > have to pass a name.
>
> On the other hand something with human readable names is much more
> legible if humans ever have to read or write the DT bindings. This
> mostly applies when there are many instances of the property (for
> example, many devices have lots of power supplies) or when some
> instances of the property are optional (for example, many devices can
> use GPIOs for many different functions but usually not all of them are
> connected and there's no particular order in which they might get
> connected).
I guess we would have only a few of these in our cases, so it doesn't
really qualify for the "many instances" I guess, but I do find the
GPIO/regulator-like properties more intuitive and more readable as
well.
> > > So that leave us with mainly one path to achieve this goal:
> > > - Add a regmap-mtd backend
> > > - Add DT parsing code for regmap
> > > - Move the EEPROM drivers from misc to mtd
>
> > Yes, I think that would be good. For the last step, we definitely need
> > buy-in from Wolfgand and Jean, as they are maintaining the current eeprom
> > drivers.
>
> I'd really like to see more discussion of this "DT parsing code for
> regmap" idea... I've missed almost all the context here.
The context was that I found we lack a way to simply express the need
for one driver to get a value from an EEPROM-like device, for example to
get a MAC Address, or a serial number, in a generic way, without having
to poke directly with some custom function that would be exported by the
EEPROM driver.
And the lack of infrastructure/framework to handle the EEPROM right now
only make the thing a bit harder.
What we've been discussing so far is that:
- To have a common framework we could base our work on, we could move
the EEPROM drivers from drivers/misc/eeprom to MTD
- To declare the ranges that needed to be used by a driver that was
needing a value from one of those MTD drivers, we would use regmap
with a MTD backend
- And since we actually need to declare which ranges and in which
device one driver would have to retrieve this value from, we were
actually in need of DT bindings.
This is pretty much the only context involved, and we are at the early
stage of the discussion, so any comment is very welcome :)
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-07-08 20:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130705201118.GM2959@lukather>
[not found] ` <5811519.oHVuMujf0I@wuerfel>
[not found] ` <20130706120112.GA11069@lukather>
2013-07-06 19:06 ` MTD EEPROM support and driver integration Arnd Bergmann
2013-07-06 19:55 ` Jean Delvare
2013-07-07 7:15 ` Maxime Ripard
2013-07-08 8:36 ` Mark Brown
[not found] ` <20130708083614.GP27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-08 21:04 ` Maxime Ripard
2013-07-08 8:34 ` Mark Brown
[not found] ` <20130708083426.GO27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-08 20:25 ` Maxime Ripard [this message]
2013-07-09 14:55 ` Mark Brown
[not found] ` <20130709145510.GZ27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-11 17:05 ` Maxime Ripard
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=20130708202538.GK11243@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=oliver-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/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).