[PATCH v1] Add support for getting device platform data to I2C device

Anton Vorontsov avorontsov at ru.mvista.com
Fri Dec 19 04:49:27 EST 2008


On Thu, Dec 18, 2008 at 11:20:03AM -0600, Scott Wood wrote:
> Anton Vorontsov wrote:
>> On Thu, Dec 18, 2008 at 10:14:11AM +0800, Mingkai Hu wrote:
>>> There is no standard way of getting device platform data from
>>> dts file to the I2C device when it's probed. This patch adds
>>> a function pointer to the of_modalias_table to get such bindings
>>> properties into device's platform data.
>>
>> Unfortunately this approach leads to inability to make the bindings
>> modular.
>
> True, but I think it's fine for now while a better mechanism is worked  
> out -- especially for things that are mainly used in embedded situations  
> where modular builds aren't as necessary.

Exactly, this matters for non-embedded case. Why would I want totally
unneeded I2C bindings built-in into my iBook kernel? ;-)

>> And the solution that everybody seem to agree with (SPI driver example):
>> http://lkml.org/lkml/2008/10/30/393
>
> Hmm, that doesn't seem to allow for any binding mechanism other than  
> internal and OF

Yeah, not without hacks (though, we can do some sort of chained pdata
handlers, thus we can allow other bindings mechanisms). But so far we
don't have anything other than OF and "board files"/raw bindings (I can't
actually imagine any other option).

Both approaches have their cons, sure. The difference is: for the
$subject approach we'll see the cons immediately, while in my approach
the cons are theoretical.

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2



More information about the Linuxppc-dev mailing list