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

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 11 Dec 2007 07:35:29 +1100

On Mon, 2007-12-10 at 13:06 -0500, Jon Smirl wrote:
> 
> 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.

As I said, there's an arch data structure that can be added to -any-
struct device and that we use for, among others, an optional device tree
node pointer on ppc64. We should do that on ppc32 too (and will soon for
other reasons). In this case, the i2c core can be modified on powerpc so
that when it instanciate an i2c device from the device-tree, it fills
that field.

Some device drivers can have powerpc specific code that make good use of
that for things like calibration infos etc...

Ben.