i.MX8MM: Using gpio-keys to capture interrupt and send notification to userspace

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MM: Using gpio-keys to capture interrupt and send notification to userspace

537 Views
harsh1621
Contributor II

I have a pcf8575 gpio expander (16 pins) and want to get even notification of rising edge interrupt, on one of the pins, in the userspace. I have made the following device tree changes to achieve the same:

gpio-keys {
       compatible = "gpio-keys";
       status = "okay";

       back {
       label = "Back";
       gpios = <&pcf8575_h 8 GPIO_ACTIVE_HIGH>; // <---- Pin 8 to raise interrupt
       interrupt-parent = <&pcf8575_h>;                    // <------ Is this required? Kernel Docs on gpio-keys do not mention interrupt-parent as a subproperty
       interrupt = <8 IRQ_TYPE_EDGE_RISING>;   // <-------- What should be the interrupt specifier here??
       linux,code = <KEY_BACK>;
      };
};

The pcf8575 gpio controller node (which is also interrupt controller) has one IRQ Line which is configured with IRQ_TYPE_EDGE_FALLING. What interrupt specifier should I have in the gpio-keys node so that I can achieve an interrupt on Pin 8 on rising edge?

0 Kudos
0 Replies