right way to get interrupt controller register
Andreas Friesen
ndrs.frsn at googlemail.com
Thu Nov 10 22:31:13 EST 2011
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 = (struct qxcpld_drvdata *)data ;
struct mpc52xx_intr __iomem *intr;
int i ;
u32 intr_ctrl;
intr = drvdata->intr
intr_ctrl = intr->ctrl ;
intr_ctrl = in_be32(&intr->ctrl);
intr_ctrl |= 0x04000000;
out_be32 (&intr->ctrl,intr_ctrl);
// set gpio
....
return IRQ_HANDLED;
}
/* MPC5200 device tree match tables */
static struct of_device_id mpc52xx_pic_ids[] __initdata = {
{ .compatible = "fsl,mpc5200b-pic", },
{ .compatible = "mpc5200-pic", },
{}
};
static int __devinit qxcpld_of_probe (struct platform_device *ofdev)
{
.....
/* Remap the necessary zones */
np = of_find_matching_node(NULL, mpc52xx_pic_ids);
drvdata->intr = of_iomap(np, 0);
if (!drvdata->intr)
panic(__FILE__ ": find_and_map failed on 'mpc5200-pic'. "
"Check node !");
of_node_put (np);
....
/* request irq */
drvdata->mess_irq = irq_of_parse_and_map(ofdev->dev.of_node,0);
if (drvdata->mess_irq == NO_IRQ ) {
dev_err (&ofdev->dev, "failed to attach interrupt\n");
goto reg_unmap ;
}
....
if ( request_irq( drvdata->mess_irq,
qxcpld_mess_isr,
IRQF_DISABLED|IRQF_SHARED,
"qxcpld-mess-irq",
(void *)drvdata
) ) {
dev_err(&ofdev->dev, "Can't request irq\n") ;
goto reg_unmap ;
}
...
}
More information about the Linuxppc-dev
mailing list