Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-16 Thread Mark Brown
On Fri, Dec 13, 2013 at 01:37:07PM -0800, Stephen Boyd wrote: > I came up with this (possibly ugly) patch. It works for my > specific case but I'm not sure if unpacking the val bits into an > unsigned int and passing that to _regmap_write() is sane. What do > you think? It's not lovely but it's a

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-13 Thread Stephen Boyd
On 12/13, Mark Brown wrote: > On Thu, Dec 12, 2013 at 03:13:01PM -0800, Stephen Boyd wrote: > > > > bulk_read() should decay to individual reads if there isn't a block > > > operaton and it's not like the hardware actually supports bulk reads > > > anyway. > > > So regmap_bulk_read() should work

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-13 Thread Mark Brown
On Thu, Dec 12, 2013 at 03:13:01PM -0800, Stephen Boyd wrote: > > bulk_read() should decay to individual reads if there isn't a block > > operaton and it's not like the hardware actually supports bulk reads > > anyway. > So regmap_bulk_read() should work if I don't have a map->bus? To make it > w

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-12 Thread Stephen Boyd
On 12/11/13 05:27, Mark Brown wrote: > On Tue, Dec 10, 2013 at 05:32:51PM -0800, Stephen Boyd wrote: > >> Are you suggesting we implement the reg_read/reg_write as global helpers >> that the config points to and then call regmap_init()? At a quick glance > Yes, assuming your bus really is limited i

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-11 Thread Mark Brown
On Tue, Dec 10, 2013 at 05:32:51PM -0800, Stephen Boyd wrote: > Are you suggesting we implement the reg_read/reg_write as global helpers > that the config points to and then call regmap_init()? At a quick glance Yes, assuming your bus really is limited in the way it seems from the code. > it loo

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-10 Thread Stephen Boyd
On 12/10/13 16:51, Mark Brown wrote: > On Tue, Dec 10, 2013 at 04:13:15PM -0800, Stephen Boyd wrote: >> increment reg by 1 every time through this loop. Or should we just have >> use_single_rw == true? > No, it doesn't - it increments the address of reg by the size of a > register value each time.

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-10 Thread Mark Brown
On Tue, Dec 10, 2013 at 04:13:15PM -0800, Stephen Boyd wrote: > On 12/10/13 15:50, Mark Brown wrote: > > On Tue, Dec 10, 2013 at 03:35:18PM -0800, Stephen Boyd wrote: > >> + reg += sizeof(u16); > > I'd expect this to generate out of bounds accesses and bad interactions > > on the bus if

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-10 Thread Stephen Boyd
On 12/10/13 15:50, Mark Brown wrote: > On Tue, Dec 10, 2013 at 03:35:18PM -0800, Stephen Boyd wrote: > >> +while (val_size) { >> +ret = ssbi_read(context, *(u16 *)reg, val, 1); >> +if (ret) >> +return ret; >> +reg += sizeof(u16); >> +

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-10 Thread Mark Brown
On Tue, Dec 10, 2013 at 03:35:18PM -0800, Stephen Boyd wrote: > + while (val_size) { > + ret = ssbi_read(context, *(u16 *)reg, val, 1); > + if (ret) > + return ret; > + reg += sizeof(u16); > + val += sizeof(u8); > +

[PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-10 Thread Stephen Boyd
From: Srinivas Ramana This patch will add support for using regmap API over SSBI. Many of the Qualcomm PMIC chips(ex: PM8038, 8921) uses SSBI interface. This patch adds only regmap-ssbi suport. Individual PMIC drivers will need to register with their config to use the regmap API. regmap-ssbi uses