Re: [PATCH v2 02/17] regmap-irq: Add get_irq_reg to support unusual register layouts

Mark Brown
2022-06-10T16:47:17Z

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

On Fri, Jun 10, 2022 at 04:40:20PM +0100, Aidan MacDonald wrote:
> Mark Brown <broonie@kernel.org> writes:
> > On Tue, Jun 07, 2022 at 04:53:09PM +0100, Aidan MacDonald wrote:

> >> - if (!chip->sub_reg_offsets || !chip->not_fixed_stride) {
> >> + if (chip->get_irq_reg) {
> >> + reg = chip->get_irq_reg(base_reg, i);
> >> + } else if (!chip->sub_reg_offsets || !chip->not_fixed_stride) {

> > It seems like it would be cleaner and clearer to refactor things so that
> > we always have a get_irq_reg() with standard chips getting given a
> > default implementation which implements the current behaviour.

> I don't think that is a good way to clean things up. I only intended
> get_irq_reg() to be a quick hack to solve a problem; in my opinion it
> would be a poor abstraction to base the API around.

I'm not sure why you are proposing this change if you are so convinced
it's a bad idea. If you want to propose a different rework go ahead,
but adding the new operation without any form of factoring out is an
issue. At first glance your suggestion looked plausible.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]