Messages in this thread | | | From | Kuninori Morimoto <> | Subject | Re: [PATCH 0/4][RFC] regmap: add force write option | Date | Thu, 2 Jul 2015 08:58:15 +0000 |
| |
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
| |