linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <dwg@au1.ibm.com>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Scott Wood <scottwood@freescale.com>,
	linuxppc-dev@ozlabs.org, Stefan Roese <sr@denx.de>,
	Timur Tabi <timur@freescale.com>
Subject: Re: "cell-index" vs. "index" vs. no index in I2C device nodes
Date: Thu, 5 Jun 2008 12:41:40 +1000	[thread overview]
Message-ID: <20080605024140.GA30980@yookeroo.seuss> (raw)
In-Reply-To: <20080604211942.2bddc860@zod.rchland.ibm.com>

On Wed, Jun 04, 2008 at 09:19:42PM -0500, Josh Boyer wrote:
> On Wed, 4 Jun 2008 10:43:51 -0500
> Scott Wood <scottwood@freescale.com> wrote:
> 
> > On Wed, Jun 04, 2008 at 10:24:15AM -0500, Timur Tabi wrote:
> > > Stefan Roese wrote:
> > > > I'm wondering what is currently recommended in the I2C device tree nodes? The 
> > > > current IBM I2C driver (i2c-ibm_iic.c) checks "index" and most FSL dts files 
> > > > use "cell-index". Some 4xx dts files implement "cell-index" some have no 
> > > > index at all.
> > > > 
> > > > So what should be used here. Please advise and I'll prepare a patch for it.
> > > 
> > > I just posted a patch for the FSL I2C driver to check for cell-index.  I'm under
> > > the impression that cell-index is the standard for enumerating devices in the
> > > device tree.
> > 
> > No, it's the standard for correlating devices with portions of a shared
> > register block elsewhere.  Your use in the I2C node is merely a hack to
> > deal with Linux wanting to deal with indices rather than pointers,
> > combined with a lack of a decent way to look up a device struct from the
> > device node.
> 
> So if possible, I'd like to eliminate the *index stuff all together
> from the 4xx driver.  The private data structure contains an idx
> parameter, but this can be populated based on probe order or something.
> 
> >From a device tree perspective, index and cell-index are both
> incorrect.  The IIC macros don't share register blocks with anything,
> are enumerated as unique instances per macro in the device tree, and
> should be able to be distinguished by "regs" and/or unit address.
> 
> Does anyone disagree with that?

Hear, hear.

Aliases can also provide a reasonable way of enumerating devices, if
"reg" isn't suitable on its own.  Though obviously, drivers will need
some sort of fallback if suitable aliases don't exist in the tree.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2008-06-06  1:10 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 [this message]
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
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=20080605024140.GA30980@yookeroo.seuss \
    --to=dwg@au1.ibm.com \
    --cc=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).