Q: define i2c nodes in device tree?
From: Albrecht Dreß <hidden>
Date: 2009-03-26 19:09:26
Hi all,
I have some probably dumb questions regarding the definition of i2c
slaves in the of device tree file...
My test system is a lite5200b board to which I attached two pca8575 io
expander chips at i2c addresses 0x20 and 0x21. Using the stock kernel
2.6.29, I added the driver from the GPIO section, but I couldn't figure
out how to add them to the dts file. I tried e.g.
<snip>
i2c@3d40 {
[...]
compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
[...]
gpio@20 {
compatible = "pcf857x";
device_type = "gpio";
reg = <0x20 1>;
};
};
</snip>
and some other like "gpio-controller" instead of "gpio" but (surprise)
it doesn't work - dmesg says that the driver is registered, but nothing
else shows up. Unfortunately, I couldn't find documentation about the
naming conventions of the i2c child nodes.
As I actually want to use the chips as parallel io (not separate
gpio's) and thus would need to write my own driver I wonder if I really
have to declare it in the device tree? Would the simple way -just load
the kernel module as with arm/intel- also work? Would it be possible
to use additional resources like an interrupt pin on the '5200 without
the device tree?
Any information about a proper approach would be really helpful!
Thanks in advance, Albrecht.