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

Segher Boessenkool segher at kernel.crashing.org
Sun May 20 02:25:38 EST 2007


>> 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.
>
> That's what I said wasn't it?

Not at all, no.

> If you have a buggy i2c controller or one that has a strange
> quirk, but it's present as fsl-i2c in those device trees,
> would you specify that it is fsl-i2c-less-bugs later?
> Would you add property after property to describe errata,
> quirks in the nodes themselves?

No.  All this can be easily derived from the "model"
properties in the relevant nodes.

> I'll take an example of putting useless information in
> the device tree - how about the CPU node? It has all the
> information for cache sizes etc. but does Linux use it?

It *should* use it though.  But it cannot really do that,
since many/most device trees are broken in this respect.

Linux *does* use some of the "cpu" properties though.
Maybe in the future it will use more.

> This is what I mean by 'describing exactly what the device
> is' being rather a tedious and time-wasting concept.

This is equivalent to stating the device tree is a useless
concept.  You are free to your opinion of course.

> I might be a little less noisy about it if there was
> some kind of edict for devices never to wander outside
> of their own node in the device tree, but there isn't.

I'm not sure what you mean here.  It is best practice
for device nodes to be reasonably self-contained though.
Of course not completely; every node always has to refer
to its parent bus, etc.  Device drivers will sometimes
have to refer to board model for board-specific workarounds.

> I don't think the device tree has much use beyond the
> advertisement and authorisation of use of system devices,
> and as the most basic and essential automatic driver
> processes (probe and initialisation).

Again, you are free to your own opinion.

> It is quite another
> matter to make it a kind of Linux-programmers errata
> replacement framework and artificially recreate already
> easily-accessible information.

No one is proposing that I hope.  This information indeed
is already easily available in most cases -- namely, in
the device tree.


Segher




More information about the Linuxppc-dev mailing list