External interrupt type?
Kári Davíðsson
kari.davidsson at marel.com
Sat Mar 15 22:54:58 EST 2008
A quick fix with very limited testing is included....
Someone might want to try this out or at least read it over :)
But as they say.. it works for me...
Index: arch/powerpc/platforms/52xx/mpc52xx_pic.c
===================================================================
--- arch/powerpc/platforms/52xx/mpc52xx_pic.c (revision 172)
+++ arch/powerpc/platforms/52xx/mpc52xx_pic.c (working copy)
@@ -97,11 +97,28 @@
io_be_setbit(&intr->ctrl, 27-l2irq);
}
+static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int
type)
+{
+ int irq;
+ u32 ctrl_reg;
+
+ irq = irq_map[virq].hwirq;
+
+ ctrl_reg = in_be32(&intr->ctrl);
+ ctrl_reg &= ~(0x3 << (22 - irq * 2)); /* Clear the old type */
+ ctrl_reg |= (type & 0x3) << (22 -irq * 2);
+
+ out_be32(&intr->ctrl, ctrl_reg);
+
+ return 0;
+}
+
static struct irq_chip mpc52xx_extirq_irqchip = {
.typename = " MPC52xx IRQ[0-3] ",
.mask = mpc52xx_extirq_mask,
.unmask = mpc52xx_extirq_unmask,
.ack = mpc52xx_extirq_ack,
+ .set_type = mpc52xx_extirq_set_type,
};
/*
rg
kd
On Fri, 2008-03-14 at 19:05 +0000, Kári Davíðsson wrote:
> Hello,
>
> I am dealing with external interrupts on an custom board of the
> mpc5200b. Kernel is 2.6.24 from kernel.org.
>
> I can declare the interrupt in the dts for the board and the
> control register is set correctly, i.e. the correct external interrupt
> is enabled.
>
> On the other hand the type is ignored and is always level interrupt
> active low.
>
> Is this intended behaviour?
> How can I pass in the interrupt type from the dts to the kernel?
>
> I need to have the interrupt as edge interrupt, rising edge type?
>
> rg
> kd
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
More information about the Linuxppc-embedded
mailing list