Re: [PATCH 2/3] irqchip: SigmaStar SSD20xD gpi
From: Linus Walleij <hidden>
Date: 2021-09-30 16:11:19
Also in:
linux-devicetree
On Thu, Sep 30, 2021 at 4:11 PM Marc Zyngier [off-list ref] wrote:
On Thu, 30 Sep 2021 14:59:24 +0100, Daniel Palmer [off-list ref] wrote:
quoted
gpioirqchip->handler = handle_bad_irq; gpioirqchip->default_type = IRQ_TYPE_NONE;Right. I have no idea why this is a requirement, and I would normally set it to whatever is the normal flow handler on this HW, but this looks like the GPIO subsystem has some expectations here. I'll let Linus comment on it.
The handle_bad_irq() as default handler is because many GPIO IRQ controllers in difference from on-chip IRQ controllers support two levels and two edges of triggers, and there is nothing "normal" (it is "general purpose" after all) so we need to defer the selection of a suitable flow handler to .set_type(). With device tree the trigger is often specified in the second cell in the DTS, so .set_type() will be called for any consumer as part of the request_irq() and the appropriate handler is set from .set_type(). In my mind this is following the DT (ACPI) usage model of allocating and initializing resources dynamically as they are requested. I don't know if this reasoning is wrong in some way, what should we do otherwise? (Confused...) Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel