lkml.org 
[lkml]   [2015]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 0/4][RFC] regmap: add force write option
Date

Hi Lars

> > Current _regmap_update_bits() writes data to register if current value and
> > write value was different. This means it doesn't write data if the value was
> > same as current value.
> > But, some device needs to write data even though it was same value.
>
> Can you go into more detail about the exact usecase with a specific example?

Some of our device registers need to be written data even though it was same as current value.
Otherwise, it doesn't work correctly.
Now, its device driver is using regmap. If my understanding was correct, regmap write
function will try to read current data. then it writes data if current data and
write data were not same. this behavior can reduce process, but we had trouble.

pseudo code of current regmap is

xxx regmap_xx_write(reg, new)
{
old = xx_read(reg);

if (old != new)
xxx_write(reg, new);
}

We would like to have "force" write feature

xxx regmap_xx_write(reg, new, force)
{
old = xx_read(reg);

/*
* we would like to write data
* even though old == new here
*/

if (force || (old != new))
xxx_write(reg, new);
}


Best regards
---
Kuninori Morimoto


\
 
 \ /
  Last update: 2015-07-02 11:21    [W:0.136 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site