AnsweredAssumed Answered

i:MX27 "request_irq" returns with error code -22

Question asked by Anees Rehman on Oct 19, 2015
Latest reply on Oct 26, 2015 by igorpadykov

Hi,

I am trying to port  a device driver from Linux kernel version 2.6.22 to kernel version 3.14.15  for i:MX27 based platform.

I am stuck with a problem the "request_irq" for gpio irq controller (irq number 24 in 3.14) returns an invalid value error

code. Although the call to request_irq returns successful when called for other gpio irq number such as irq 228.

Here is the code snippet:

 

"The device tree node where irq is  configured"

 

gpio_irq_hack {

compatible = "atlas,gpio_irq_hack";

interrupt-parent = <&aitc>;

interrupts = <8>;

interrupt-names = "irq_hack";

status = "okay";

};

 

"The driver code to register irq"

 

irq = platform_get_irq_byname (pdev, "irq_hack");

        if (irq < 0) {

                dev_err(&pdev->dev, "Couldn't register given IRQ\n");

                return -EINVAL;

        }

printk(KERN_DEBUG "gpio_irq_hack: registering IRQ %d\n", irq);

int ret = request_irq(irq, &gpio_irq_hack_handler, IRQF_TRIGGER_FALLING, "gpio_irq_hack", NULL);

if (ret) {

     printk(KERN_ERR "gpio_irq_hack: cannot register IRQ %d ret:%d\n", irq, ret);

     return -EIO;

}

 

Any suggestion how can it be fixed.

Outcomes