linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Olof Johansson" <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, i2c@lm-sensors.org
Subject: Re: [i2c] [PATCH 3/3] Add device tree compatible aliases to i2c drivers
Date: Thu, 24 Jan 2008 19:38:01 -0500	[thread overview]
Message-ID: <9e4733910801241638u47aa6904u88c6a1606834c9a9@mail.gmail.com> (raw)
In-Reply-To: <20080125003249.GA30794@lixom.net>

On 1/24/08, Olof Johansson <olof@lixom.net> wrote:
> On Tue, Jan 22, 2008 at 09:09:16PM -0500, Jon Smirl wrote:
> > PowerPC device trees use a different naming convention than the Linux
> > kernel.  Provide alias names for i2c drivers in order to allow them to
> > be loaded by device tree name. The OF_ID macro ensures that the aliases
> > are only present in powerpc builds and separated into their own namespace.
>
> Hmm. I just realized that there's yet another twist to the PPC device
> bindings that's not yet considered:
>
> Currently the device tree only contains one compatible field for most of
> the devices. But it's perfectly legal (actually, recommended) to have more
> than one compatible field -- they go from the specific to the generic.
>
> For example, for an eeprom I might have: "MCHP,24lc128est",
> "MCHP,24xx128", "24c128". The at24 driver (not in mainline yet :) would
> likely match with "24c128", and it would normally not make sense to have
> to list all specific vendors and models of the device type in question
> in the driver.
>
> I can't register a board_info for each of the compatible fields without
> changing the way the i2c drivers are registered, since the creation of
> the duplicate entries will start reporting errors. I also shouldn't
> (reasonably) have to register every single possible first (i.e. most
> specific) compatible-field -- that goes against the whole concept of
> having more than one compatible string.
>
> So it seems that the solution would be to make i2c_board_info take a
> list of names for the device, and each of them has to be matched with
> all drivers, taking the first match.
>
> Sounds reasonable to everyone? I can provide a patch to go on top of
> what's already proposed.

I was aware that this was missing but I'm having enough trouble
getting the base code in so I hadn't addressed this problem yet. A
patch would be fine, I haven't written any code.

Can you put the support somewhere in powerpc common code? When I get
my dynamically loadable audio codec patch ready it is going to have
the same problem.

Also note that all of this only works for new style i2c drivers, if
you want to dynamically load an old style one your will have to
convert it to new style first (not hard to do).

-- 
Jon Smirl
jonsmirl@gmail.com

  parent reply	other threads:[~2008-01-25  0:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23  2:09 [PATCH 1/3] Rename i2c-mpc to i2c-mpc-drv in preparation for breaking out common code Jon Smirl
2008-01-23  2:09 ` [PATCH 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
2008-01-23  3:11   ` Stephen Rothwell
2008-01-23  4:18     ` Jon Smirl
2008-01-23 14:31   ` Jon Loeliger
2008-01-23 14:40     ` Jon Smirl
2008-01-23  2:09 ` [PATCH 3/3] Add device tree compatible aliases to i2c drivers Jon Smirl
2008-01-23 20:18   ` Matt Sealey
2008-01-23 20:30     ` Jon Smirl
2008-02-01  7:32     ` David Gibson
2008-01-25  0:32   ` [i2c] " Olof Johansson
2008-01-25  0:33     ` Scott Wood
2008-01-25  0:48       ` Jon Smirl
2008-01-25  0:38     ` Jon Smirl [this message]
2008-01-23  2:46 ` [PATCH 1/3] Rename i2c-mpc to i2c-mpc-drv in preparation for breaking out common code Stephen Rothwell
2008-01-23  2:50   ` Jon Smirl
2008-01-23  3:02     ` Grant Likely
2008-01-23  3:09       ` 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=9e4733910801241638u47aa6904u88c6a1606834c9a9@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=i2c@lm-sensors.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    /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).