linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Segher Boessenkool" <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@ozlabs.org
Subject: Re: [PATCH] of: i2c: improve last resort compatible entry selection
Date: Sun, 27 Jul 2008 18:00:06 -0400	[thread overview]
Message-ID: <9e4733910807271500l23fd2b12n940197474a5291df@mail.gmail.com> (raw)
In-Reply-To: <77a246d166f3eafb4d6a5d899ff86945@kernel.crashing.org>

On 7/27/08, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> >
> > >
> > > > compatible = "atmel,24c32wp", "24c32", "eeprom";
> > > >
> > >
> >
>
>
> >
> > > I know this is just an example; but to keep thinks clear, the second
> > >  and third values in this compatible property are completely bogus (for
> > >  device trees).  The manufacturer prefix needs to be present and
> > >  'eeprom' is far to vague.
> > >
> >
> > Isn't 24c32 a generic, cross manufacturer term used for these devices?
> >
>
>  Sure it is.  But "compatible" values are a global namespace so care
>  needs to be taken not to cause collisions.  One mechanism for that
>  is to use vendor prefixes (and that just shifts the problem so it
>  is less global); another is to choose good names that have a lower
>  chance to collide with the name for another device.  And the most
>  important way to prevent collisions is to write up a binding, so
>  everyone knows you have claimed that name.  It still needs to be
>  a good name, of course.
>
>
> > What if I have a socket and use a different vendor's chip each week?
> >
>
>  You use sockets for your seeproms?  Wow :-)  But yes, it shouldn't
>  be necessary to put the exact make of the device in the device
>  tree, for such generic devices.  It certainly doesn't hurt to do
>  so though (if the exact model is known).
>
>  A reasonable "compatible" value would be something like
> "serial-eeprom-24c32".
>  You can go a little bit more generic than that, if you write up in
>  your binding how the driver should figure out the device size and
>  the protocol used.

Matching on "serial-eeprom-24c32" requires me to convince the at24
authors to add that string as an alias binding for their driver. How
about "serial-eeprom,24c32" or "generic,24x32"?

>
> > eeprom is the vague Linuxism that at24 is attempting to correct.
> > eeprom just goes and searches for anything resembling an eeprom. It
> > will trigger on chips that aren't eeproms.
> >
>
>  Yeah.  And no driver should need to probe _anything_ if it has a
>  device tree node describing the device -- certainly it shouldn't
>  probe for what kind of device it is!
>
>
>  Segher
>
>


-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2008-07-27 22:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 17:54 [PATCH] of: i2c: improve last resort compatible entry selection Anton Vorontsov
2008-07-15 10:44 ` Jochen Friedrich
2008-07-15 13:40   ` Jon Smirl
2008-07-15 14:05     ` Jean Delvare
2008-07-15 14:52       ` Jochen Friedrich
2008-07-15 15:39         ` Jean Delvare
2008-07-27  0:11 ` Grant Likely
2008-07-27  5:05   ` Jon Smirl
2008-07-27  5:35     ` Grant Likely
2008-07-27 14:21       ` Jon Smirl
2008-07-27 21:52         ` Segher Boessenkool
2008-07-27 22:00           ` Jon Smirl [this message]
2008-07-28  4:16             ` M. Warner Losh
2008-07-28  7:47             ` Segher Boessenkool
2008-07-30 14:42               ` Grant Likely
2008-07-30 20:20                 ` Jon Smirl

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=9e4733910807271500l23fd2b12n940197474a5291df@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segher@kernel.crashing.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).