right way to get interrupt controller register
From: Andreas Friesen <hidden>
Date: 2011-11-10 11:31:17
Hello people,
I have a little problem with the isr routine. The interrupt handler
is installed and working fine, but I can not clear the interrupt flag in
ICTL-Register.
Is that right way to get interrupt controller register ?
Thanks in advance,
Andreas Friesen
Hier is my ISR-Handler and probe functions :
static irqreturn_t mess_isr (int irq, void *data)
{
struct qxcpld_drvdata *drvdata ;
drvdata =3D (struct qxcpld_drvdata *)data ;
struct mpc52xx_intr __iomem *intr;
int i ;
u32 intr_ctrl;
=A0 =A0 =A0 =A0intr =3D drvdata->intr
=A0 =A0 =A0 =A0intr_ctrl =3D intr->ctrl ;
intr_ctrl =3D in_be32(&intr->ctrl);
intr_ctrl |=3D =A00x04000000;
out_be32 (&intr->ctrl,intr_ctrl);
=A0 =A0 =A0 // set gpio
=A0 =A0 =A0 ....
return IRQ_HANDLED;
}
/* MPC5200 device tree match tables */
static struct of_device_id mpc52xx_pic_ids[] __initdata =3D {
{ .compatible =3D "fsl,mpc5200b-pic", },
{ .compatible =3D "mpc5200-pic", },
{}
};
static int __devinit qxcpld_of_probe (struct platform_device *ofdev)
{
.....
/* Remap the necessary zones */
np =3D of_find_matching_node(NULL, mpc52xx_pic_ids);
drvdata->intr =3D of_iomap(np, 0);
if (!drvdata->intr)
panic(__FILE__ =A0": find_and_map failed on 'mpc5200-pic'. "
=A0 =A0 =A0"Check node !");
of_node_put (np);
....
/* request irq */
drvdata->mess_irq =3D irq_of_parse_and_map(ofdev->dev.of_node,0);
if (drvdata->mess_irq =3D=3D NO_IRQ ) {
dev_err (&ofdev->dev, "failed to attach interrupt\n");
goto reg_unmap ;
}
....
if ( request_irq( drvdata->mess_irq,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qxcpld_mess_isr,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0IRQF_DISABLED|IRQF_SHARED,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"qxcpld-mess-irq",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(void *)drvdata
=A0 =A0 ) ) {
dev_err(&ofdev->dev, "Can't request irq\n") ;
goto reg_unmap ;
}
...
}