[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-14 Thread Mark Brown
On Mon, Apr 14, 2014 at 03:08:05PM +0200, Boris BREZILLON wrote: > SMBus is a subset of the I2C protocol, oftenly used to access registers on > external devices. This is basically fine. However... > + switch (ctx->transfer_type) { > + case REGMAP_SMBUS_BYTE_TRANSFER: > + whil

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Boris BREZILLON
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14/04/2014 23:04, Mark Brown wrote: > On Mon, Apr 14, 2014 at 03:08:05PM +0200, Boris BREZILLON wrote: >> SMBus is a subset of the I2C protocol, oftenly used to access registers on >> external devices. > > This is basically fine. However... > >>

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Mark Brown
On Tue, Apr 15, 2014 at 09:36:13AM +0200, Boris BREZILLON wrote: > On 14/04/2014 23:04, Mark Brown wrote: > > The transfer type gets set once per device at init time so why not > > just parameterise based on val_bytes? > Actually, you may want to transfer 1 byte registers using the block > method

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Boris BREZILLON
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/04/2014 12:09, Mark Brown wrote: > On Tue, Apr 15, 2014 at 09:36:13AM +0200, Boris BREZILLON wrote: >> On 14/04/2014 23:04, Mark Brown wrote: > >>> The transfer type gets set once per device at init time so why not >>> just parameterise based o

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Mark Brown
On Tue, Apr 15, 2014 at 01:54:02PM +0200, Boris BREZILLON wrote: > On 15/04/2014 12:09, Mark Brown wrote: > > OK, so if this a realistic issue then it seems like it's better to > > implement three different buses - there is not really any common code > > between the various paths. > Okay, I'll cr

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Boris BREZILLON
On 15/04/2014 14:25, Lars-Peter Clausen wrote: > On 04/15/2014 01:54 PM, Boris BREZILLON wrote: >> >> >> On 15/04/2014 12:09, Mark Brown wrote: >>> On Tue, Apr 15, 2014 at 09:36:13AM +0200, Boris BREZILLON wrote: On 14/04/2014 23:04, Mark Brown wrote: >> > The transfer type gets set once

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Lars-Peter Clausen
On 04/15/2014 01:54 PM, Boris BREZILLON wrote: On 15/04/2014 12:09, Mark Brown wrote: On Tue, Apr 15, 2014 at 09:36:13AM +0200, Boris BREZILLON wrote: On 14/04/2014 23:04, Mark Brown wrote: The transfer type gets set once per device at init time so why not just parameterise based on val_by

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus

2014-04-15 Thread Mark Brown
On Tue, Apr 15, 2014 at 02:25:15PM +0200, Lars-Peter Clausen wrote: > On 04/15/2014 01:54 PM, Boris BREZILLON wrote: > >And, should I keep one method to register an smbus regmap or should I > >provide one method per access type and get rid of the > >regmap_smbus_transfer_type enum ? > I don't thi

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over SMBus

2014-04-15 Thread Lars-Peter Clausen
On 04/15/2014 02:40 PM, Boris BREZILLON wrote: On 15/04/2014 14:25, Lars-Peter Clausen wrote: On 04/15/2014 01:54 PM, Boris BREZILLON wrote: On 15/04/2014 12:09, Mark Brown wrote: On Tue, Apr 15, 2014 at 09:36:13AM +0200, Boris BREZILLON wrote: On 14/04/2014 23:04, Mark Brown wrote: The

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus

2014-04-15 Thread Lars-Peter Clausen
On 04/15/2014 02:56 PM, Mark Brown wrote: [...] My suggestion is that in regmap_init_i2c() you check the capabilities of the I2C adapter. If it supports native I2C you setup the regmap with the regmap_i2c struct just as it does right now. If the adapter does not support native I2C, check if the d

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus

2014-04-15 Thread Mark Brown
On Tue, Apr 15, 2014 at 03:34:55PM +0200, Lars-Peter Clausen wrote: > On 04/15/2014 02:56 PM, Mark Brown wrote: > > - Providing APIs for registering actual smbus devices as a convenience > >for devices with that constraint, regardless of how that is done > >behind the scenes. > > - Havi

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus

2014-04-15 Thread Lars-Peter Clausen
On 04/15/2014 06:46 PM, Mark Brown wrote: On Tue, Apr 15, 2014 at 03:34:55PM +0200, Lars-Peter Clausen wrote: On 04/15/2014 02:56 PM, Mark Brown wrote: - Providing APIs for registering actual smbus devices as a convenience for devices with that constraint, regardless of how that is done

[linux-sunxi] Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus

2014-04-15 Thread Mark Brown
On Tue, Apr 15, 2014 at 09:18:11PM +0200, Lars-Peter Clausen wrote: > On 04/15/2014 06:46 PM, Mark Brown wrote: > >Please note what I said about convenience - if lots of devices have > >exactly the same set of constraints to set up it's possible sensible to > >have a standard way of specifying the