From: Josh Boyer <jwboyer@linux.vnet.ibm.com>
To: Timur Tabi <timur@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>, Stefan Roese <sr@denx.de>,
linuxppc-dev@ozlabs.org
Subject: Re: "cell-index" vs. "index" vs. no index in I2C device nodes
Date: Thu, 5 Jun 2008 13:40:57 -0500 [thread overview]
Message-ID: <20080605134057.346e1149@zod.rchland.ibm.com> (raw)
In-Reply-To: <484831E6.8090509@freescale.com>
On Thu, 05 Jun 2008 13:35:18 -0500
Timur Tabi <timur@freescale.com> wrote:
> Josh Boyer wrote:
>
> > I don't understand this statement. Are your I2C macros hot-pluggable?
> > Can you dynamically add/remove an I2C engine on your hardware somehow?
> > Are you mucking about with the DTB and randomly moving around the I2C
> > node blobs so they probe order differs from boot to boot?
> >
> > If not, then the probe order will be static for every boot.
>
> You're making two assumptions:
>
> 1) That every I2C adapter will be present in the device tree. Some device trees
> don't list I2C adapters if there are no devices on them.
Which isn't a problem.
> 2) That the nodes in the device tree are put in order
Which isn't a problem.
> Besides, let's say I have a pointer to a specific I2C device node in the tree.
> How do I find out the bus number it's on? With my way, it's easy:
>
> iprop = of_get_property(of_get_parent(codec_np), "cell-index", NULL);
> bus = *iprop;
>
> With your way, I'll need to scan the entire device tree, poking inside each I2C
> adapter node looking for my I2C device node while keeping track of the I2C adapters.
>
> > You can
> > assign the index
>
> Assign it to where? When the fabric driver goes to find codec nodes, the only
> information it has is the device tree. So when I assign this index to some
> random variable that you're talking about, my fabric driver will know nothing
> about that.
Your driver is sufficiently different then. The i2c-ibm_iic driver
keeps an index property in it's private device structure.
> > using a static int that is incremented after each node
> > is discovered and the ordering of the devices will never change. Can
> > you explain why something like that isn't possible or sufficient?
>
> Yes, I just did.
Sort of.
> > (And I'm talking about I2C, not DMA. I don't care about DMA because
> > this conversation will go off into the weeds if we start talking about
> > cell-index and every possible device out there.)
>
> But we are talking about every device. It's the same problem for every device.
> Making this problem I2C-specific is not going to solve anything.
I've been driven to the point of not caring anymore.
If you need a simple index property, then maybe Sean was right to just
call the damn thing "index". Overloading "cell-index", which already
has a specific semantic associated with it, seems odd to me.
josh
next prev parent reply other threads:[~2008-06-05 18:41 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 15:06 "cell-index" vs. "index" vs. no index in I2C device nodes Stefan Roese
2008-06-04 15:24 ` Timur Tabi
2008-06-04 15:43 ` Scott Wood
2008-06-05 2:19 ` Josh Boyer
2008-06-05 2:41 ` David Gibson
2008-06-06 2:40 ` Segher Boessenkool
2008-06-06 3:37 ` David Gibson
2008-06-07 0:30 ` Segher Boessenkool
2008-06-06 4:07 ` Grant Likely
2008-06-06 4:29 ` Sean MacLennan
2008-06-05 2:54 ` Sean MacLennan
2008-06-05 3:05 ` Josh Boyer
2008-06-05 3:16 ` Sean MacLennan
2008-06-05 6:22 ` Stefan Roese
2008-06-05 7:48 ` Jean Delvare
2008-06-05 8:45 ` Stefan Roese
2008-06-05 10:57 ` David Gibson
2008-06-05 11:52 ` Josh Boyer
2008-06-05 15:18 ` Timur Tabi
2008-06-05 22:47 ` David Gibson
2008-06-06 4:17 ` Benjamin Herrenschmidt
2008-06-06 4:16 ` Benjamin Herrenschmidt
2008-06-06 6:21 ` Jean Delvare
2008-06-06 7:47 ` Grant Likely
2008-06-06 8:45 ` Benjamin Herrenschmidt
2008-06-05 15:17 ` Timur Tabi
2008-06-05 15:44 ` Jochen Friedrich
2008-06-05 15:50 ` Timur Tabi
2008-06-05 16:10 ` Grant Likely
2008-06-05 16:18 ` Timur Tabi
2008-06-05 16:22 ` Jochen Friedrich
2008-06-05 16:30 ` Grant Likely
2008-06-05 16:40 ` Timur Tabi
2008-06-05 22:46 ` David Gibson
2008-06-05 16:35 ` Grant Likely
2008-06-05 23:59 ` Josh Boyer
2008-06-07 0:24 ` Segher Boessenkool
2008-06-05 21:37 ` Sean MacLennan
2008-06-05 23:48 ` Josh Boyer
2008-06-05 15:13 ` Timur Tabi
2008-06-05 15:39 ` Grant Likely
2008-06-05 15:43 ` Timur Tabi
2008-06-05 15:52 ` Segher Boessenkool
2008-06-05 16:09 ` Timur Tabi
2008-06-05 16:27 ` Scott Wood
2008-06-05 17:52 ` Timur Tabi
2008-06-05 18:04 ` Scott Wood
2008-06-05 16:00 ` Grant Likely
2008-06-05 16:13 ` Timur Tabi
2008-06-05 16:21 ` Josh Boyer
2008-06-05 16:25 ` Timur Tabi
2008-06-05 16:37 ` Grant Likely
2008-06-05 18:27 ` Josh Boyer
2008-06-05 18:35 ` Timur Tabi
2008-06-05 18:40 ` Josh Boyer [this message]
2008-06-05 18:46 ` Grant Likely
2008-06-05 18:56 ` Josh Boyer
2008-06-05 19:14 ` Grant Likely
2008-06-05 19:15 ` Josh Boyer
2008-06-05 19:16 ` Timur Tabi
2008-06-05 21:31 ` Segher Boessenkool
2008-06-05 22:56 ` David Gibson
2008-06-06 13:09 ` Timur Tabi
2008-06-06 13:42 ` Stefan Roese
2008-06-05 22:45 ` Sean MacLennan
2008-06-06 4:20 ` Benjamin Herrenschmidt
2008-06-25 21:46 ` Timur Tabi
2008-06-27 16:48 ` Jochen Friedrich
2008-06-05 15:46 ` Segher Boessenkool
2008-06-05 15:52 ` Jochen Friedrich
2008-06-05 15:53 ` Grant Likely
2008-06-06 4:19 ` Benjamin Herrenschmidt
2008-06-06 4:14 ` Benjamin Herrenschmidt
2008-06-06 4:13 ` Benjamin Herrenschmidt
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=20080605134057.346e1149@zod.rchland.ibm.com \
--to=jwboyer@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
--cc=sr@denx.de \
--cc=timur@freescale.com \
/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).