On Mon, Mar 24, 2014 at 04:02:03PM +0100, Hans de Goede wrote: > Hi, > > On 03/24/2014 03:06 PM, Maxime Ripard wrote: > > On Tue, Mar 11, 2014 at 12:00:14PM +0100, Hans de Goede wrote: > >>> On Tue, Mar 11, 2014 at 11:16:16AM +0100, Hans de Goede wrote: > >>>>> There's still some subtleties I don't get yet, but the more I > >>>>> think about this, the more I feel like we'll have to write our own > >>>>> bus :( > >>>> > >>>> So on the bus things are different then with i2c, that does not mean > >>>> we cannot still pretend it is i2c to upper layers in the kernel. > >>> > >>> The fact that it's not having any ACK, nor any address is kind of a > >>> show stopper. For all we now, we could just as much pretend it's SPI :) > >> > >> According to: > >> https://github.com/oliv3r/u-boot-sunxi/commit/52b8454fb8951e95da76b3d9ba82461adab5ee7f > >> > >> It does have a device address, and if I read your previous mail > >> correct, there is an ack. > > > > I'm not sure about what this is actually about, but the protocol > > description clearly shows that there is no address sent over the bus. > > > > However, I think what happens is that it starts as an I2C bus, and > > that a write to this register actually switch the PMIC from I2C to > > P2WI mode, hence why it needs an address. > > > > And there is an ACK, but at the end of the transfer, not between each > > byte like on I2C. > > > > > >>> Plus, a lot of devices can actually be plugged onto several different > >>> buses, and have driver that add a small layer to access registers > >>> depending on which bus they're loaded from. > >>> > >>> We could very well imagine having to use regmap for the i2c part, and > >>> p2wi bus calls for the A31's case. > >> > >> This actually sounds like something which using a regmap would make > >> easier to do. > > > > Indeed. > > > >>>> And if we try and fail we can always define our own bus for this > >>>> later. > >>> > >>> You can still ask the i2c maintainer, but I'm afraid I know his > >>> answer. > >> > >> As said before I think we first need to learn more about how this > >> bus works before we can make a call one way or the other. > > > > What's missing from my previous mail? > > Nothing, in the mean time I've taken a look at the i2c-regmap code and > that actually is quite small. So I've come around and I agree that > making this its own bus from day 1 is the best thing to do.
Aaand, I'm not so sure anymore :) Given that it starts as an I2C bus to switch to this other bus, and that I think we can get away by adding a few protocol mangling options to the I2C, maybe we can just write it as an I2C bus master. Anyway, whoever writes it first wins, and we'll see the reviews then :) -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
signature.asc
Description: Digital signature
