Re: [PATCH] regmap: i2c: fallback to SMBus if the adapter does not support standard I2C

2014-04-16 Thread Mark Brown
On Wed, Apr 16, 2014 at 07:16:14PM +0200, Boris BREZILLON wrote: > Actually I do not modify the passed config struct, I copy the config > values into a local instance and then modify this local instance > appropriately. > But I agree that having a proper way to overload config parameters would > b

Re: [PATCH] regmap: i2c: fallback to SMBus if the adapter does not support standard I2C

2014-04-16 Thread Boris BREZILLON
Hello Mark, On 16/04/2014 19:06, Mark Brown wrote: > On Wed, Apr 16, 2014 at 10:16:10AM +0200, Boris BREZILLON wrote: > >> +if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) { >> +return ®map_i2c; >> +} else if (config->val_bits == 16 && >> + i2c_check_func

Re: [PATCH] regmap: i2c: fallback to SMBus if the adapter does not support standard I2C

2014-04-16 Thread Mark Brown
On Wed, Apr 16, 2014 at 10:16:10AM +0200, Boris BREZILLON wrote: > + if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) { > + return ®map_i2c; > + } else if (config->val_bits == 16 && > +i2c_check_functionality(i2c->adapter, > +

[PATCH] regmap: i2c: fallback to SMBus if the adapter does not support standard I2C

2014-04-16 Thread Boris BREZILLON
Some I2C adapters are only compatible with the SMBus protocol and do not support standard I2C transfers. Fallback to SMBus transfers if we encounter such kind of adapters. The transfer type is chosen according to the val_bits field in the regmap config. Signed-off-by: Boris BREZILLON --- Hello M