From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Jean Delvare" <khali@linux-fr.org>
Cc: Tjernlund <tjernlund@tjernlund.se>,
i2c@lm-sensors.org, linuxppc-dev@ozlabs.org
Subject: Re: [RFC] Rework of i2c-mpc.c - Freescale i2c driver
Date: Tue, 6 Nov 2007 11:26:14 -0700 [thread overview]
Message-ID: <fa686aa40711061026i64f3022eh3bb820f645b9220e@mail.gmail.com> (raw)
In-Reply-To: <20071106191039.37cd7053@hyperion.delvare>
On 11/6/07, Jean Delvare <khali@linux-fr.org> wrote:
> Hi Scott,
>
> On Tue, 06 Nov 2007 11:36:23 -0600, Scott Wood wrote:
> > Jean Delvare wrote:
> > >>>> We might as well just use i2c_new_device() instead of messing around
> > >>>> with bus numbers. Note that this is technically no longer platform
> > >>>> code, so it's harder to justify claiming the static numberspace.
> > >>> I was allowing control of the bus number with "cell-index" and
> > >>> i2c_add_numbered_adapter().
> > >>> Should I get rid of this and switch to i2c_add_adapter()?
> > >> Yes.
> > >
> > > No! If you don't call i2c_add_numbered_adapter() then new-style i2c
> > > clients will never work on your i2c adapter.
> >
> > I thought that was what i2c_new_device() was for?
>
> Sorry, I've not been completely clear. Yes, you can use
> i2c_new_device() on an adapter that has been added with
> i2c_add_adapter(). However, this requires that you have a reference to
> that i2c_adapter, which is usually not the case with system-wide I2C
> buses. Embedded platforms would rather use i2c_add_numbered_adapter(),
> give a list of chips to i2c_register_board_info() and let i2c-core
> instantiate them. i2c_new_device was primarily meant for multimedia
> adapters.
*Some* embedded platforms would rather use i2c_add_numbered_adapter(). :-)
On powerpc, and other platforms which have a device tree, we don't
need to define a table of devices in the platform code because we've
already got a rich structure for describing such things. The i2c
busses and i2c devices are grouped together in the device tree, so
when the i2c bus is probed, it should call out to common i2c device
tree parsing code to instantiate all the devices described in the
tree.
It would be awkward to describe the i2c bus in the device tree but
still have to use a static structure to describe the devices on that
bus.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
next prev parent reply other threads:[~2007-11-06 18:26 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 15:14 [RFC] Rework of i2c-mpc.c - Freescale i2c driver Jon Smirl
2007-11-05 19:22 ` Matt Sealey
2007-11-05 19:51 ` Jon Smirl
2007-11-05 19:55 ` Scott Wood
2007-11-05 20:04 ` Jon Smirl
2007-11-05 20:06 ` Scott Wood
2007-11-05 20:11 ` Grant Likely
2007-11-05 19:43 ` Scott Wood
2007-11-05 20:30 ` Jon Smirl
2007-11-05 20:51 ` Scott Wood
2007-11-05 21:52 ` Matt Sealey
2007-11-05 21:55 ` Scott Wood
2007-11-05 23:03 ` Grant Likely
2007-11-06 17:32 ` Jean Delvare
2007-11-06 18:53 ` Matt Sealey
2007-11-06 20:31 ` Jean Delvare
2007-11-06 21:06 ` Matt Sealey
2007-11-05 22:46 ` Grant Likely
2007-11-06 0:33 ` Jon Smirl
2007-11-06 22:20 ` David Gibson
2007-11-06 0:41 ` Jon Smirl
2007-11-06 17:02 ` Scott Wood
2007-11-06 4:25 ` Jon Smirl
2007-11-06 4:40 ` Stephen Rothwell
2007-11-06 19:02 ` Jon Smirl
2007-11-06 22:22 ` David Gibson
2007-11-06 17:29 ` Jean Delvare
2007-11-06 17:36 ` Scott Wood
2007-11-06 18:10 ` Jean Delvare
2007-11-06 18:26 ` Grant Likely [this message]
2007-11-06 18:26 ` Grant Likely
2007-11-06 19:34 ` Jean Delvare
2007-11-06 18:29 ` Scott Wood
2007-11-06 17:45 ` Jon Smirl
2007-11-06 18:17 ` Jean Delvare
2007-11-06 19:07 ` Jon Smirl
2007-11-06 1:34 ` Jon Smirl
2007-11-06 2:28 ` Stephen Rothwell
2007-11-05 20:03 ` Grant Likely
2007-11-05 20:41 ` 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=fa686aa40711061026i64f3022eh3bb820f645b9220e@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=tjernlund@tjernlund.se \
/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).