Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-19 Thread Valentine Barshak
Please, take a look at my comments below Stefan Roese wrote: > This patch reworks existing ibm-iic driver to support of_platform_device > and enables it to talk to device tree directly. The "old" OCP interface > for arch/ppc is still supported via #ifdef's and shall be removed when > arch/ppc is g

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-16 Thread David Gibson
On Tue, Oct 16, 2007 at 09:19:39PM +0200, Jean Delvare wrote: > On Mon, 15 Oct 2007 22:21:38 -0600, Grant Likely wrote: > > On 10/15/07, David Gibson <[EMAIL PROTECTED]> wrote: > > > In fact I think it may be acceptle to do the idx++ thing in this > > > situation. Bus numbers are ugly, but it's no

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-16 Thread Jean Delvare
On Mon, 15 Oct 2007 22:21:38 -0600, Grant Likely wrote: > On 10/15/07, David Gibson <[EMAIL PROTECTED]> wrote: > > In fact I think it may be acceptle to do the idx++ thing in this > > situation. Bus numbers are ugly, but it's not the worst ugliness in > > the horrible mess that is the Linux i2c su

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, David Gibson <[EMAIL PROTECTED]> wrote: > As the inventor of "linux,network-index", please don't invent > "linux,i2c-index". linux,network-index was and is a hack - it's > badness is limited by the fact that it's essentially local to the > bootwrapper. It's only used in the bootwrapp

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread David Gibson
On Mon, Oct 15, 2007 at 01:13:14PM -0600, Grant Likely wrote: > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > > On Mon, Oct 15, 2007 at 10:57:48AM -0600, Grant Likely wrote: > > > Segher is recommending that we use an aliases node as per the open > > > firmware example for this. I think in

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Scott Wood
Grant Likely wrote: > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: >> Don't Do That(tm). If you use this mechanism, and an adapter node >> doesn't have a bus number, then it doesn't get to pre-register devices, >> but instead must use i2c_new_device. > > Even that doesn't work. For example

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > Grant Likely wrote: > > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > >> For associating a device node with a human readable label, I'd > >> prefer a "label" property in the device node, rather than doing it > >> backwards with aliases. >

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Scott Wood
Grant Likely wrote: > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: >> For associating a device node with a human readable label, I'd >> prefer a "label" property in the device node, rather than doing it >> backwards with aliases. > > Here the corresponding problem; having to scan every devic

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > Grant Likely wrote: > > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > >> On Mon, Oct 15, 2007 at 10:57:48AM -0600, Grant Likely wrote: > >>> Segher is recommending that we use an aliases node as per the open > >>> firmware example for this

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Scott Wood
Grant Likely wrote: > On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: >> On Mon, Oct 15, 2007 at 10:57:48AM -0600, Grant Likely wrote: >>> Segher is recommending that we use an aliases node as per the open >>> firmware example for this. I think in this case it would look >>> something like this

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Scott Wood
Eugene Surovegin wrote: > On Mon, Oct 15, 2007 at 01:53:40PM -0500, Scott Wood wrote: >> Though, I don't see what the problem with the original approach is, >> as long as the numbers are chosen in the same way when registering >> i2c clients based on the children of the adapter node. There's no >>

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Eugene Surovegin <[EMAIL PROTECTED]> wrote: > On Mon, Oct 15, 2007 at 01:53:40PM -0500, Scott Wood wrote: > > Though, I don't see what the problem with the original approach is, as long > > as the numbers are chosen in the same way when registering i2c clients based > > on the children

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Scott Wood <[EMAIL PROTECTED]> wrote: > On Mon, Oct 15, 2007 at 10:57:48AM -0600, Grant Likely wrote: > > Segher is recommending that we use an aliases node as per the open > > firmware example for this. I think in this case it would look > > something like this (but I'm not the exper

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Eugene Surovegin
On Mon, Oct 15, 2007 at 01:53:40PM -0500, Scott Wood wrote: > Though, I don't see what the problem with the original approach is, as long > as the numbers are chosen in the same way when registering i2c clients based > on the children of the adapter node. There's no concept in the hardware > itsel

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Scott Wood
On Mon, Oct 15, 2007 at 10:57:48AM -0600, Grant Likely wrote: > Segher is recommending that we use an aliases node as per the open > firmware example for this. I think in this case it would look > something like this (but I'm not the expert): > > aliases { > IIC0 = "/path/to/bus/[EMAIL PROTE

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Eugene Surovegin <[EMAIL PROTECTED]> wrote: > On Mon, Oct 15, 2007 at 03:29:11PM +0200, Stefan Roese wrote: > > > > > +#ifdef CONFIG_PPC_MERGE > > +static int device_idx = -1; > > +#endif > > + > > > > > + dev->idx = ++device_idx; > > + adap->nr = dev->idx; > > Hmm, this does

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Grant Likely
On 10/15/07, Stefan Roese <[EMAIL PROTECTED]> wrote: > This patch reworks existing ibm-iic driver to support of_platform_device > and enables it to talk to device tree directly. The "old" OCP interface > for arch/ppc is still supported via #ifdef's and shall be removed when > arch/ppc is gone in a

Re: [PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Eugene Surovegin
On Mon, Oct 15, 2007 at 03:29:11PM +0200, Stefan Roese wrote: > +#ifdef CONFIG_PPC_MERGE > +static int device_idx = -1; > +#endif > + > + dev->idx = ++device_idx; > + adap->nr = dev->idx; Hmm, this doesn't look right. That mighty powerpc device everybody was so excited about for the

[PATCH 2/2] i2c: Add devtree-aware iic support for PPC4xx

2007-10-15 Thread Stefan Roese
This patch reworks existing ibm-iic driver to support of_platform_device and enables it to talk to device tree directly. The "old" OCP interface for arch/ppc is still supported via #ifdef's and shall be removed when arch/ppc is gone in a few months. This is done to enable I2C support for the PPC4x