[i2c] [PATCH 3/5] powerpc: Document device nodes for I2C devices.

Segher Boessenkool segher at kernel.crashing.org
Sat May 19 10:17:25 EST 2007


> Linux doesn't but it might be nice to specify this kind of thing in a
> way that other operating systems might or may support.
>
> Essentially I think since there are a lot of ways to support I2C
> (including bitbanging a GPIO pair), the only real way to support it
> is to do something like;
>
> i2c at blah {
> 	name = "i2c"
> 	compatible = "mpc52xx-i2c,someother-i2c"
> 	regs = "address:range"
> }

Yes, all devices should be in the device tree.  That's
what it's for.

> You're not ever going to be able to specify in the device tree
> exactly how to handle a driver, encompassing both implementation,
> bugs in revisions, quirks of board design, but you can specify
> for a driver a very accurate, very educated guess on it (any
> quirks, bugs or implementation differences would be board/chip
> specific, and are easily derived from the other device nodes
> like the cpu node, soc node, and so on)

Actually, you can, and should.  All this information is
contained in the "compatible" and "model" properties.
"Quirks of board design" can be described too, on a case-
by-case basis.

All the knowledge about how to drive the device resides
in the kernel, but the device tree describes exactly what
device this is, so the kernel can match a driver to it
uniquely, and the driver can know exactly what revision
chip this is and what quirks to apply.


Segher




More information about the Linuxppc-dev mailing list