My ultimate goal is to get the BBB to wake up from standby state on either a touch event or periodically using the internal RTC alarm (for a battery check). And I’m running into trouble getting the touchscreen wakeup action happening. I put the touchscreen’s IRQ output on GPIO0[27] and it isn’t waking up from the touchscreen, or even the RTC, if the touchscreen is hit while it’s in standby mode.
Several months ago, I had managed to prove to myself that the hardware can do it. I hacked together some code that used mmap that would directly set the appropriate bits for GPIO0[27]’s SYSCONFIG, IRQWAKEN0, LVDET0, and H2LDET registers. It was a qualified success. The BBB woke up on gpio27 transition, but a number of other necessary conditions made it a non-starter. The USB channels were in the idle state and unconnected, and I used kernel revs 4.19&4.20 instead of 5.10.65.
I have since moved up to kernel 5.10.65, to take advantage of the latest driver(s) for another unrelated accessory. It did force me to do a shut-off of all the active PWM channels, but I was otherwise successful at getting the device to enter standby mode. When I let it time out and wake from the RTC alarm, it resume. However, getting an immediate wakeup when the touchscreen showed a behavior worse than just not working. Touching the screen while waiting for the RTC alarm’s wakeup action made the standby mode permanent. It’s as if the touchscreen’s IRQ managed to unset the general wakeup trigger causing the RTC to fail to wake up.
Looking over the documentation and git history on the edt-ft5x06 driver I’m using, I’ve seen some chatter about the “wakeup-source;” device tree specifier, but adding it to the overlay had no positive effect. Adding the line “wake-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;” caused some irq based conflict errors, and took out touchscreen functionality all together.
So, my question is this:
Is It possible to get the kernel to set the AM3358 to wake up on both the RTC and GPIO0[27], or is doing so going to require a second GPIO line (if not a UART the way the 4D systems display cape does)?