From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 29 Jun 2008 12:24:39 -0400 From: Sean MacLennan To: "Jean Delvare" Subject: Re: [i2c] [PATCH] Convert i2c-mpc from a platform driver to an of_platform one Message-ID: <20080629122439.6295d63c@lappy.seanm.ca> In-Reply-To: <20080629091725.291974e9@hyperion.delvare> 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 Cc: David Brownell , Wolfram Sang , linuxppc-dev list , Linux@ozlabs.org, Timur Tabi , I2C List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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