Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1175841

Re: [PATCH 0/4][RFC] regmap: add force write option

From Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/4][RFC] regmap: add force write option
Date 2015-07-02 11:00 +0200
Message-ID <pHIvE-qX-17@gated-at.bofh.it> (permalink)
References <pBUSS-5Rc-7@gated-at.bofh.it> <pHHpU-8fj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 0/4][RFC] regmap: add force write option Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> - 2015-07-02 11:00 +0200

csiph-web