Re: [PATCH V1] regmap: add bulk_write() for non-volatile register set

From: Mark Brown
Date: Thu Feb 09 2012 - 07:55:40 EST


On Thu, Feb 09, 2012 at 06:15:18PM +0530, Laxman Dewangan wrote:
> On Thursday 09 February 2012 05:47 PM, Mark Brown wrote:
> >On Thu, Feb 09, 2012 at 05:42:11PM +0530, Laxman Dewangan wrote:

> >>+ if (vol || map->cache_type == REGCACHE_NONE) {
> >>+ ret = _regmap_raw_write(map, reg, val, val_bytes * val_count);

> >You still need to do the byte swap here.

> I saw the regmap_raw_write() and it is using the same way without
> byte swapping.

That's the whole point with the difference between the bulk and raw APIs
though, the raw API skips the byte swapping and the bulk does it.

> Want to use the same function as it is.. I am not sure why do we
> require byte-swapping in this case. Required things will be done by
> _regmap_raw_write only.

The byte swapping is important for any device which has more than 8 bit
register values, it's only not an issue for you because you have 8 bit
registers.

> This api just break the transfer in register-wise if any of the
> register is cached..

Well, there's no fundamental reason why we can't support cache on raw
operations too. It's not implemented because there's no need for it
with any current users rather than because it's impossible.


>
> >>+ } else {
> >>+ for (i = 0; i< val_count; i++) {
> >>+ memcpy(map->work_buf, val + (i * val_bytes), val_bytes);
> >>+ ival = map->format.parse_val(map->work_buf);
> >They're currently symmetric but really this should use format_val().
> >
> The format_val is require integer argument and issue is that I dont
> have this otherwise I need not to parse, can use directly.
>
> Am I missing something here?
>
>
> >* Unknown Key
> >* 0x6E30FDDD
>

Attachment: signature.asc
Description: Digital signature