Re: [PATCH 0/3]: Sparc OF I2C support.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-08-21 22:01:49
Also in:
sparclinux
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-08-21 22:01:49
Also in:
sparclinux
On Thu, 2008-08-21 at 11:32 -0500, Scott Wood wrote:
On Thu, Aug 21, 2008 at 12:10:12AM -0700, David Miller wrote:quoted
Mostly straightforward stuff _except_ for the I2C address encoding. What I2C IEEE1275 device binding was used to write that code in of_i2c.c? Is it some PowerPC specific thing? Was it "invented" by the embedded folks (I hope not)?Yes, it was "invented". There was no documented i2c OF binding that I could find, and AFAIR nobody came forward with examples of existing practice at the time.
Well, there were examples in the powermac code :-)
quoted
And, furthermore, the device address is shifted up 1 bit higher than the Linux I2C layer expects. It includes the low direction bit, bit 0, so we have to shift it down by 1 bit before we give it to the Linux I2C layer.Yuck.
Apple does the same. IE. I take the address from "reg" and shift it right by one bit before passing it to linux.
quoted
2) When CONFIG_SPARC, shift the device address down by one bit before giving it to the Linux I2C layer.Maybe we should distinguish by the type of I2C bus node instead.
Or fix the embedded stuff :-) Ben.