From: "Kári Davíðsson" <kari.davidsson@marel.com>
To: linuxppc-embedded@ozlabs.org
Subject: Re: External interrupt type?
Date: Sat, 15 Mar 2008 11:54:58 +0000 [thread overview]
Message-ID: <1205582098.28630.8.camel@marel2693> (raw)
In-Reply-To: <1205521536.28630.4.camel@marel2693>
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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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);
}
=20
+static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int
type)
+{
+ int irq;
+ u32 ctrl_reg;
+
+ irq =3D irq_map[virq].hwirq;
+
+ ctrl_reg =3D in_be32(&intr->ctrl);
+ ctrl_reg &=3D ~(0x3 << (22 - irq * 2)); /* Clear the old type */
+ ctrl_reg |=3D (type & 0x3) << (22 -irq * 2);
+
+ out_be32(&intr->ctrl, ctrl_reg);
+
+ return 0;
+}
+
static struct irq_chip mpc52xx_extirq_irqchip =3D {
.typename =3D " MPC52xx IRQ[0-3] ",
.mask =3D mpc52xx_extirq_mask,
.unmask =3D mpc52xx_extirq_unmask,
.ack =3D mpc52xx_extirq_ack,
+ .set_type =3D mpc52xx_extirq_set_type,
};
=20
/*
rg
kd
On Fri, 2008-03-14 at 19:05 +0000, K=C3=A1ri Dav=C3=AD=C3=B0sson wrote:
> Hello,
>=20
> I am dealing with external interrupts on an custom board of the
> mpc5200b. Kernel is 2.6.24 from kernel.org.
>=20
> 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.
>=20
> On the other hand the type is ignored and is always level interrupt
> active low.
>=20
> Is this intended behaviour?
> How can I pass in the interrupt type from the dts to the kernel?
>=20
> I need to have the interrupt as edge interrupt, rising edge type?
>=20
> rg
> kd
>=20
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
prev parent reply other threads:[~2008-03-15 11:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 19:05 External interrupt type? Kári Davíðsson
2008-03-15 11:54 ` Kári Davíðsson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1205582098.28630.8.camel@marel2693 \
--to=kari.davidsson@marel.com \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).