Thread (36 messages) 36 messages, 6 authors, 2007-05-27

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

From: Segher Boessenkool <hidden>
Date: 2007-05-19 00:18:25

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@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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help