On Wed, Apr 18, 2018 at 12:05:49PM +0200, jacopo mondi wrote: > Hi Akinobu, > > On Mon, Apr 16, 2018 at 11:51:42AM +0900, Akinobu Mita wrote: > > The ov772x driver only works when the i2c controller have > > I2C_FUNC_PROTOCOL_MANGLING. However, many i2c controller drivers don't > > support it. > > > > The reason that the ov772x requires I2C_FUNC_PROTOCOL_MANGLING is that > > it doesn't support repeated starts. > > > > This changes the reading ov772x register method so that it doesn't > > require I2C_FUNC_PROTOCOL_MANGLING by calling two separated i2c messages. > > > > Cc: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx> > > Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > > Cc: Hans Verkuil <hans.verkuil@xxxxxxxxx> > > Cc: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> > > Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxxx> > > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> > > --- > > * v2 > > - Replace the implementation of ov772x_read() instead of adding an > > alternative method > > I now wonder if my initial reply to this patch was wrong, and where > possible we should try to use smbus operations... > > From Documentation/i2c/smbus-protocol > "If you write a driver for some I2C device, please try to use the SMBus > commands if at all possible... " and that's because, according to > documentation, most I2c adapters support smbus protocol but may not > support the full i2c command set. > > The fact this driver then restricts the supported adapters to the ones > that support protocol mangling makes me think your change is fine, > but as it often happens, I would scale this to more knowledgable > people... Do you actually need to use this on SMBus adapters? A lot of sensor drivers just use I²C; if SMBus support is really needed it can be always added back later on... -- Sakari Ailus e-mail: sakari.ailus@xxxxxx -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html