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

Kumar Gala galak at kernel.crashing.org
Sat May 19 02:29:19 EST 2007


On May 18, 2007, at 10:58 AM, Scott Wood wrote:

> Jean Delvare wrote:
>> Hi Scott,
>>
>> On Thu, 17 May 2007 14:32:11 -0500, Scott Wood wrote:
>>
>>> (and the
>>> i2c code in Linux should be fixed to allow drivers to specify  
>>> multiple
>>> match names).
>>
>>
>> Back when David proposed his new-style i2c code, I had the same
>> objection. But we addressed the need differently. If you look at  
>> struct
>> i2c_board_info, you'll see two string fields, driver_name and  
>> type. The
>> former specifies the driver name, the second specifies the exact  
>> device
>> variant. For drivers which support several device variants, the
>> platform code should fill both fields.
>
> But that still requires the platform to know the driver name, rather
> than matching any driver which knows about the type.  This prevents  
> the
> use of OS-independent device trees (such as in Open Firmware), which
> cannot know specific Linux driver names, without something hacky  
> like a
> type-to-driver table in the device tree code.

And this is why I don't think there is any value in trying to put I2C  
devices in the device tree.  The linux mechanism is specific to  
Linux, and is based on Linux created names.  To provide something  
more generic someone would have to take on the task of providing a  
more global registry of names for devices and I just don't see anyone  
doing that.

Can someone explain to me why setting up i2c_board_info in the board  
specific code isn't sufficient?

- k



More information about the Linuxppc-dev mailing list