Re: [i2c] [PATCH 0/4] Series to add device tree naming to i2c

From
Jon Smirl <hidden>
Date
2007-12-10 18:06:35
Reply to
Scott Wood, 2007-12-10
On 12/10/07, Scott Wood [off-list ref] wrote:
On Mon, Dec 10, 2007 at 08:38:46AM +1100, Benjamin Herrenschmidt wrote:
quoted
The more I think about it, the more I tend to agree that tagging isn't
necessary and you are right. We should just match the name against the
"compatible" property of the OF nodes (which mean we need to support
multiple matches though since "compatible" is a list of strings).
It may not be strictly necessary, but I think it's a good idea not just for
safety reasons, but as an indication to the driver what additional
information it has access to.  We could put a match data pointer in the i2c
device, and have it be a valid node pointer if the match was an OF one (and
a device-specific struct for a straight platform device, etc).  This could
be useful if a device needs to have more properties than standard
address/type/interrupt for some reason.
I can't see an easy way to do this. The basic problem is that the i2c
drivers are assumed to be cross platform. I would need to add a path
through the i2c core for getting a void pointer from the bus to the
device But then when the device code gets this pointer it has no way
of knowing what it was. Assuming the void is a pointer to an of_node
would make the driver for the i2c device platform specific.

Another way that would work cross platform would be for the module to
have module parameters for the extra attributes. The bus code could
then look in the of_node for extra attributes and use them to set the
module parameters. I know this can be done, but doing it is a little
above my understanding of the module code. You need to ask the module
it's parameter names, addresses and types and then match them to
attributes in the of_node and do the copy.
-Scott

-- 
Jon Smirl
jonsmirl@gmail.com
Thread (24 messages) 24 messages, 4 authors, last reply 2007-12-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help