Re: [PATCH 1/1] regmap: irq: handle HW using separate mask bits for edges

From: Mark Brown
Date: Wed Dec 05 2018 - 10:35:40 EST


On Tue, Dec 04, 2018 at 07:15:50PM +0100, Bartosz Golaszewski wrote:

> Let's reuse the existing type fields in struct regmap_irq to make
> regmap_irq_chip available to such HW.

I'm not sure this is ideal, it makes the interface less clear for users
especially since there's nothing in the comments in the header that
users will look at which mentions the feature.

> If the type_base and mask_base offsets are the same - assume there
> are separate bits for falling and rising edge interrupts and use
> the value previously written to the type buffer by the set_type()
> callback instead of the entire mask specified for this interrupt
> so that we only enable the requested edge interrupts.

This feels like it's very strongly tied to a specific implementation of
the feature and TBH I'm somewhat unclear on what this ends up concretely
meaning. It sounds like this hardware represents the two edges as
separate interrupts but you want to combine them into one but I can't
see exactly how the interrupt number gets mapped with your change.

Attachment: signature.asc
Description: PGP signature