[PATCH v2] irqchip/irq-mst: Support polarity configuration
Daniel Palmer
daniel at 0x0f.com
Thu Mar 11 12:33:35 GMT 2021
Hi Mark-PK.
On Thu, 11 Mar 2021 at 12:12, Mark-PK Tsai <mark-pk.tsai at mediatek.com> wrote:
> For a fiq controller, the input edge signal will be convert to level and
> keep the interrupt status until we do EOI operation.
> That means if a rising edge input if trigger the ouput line will keep high
> until we clear the interrupt status.
I think maybe the fiq is always edge triggered?
It seems like it latches on an edge and holds it's output to the GIC
high until it is reset by eoi and then only triggers again on another
edge.
I can experiment to confirm that's what it actually does for the chips I have.
Then it seems like the irq version is almost just a configurable
inverter that passes either the input signal or the inverted input
signal to the GIC.
So maybe fiq should only accept edge type interrupts and irq could
accept either?
> static int mst_irq_chip_set_type(struct irq_data *data, unsigned int type)
> {
> - if (type != IRQ_TYPE_LEVEL_LOW && type != IRQ_TYPE_LEVEL_HIGH)
> - return -EINVAL;
> -
> - if (type == IRQ_TYPE_LEVEL_LOW) {
> + if (type == IRQ_TYPE_EDGE_FALLING) {
> + mst_set_irq(data, INTC_REV_POLARITY);
> + type = IRQ_TYPE_EDGE_RISING;
> + } else if (type == IRQ_TYPE_LEVEL_LOW) {
> mst_set_irq(data, INTC_REV_POLARITY);
> type = IRQ_TYPE_LEVEL_HIGH;
> }
I think this still needs the logic to check that type is something we
can handle (not IRQ_TYPE_EDGE_BOTH) and maybe if the fiq controller
can only do edge interrupts level types should return -EINVAL?
Thanks,
Daniel
More information about the linux-arm-kernel
mailing list