Hello Team,
We are trying to implement Sleep and Wakeup on our custom board, we are trying to use MCU GPIO for waking up the device from Sleep (Suspend-to-RAM (Deep Sleep)).
We have connected MCU_GPIO0_3 to an external switch on our board and we are using this to generate interrupt on device while in Deep Sleep. When we press the switch we get high to low signal on the MCU_GPIO but we observe that the device is not waking up from sleep. We have attached the changes we did in device tree.
We tried keeping the status of mcu_gpio0 node as both 'okay' and 'reserved' in device tree. but we did not get any success in waking the device from sleep.
Can you guide us how to wake up the device and let us know if any other changes need to be done for same.
+++ b/arch/arm64/boot/dts/msc/am62xx/msc-sm2s-am62x-qc-14402C1I-module.dts @@ -16,6 +16,8 @@ #include <dt-bindings/leds/common.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/net/ti-dp83867.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include "../../ti/k3-pinctrl.h" #include "../../ti/k3-am625.dtsi" / { @@ -320,6 +322,22 @@ }; }; }; */ + + mcu_gpio_key { + compatible = "gpio-keys"; + autorepeat; + pinctrl-names = "default"; + pinctrl-0 = <&wake_mcugpio1_pins_default>; + interrupt-parent = <&mcu_gpio0>; + interrupts = <03 IRQ_TYPE_EDGE_RISING>; + switch { + label = "MCUGPIO"; + linux,code = <143>; + gpios = <&mcu_gpio0 03 GPIO_ACTIVE_LOW>; + wakeup-source; + }; + }; + }; &mcu_pmx0 { @@ -359,6 +377,13 @@ AM62X_IOPAD(0x03C, PIN_OUTPUT, 0) /* (E5) MCU_MCAN1_TX */ >; }; + + wake_mcugpio1_pins_default: wake-mcugpio1-pins-default { + pinctrl-single,pins = < + AM62X_MCU_IOPAD(0x00C, PIN_INPUT, 7) /* (D9) MCU_GPIO0_03 */ + >; + }; + }; &main_pmx0 { @@ -926,6 +951,13 @@ compatible= "ricoh,r2221tl"; reg=<0x32>; }; + + tpm: st33tphf20@2e { + compatible = "st,st33htpm-i2c"; + reg = <0x2e>; + status = "okay"; + }; + }; &main_i2c3 {
Thanks,
Nilesh