Hi,
I am currently facing concern to manage gpio interrupt inside my device driver with device tree. It is working fine with static platform_data configuration.
My device is connected to i2c. Here is my how my node looks like:
&i2c2 {
clock-frequency = <400000>;
status = “okay”;
foo: foo@0x08 {
compatible = “foo, foo_i2c”;
reg = <0x08>;
interrupt-parent = <&gpio6>;
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
enable = <&gpio6 29 GPIO_ACTIVE_HIGH>;
};
};
In my probe function, i am able to retrieve and configure the enable gpio.
I am retrieving the interrupts with irq_of_parse_and_map(pp, 0); and the polarity with irq_get_trigger_type.
When requesting the irq with devm_request_threaded_irq, the irq goes crazy and trigger multiple interrupt for ever.
This phenomenon is not visible with following node:
&i2c2 {
clock-frequency = <400000>;
status = “okay”;
foo: foo@0x08 {
compatible = “foo, foo_i2c”;
reg = <0x08>;
irq = <&gpio6 2 IRQ_TYPE_LEVEL_LOW>;
enable = <&gpio6 29 GPIO_ACTIVE_HIGH>;
};
};
And using following sequence:
- devm_gpio_request
- gpio_direction_input
- gpio_to_irq
- devm_request_threaded_irq
gpio6 2 is gpio_130
gpio6 29 is gpio_157
Do you have any idea about what i am doing wrong ?
Best Regards
Christophe