# Re: \[PATCH v5 2/8\] gpio: regmap: Add quirk for aliased data registers

- From: Andy Shevchenko \<hidden\>
- Date: 2021-06-12 21:31:10 
- List: linux-devicetree
- Page: https://ratatoskr.run/linux-devicetree/2021/06/1412211
- Thread: https://ratatoskr.run/linux-leds/2021/06/1412200/t.md

```text
On Sun, Jun 13, 2021 at 12:13 AM Sander Vanheule [ref] wrote:
>
> Some chips have the read-only input and write-only output data registers
> aliased to the same offset. As a result it is not possible to perform
> read-modify-writes on the output values, when a line is still configured
> as input.
>
> Add a quirk for aliased data registers, and document how the regmap
> should be set up for correct operation.

I still believe that there is no issue with gpio-regmap and we don't
need any quirk there.

The issue is in the regmap APIs (implementation) itself. Hardware with
the concept of reading X / writing Y at the same offset is okay per
se. regmaps doesn't support it properly and should be fixed (amended)
in a way that you provide this kind of register description thru
regmap configuration or so.

I expressed the idea of trying to implement regmap-8250 as an example
of the support for such hardware. And OTOH that this kind of hardware
is not unusual.

-- 
With Best Regards,
Andy Shevchenko
```
