Hi,
I have used GPIO pin as wake-up source in my imx6 apalis board by enabling it with the following snippet in device tree:
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_keys>;
wakeup {
label = "Wake-Up";
gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WAKEUP>;
debounce-interval = <10>;
wakeup-source;
};
};
Now I can wake up imx6 when it's in sleep by the gpio pin
I have test another scenario to generate interrupt by a gpio pin with the following snippet in the device tree:
gpio-controller;
interrupt-controller;
interrupt-parent = <&gpio1>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
Now, I want to combine these two scenarios. I want a gpio pin to act as both wake-up source and interrupt pin, i.e. when imx6 is in sleep, the interrupt will wake it up, and when it's wakeup, the interrupt acts as usual and be received by other parts such as a driver willing to receive it
Question: How can I do the above scenario?
Thanks in advance
Hi Asghar
one can try to follow gpio-keys linux documentation, wakeup-source is optional:
Best regards
igor