From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean MacLennan Subject: Re: [i2c] [PATCH] Convert i2c-mpc from a platform driver to an of_platform one Date: Sun, 29 Jun 2008 12:24:39 -0400 Message-ID: <20080629122439.6295d63c@lappy.seanm.ca> References: <9e4733910806101940o7f2f9863jb5e556ee2fc39a7e@mail.gmail.com> <20080625155825.43d07d20@hyperion.delvare> <9e4733910806281905l61714e33h8b26870e2c93539e@mail.gmail.com> <20080629044940.GC13658@secretlab.ca> <20080629083143.7f39b3c1@hyperion.delvare> <20080629065812.GO13876@secretlab.ca> <20080629091725.291974e9@hyperion.delvare> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080629091725.291974e9@hyperion.delvare> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org Errors-To: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org To: Jean Delvare Cc: David Brownell , Wolfram Sang , linuxppc-dev list , Linux@ozlabs.org, Timur Tabi , I2C List-Id: linux-i2c@vger.kernel.org On Sun, 29 Jun 2008 09:17:25 +0200 "Jean Delvare" wrote: > Ah, OK. If you use i2c_new_device() then it's alright. Correct. I have done the same thing for the i2c-ibm_iic.c driver. Jean, I think you will like this. It gets rid of the index and the numbered drivers. And the walking of the device tree is very clean because the dts knows all the devices. For example here is the relevant portion of the dts for the Warp: IIC0: i2c@ef600700 { compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic"; reg = ; interrupt-parent = <&UIC0>; interrupts = <2 4>; #address-cells = <1>; #size-cells = <0>; ad7414@4a { compatible = "adi,ad7414"; reg = <4a>; interrupts = <19 8>; interrupt-parent = <&UIC0>; }; }; It clearly shows that first i2c controller (IIC0) contains one ad7414 device at address 4A. Cheers, Sean