Re: [PATCH v4 07/10] drivers: pinctrl: msm: setup GPIO irqchip hierarchy

Lina Iyer
2019-04-17T16:08:13Z

On Fri, Mar 15 2019 at 10:28 -0600, Stephen Boyd wrote:
>Quoting Lina Iyer (2019-03-13 14:18:41)
>> ---
>> Changes in v4:
>> - Remove irq_set_wake() on summary IRQ interrupt
>> Changes in v3:
>> - Use of_irq_domain_map() and pass PDC pin to parent irqdomain
>> Changes in v2:
>> - Call parent mask when masking GPIO interrupt
>> Changes in v1:
>> - Fix bug when unmasking PDC interrupt
>[...]
>> +}
>> +
>> +/*
>> + * TODO: Get rid of this and push it into gpiochip_to_irq()
>> + */
>
>Any chance this TODO can be resolved?
>

I am thinking of something like this. Would there be any issue in
setting the type to IRQ_TYPE_SENSE_MASK instead of any one particular
type?

---8<-----
static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
{
#ifdef CONFIG_OF_GPIO
struct irq_fwspec fwspec;

if (chip->of_node) {
fwspec.fwnode = of_node_to_fwnode(chip->of_node);
fwspec.param[0] = offset;
fwspec.param[1] = IRQ_TYPE_SENSE_MASK;
fwspec.param_count = 2;
return irq_create_fwspec_mapping(&fwspec);
}
#endif

if (!gpiochip_irqchip_irq_valid(chip, offset))
return -ENXIO;

return irq_create_mapping(chip->irq.domain, offset);
}
---8<----

Thanks,
Lina