Re: Using regmap_update_bits to update a write only register

From: Mark Brown
Date: Thu Mar 05 2015 - 12:54:08 EST

On Thu, Mar 05, 2015 at 07:35:32PM +0200, Daniel Baluta wrote:

> Is it possible to use regmap_update_bits to update the values
> of some bits in a write only register?

That should work.

> I was hoping that by filling the .reg_defaults field of regmap_config
> the regmap_update_bits function will not try to read the register
> from hardware.

> Instead I think first call of regmap_update_bits will try to read the register
> from hardware, but this fails with -EIO because the register is marked as
> write only.

> Am I doing something wrong?

Probably, or there's a bug. What should happen is that if the register
default appeared successfully then the read will get statisfied from the
cache in the manner you describe - presumably that's gone wrong somehow.
Have you set num_reg_defaults? That's the obvious thing...

Attachment: signature.asc
Description: Digital signature