Re: [PATCH 2.6.28] mfd: Correct WM8350 I2C return code usage

From: Mark Brown
Date: Wed Nov 12 2008 - 15:00:24 EST


On Wed, Nov 12, 2008 at 07:49:57PM +0100, Samuel Ortiz wrote:
> On Mon, Nov 10, 2008 at 01:41:17PM +0000, Mark Brown wrote:

> > The vendor BSP used for the WM8350 development provided an I2C driver
> > which incorrectly returned zero on succesful sends rather than the
> > number of transmitted bytes, an error which was then propagated into the
> > WM8350 I2C accessors.

> Shouldnt we fix the accessors behaviour instead ?
> Currently, that would mean fixing some of the wm8350-core static functions.
> Slightly bigger patch, but that would keep the i2c interface consistent.

I don't really understand what you mean by "keep the i2c interface
consistent" here? The purpose of this abstraction is to abstract away
the control interface used to communicate with the chip since it
supports both I2C and SPI.

> What do you think ?

That would expose the details of the I2C API and the wire format used to
access the device over I2C to the WM8350 core which would mean the SPI
control code would have to jump through hoops to emulate it. If the
device only had I2C control it would be better to just remove this
abstraction entirely and use the I2C API directly in the register access
functions.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/