Re: [PATCH V2 RESEND 1/2] regmap: irq: Add support for interrupt type

From: Mark Brown
Date: Tue Mar 12 2013 - 15:55:54 EST


On Thu, Mar 07, 2013 at 10:03:17PM +0530, Laxman Dewangan wrote:

> /**
> + * The Regmap IRQ type Index
> + * REGMAP_IRQ_TYPE_NONE is used for setting inital value for clearing type.
> + */
> +enum {
> + REGMAP_IRQ_TYPE_NONE,
> + REGMAP_IRQ_TYPE_RISING,
> + REGMAP_IRQ_TYPE_FALLING,
> + REGMAP_IRQ_TYPE_BOTH,
> + REGMAP_IRQ_TYPE_LEVEL_HIGH,
> + REGMAP_IRQ_TYPE_LEVEL_LOW,
> +
> + /* Last entry to get maximum index */
> + REGMAP_IRQ_TYPE_NR,

Why can't we just use the normal IRQ_TYPE macros?

> + * @type_reg_sub_offset: Suboffset for type register if type mask are
> + * accomodated in the multiple register.
> + * @type_supported_flags: Supported interrupt type as per interrupt.h.
> + * All supported flags are ORed.
> + * type_mask: Type mask for getting related register bits.
> + * @type_value: The type value in array form to set value for a given flag.

This is making my head hurt, it's a bit confusing - I'm having to think
too hard to understand what all these different fields do and how they
interact. Especially type_reg_sub_offset which feels like it must be
part of a wider feature to support a greater range of register layouts.

Can you clarify a bit please?

Attachment: signature.asc
Description: Digital signature