This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO interrupt configuration using device tree

I face a problem when I try to configure GPIO as interrupt using Device Tree.
I connect a sensor through I2C to OMAP panda board rev A1.The linux kernel
version is 3.8. and it's booted with DT. I modified the DTS file to include
changes for I2C and as GPIO interrupt. Here it is,
-----------------------------------------------
&omap4_pmx_core {
mysensor_pins: pinmux_mysensor_pins {
         pinctrl-single,bits = <
         0xee 0x118 0xff         /* I2C4 SCL MODE 0 */
         0xf0 0x118 0xff         /* I2C4 SDA MODE 0 */
         0x1e 0x11b 0xff         /* GPIO 39  MODE 3 | PULL UP */
           >;
        };
}
mysensor@2c {
           compatible = "sample,mysensor";
           reg = <0x2c>;
           interrupt-gpio = <&gpio2 7 0>;
           interrupts = <7>;
           interrupt-parent = <&gpio2>;
};
---------------------------------------------------
I am able to do I2C read / write.However it throws warning messages when calling
request_threaded_irq from probe.There is no interrupt coming from sensor.
I could check the IRQ number as 199 which the driver gets from i2c_client in the
probe.so a valid number is passed to request_thread_irq.Here is the log.
****************************************************
NING: at drivers/bus/omap_l3_noc.c:113 l3_interrupt_handler+0x13c/0x17c()
[   32.179656] L3 custom error: MASTER:MPU TARGET:L4 PER2
[   32.179656] Modules linked in: mysensor(O+) snd_soc_omap snd_soc_omap_mcbsp
snd_soc_core regmap_spi snd_compress snd_pcm snd_timer snd soundcore snd_page_alloc
[   32.179748] [<c001b88c>] (unwind_backtrace+0x0/0xf0) from [<c0042304>]
(warn_slowpath_common+0x4c/0x6c)
[   32.179779] [<c0042304>] (warn_slowpath_common+0x4c/0x6c) from [<c00423b8>]
(warn_slowpath_fmt+0x30/0x40)
[   32.179779] [<c00423b8>] (warn_slowpath_fmt+0x30/0x40) from [<c02c556c>]
(l3_interrupt_handler+0x13c/0x17c)
[   32.179840] [<c02c556c>] (l3_interrupt_handler+0x13c/0x17c) from [<c00a0714>]
(handle_irq_event_percpu+0x5c/0x238)
[   32.179840] [<c00a0714>] (handle_irq_event_percpu+0x5c/0x238) from
[<c00a092c>] (handle_irq_event+0x3c/0x5c)
[   32.179870] [<c00a092c>] (handle_irq_event+0x3c/0x5c) from [<c00a36b0>]
(handle_fasteoi_irq+0x98/0x158)
[   32.179901] [<c00a36b0>] (handle_fasteoi_irq+0x98/0x158) from [<c00a00e0>]
(generic_handle_irq+0x20/0x30)
[   32.179931] [<c00a00e0>] (generic_handle_irq+0x20/0x30) from [<c0014608>]
(handle_IRQ+0x4c/0xb0)
[   32.179962] [<c0014608>] (handle_IRQ+0x4c/0xb0) from [<c00085a8>]
(gic_handle_irq+0x28/0x5c)
[   32.179992] [<c00085a8>] (gic_handle_irq+0x28/0x5c) from [<c04e4024>]
(__irq_svc+0x44/0x5c)
[   32.179992] Exception stack(0xeda07ce8 to 0xeda07d30)
[   32.180023] 7ce0:                   00000001 00000001 00000000 00000000
600f0113 ed92e950
[   32.180023] 7d00: ed92e950 00000000 000000c7 ed92e930 600f0113 00000000
fffffffa eda07d30
[   32.180053] 7d20: c0091b68 c04e3be4 200f0113 ffffffff
[   32.180084] [<c04e4024>] (__irq_svc+0x44/0x5c) from [<c04e3be4>]
(_raw_spin_unlock_irqrestore+0x34/0x44)
   32.180114] [<c04e3be4>] (_raw_spin_unlock_irqrestore+0x34/0x44) from
[<c00a1d0c>] (__setup_irq+0x1ac/0x440)
[   32.180114] [<c00a1d0c>] (__setup_irq+0x1ac/0x440) from [<c00a2048>]
(request_threaded_irq+0xa8/0x134)
[   32.180175] [<c00a2048>] (request_threaded_irq+0xa8/0x134) from [<bf16b6e0>]
(mysensor_probe+0x2a8/0x3b4 [ad7146])
[   32.180267] [<bf16b6e0>] (mysensor_probe+0x2a8/0x3b4 [ad7146]) from
[<c03dc868>] (i2c_device_probe+0x78/0xb8)
[   32.180297] [<c03dc868>] (i2c_device_probe+0x78/0xb8) from [<c031bbd4>]
(driver_probe_device+0x108/0x224)
[   32.180328] [<c031bbd4>] (driver_probe_device+0x108/0x224) from [<c031bd84>]
(__driver_attach+0x94/0x98)
[   32.180358] [<c031bd84>] (__driver_attach+0x94/0x98) from [<c031a2c8>]
(bus_for_each_dev+0x54/0x88)
[   32.180358] [<c031a2c8>] (bus_for_each_dev+0x54/0x88) from [<c031b2cc>]
(bus_add_driver+0xd8/0x240)
[   32.180389] [<c031b2cc>] (bus_add_driver+0xd8/0x240) from [<c031c250>]
(driver_register+0x78/0x14c)
[   32.180419] [<c031c250>] (driver_register+0x78/0x14c) from [<c03de4ec>]
(i2c_register_driver+0x2c/0xb8)
[   32.180419] [<c03de4ec>] (i2c_register_driver+0x2c/0xb8) from [<c0008768>]
(do_one_initcall+0x100/0x16c)
[   32.180450] [<c0008768>] (do_one_initcall+0x100/0x16c) from [<c009ba7c>]
(load_module+0x1aa8/0x1f4c)
[   32.180480] [<c009ba7c>] (load_module+0x1aa8/0x1f4c) from [<c009bfc8>]
(sys_init_module+0xa8/0xec)
[   32.180480] [<c009bfc8>] (sys_init_module+0xa8/0xec) from [<c0013700>]
(ret_fast_syscall+0x0/0x3c)
[   32.180511] ---[ end trace cc89917f30b58502 ]---
****************************************************
What supposed to be done to configure GPIO as interrupt in device tree?
Thanks,
- Jeyanth