Re: [PATCH 1/6] regmap-irq: Add no_status support

From: Andy Shevchenko
Date: Fri Feb 17 2023 - 13:57:52 EST


On Wed, Feb 08, 2023 at 12:18:16PM -0500, William Breathitt Gray wrote:
> Some devices lack status registers, yet expect to handle interrupts.
> Introduce a no_status flag to indicate such a configuration, where
> rather than read a status register to verify, all interrupts received
> are assumed to be active.

...

> + /* no status register so default to all active */
> + memset(data->status_buf, 0xFF,
> + chip->num_regs * sizeof(*data->status_buf));

memset32()? As we know the sizeof()...

...

> + /* no status register so default to all active */
> + d->status_buf[i] = -1;

-1 for unsigned?!
Can we simply use GENMASK() just plain value?

...

> * @status_invert: Inverted status register: cleared bits are active interrupts.
> + * @no_status: No status register: all interrupts assumed generated by device.
> * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
> *
> * @num_regs: Number of registers in each control bank.
> @@ -1630,6 +1631,7 @@ struct regmap_irq_chip {
> unsigned int clear_on_unmask:1;
> unsigned int not_fixed_stride:1;
> unsigned int status_invert:1;
> + unsigned int no_status:1;
>
> int num_regs;

Seems a bit unordered, I have just sent a patch to fix ordering of the couple
of fields and their respective kernel doc.

--
With Best Regards,
Andy Shevchenko