[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH V1] regmap: add bulk_write() for non-volatile register set
On Fri, Feb 10, 2012 at 02:43:43PM +0530, Laxman Dewangan wrote:

Please remember to delete unnneded context from your mails, it makes it
much easier to find what you're saying.

> So I am going to allocate buffer for some size, initially
> min(val_bytes * max_register, 128) bytes, and in bulk_write(), if
> require buffer is more than 128 then re-alloc buffer which is now
> (req_size + 128).
> And then copy the data into this buffer, modify it and send to device.

What I'd suggest doing as a first pass is just allocating the buffer
each time, anything else is a performance optimisation we can worry
about incrementally. Remember, this only has to be faster than I2C most
of the time and I2C is really slow. For your case with 8 byte values
there's an even better optimisation which is to notice that we don't
need to swap at all and just use the original buffer directly.
[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2012-02-10 12:09    [W:0.038 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site