[i2c] [PATCH] Convert i2c-mpc from a platform driver to an of_platform one

Sean MacLennan smaclennan at pikatech.com
Mon Jun 30 02:24:39 EST 2008


On Sun, 29 Jun 2008 09:17:25 +0200
"Jean Delvare" <khali at linux-fr.org> 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 at ef600700 {
	compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
	reg = <ef600700 14>;
	interrupt-parent = <&UIC0>;
	interrupts = <2 4>;
	#address-cells = <1>;
	#size-cells = <0>;

	ad7414 at 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



More information about the Linuxppc-dev mailing list