USB power when suspended

Its possible to turn on usb power when VIM2 goes to sleep mode? I have usb air mouse, and cant turn device on when its suspended.

Actually, the USB power is always on even VIM2 goes into sleep mode, you can check the schematic for the details.

For Android, when the system goes into sleep mode, the CPU works as sleep mode and don’t react most external devices like USB.

It’s still possible to change the U-Boot/Bootloader wake-up strategy to achieve this feature. FYI :wink:


Hi Gouwa,
How would you change the U-Boot/Bootloader to keep USB power alive when the VIM is suspended ?

To control the USB Power/VCC5V, you can set HDMIPWR_EN:

Have fun!

Thank you.
Just tested it but found out that it keeps the hdmi alive a the same time.

My CEC auto poweroff seem to stop working when I keep the USB powered because the HDMI is still up and the TV wakes-up a few seconds after closing. I think it is normal with the schematic you posted.
Any others ways ? to just keep the usb, but not the hdmi ?

Hello. I bought a wireless keyboard and connected it to my board via usb port. I expect when the board is in the suspend state, it will wakeup by pressing a key on keyboard. But it is not so.

Do you know where can I modify the AOSP to correct this problem?


It’s impossible that USB, WiFI, BT work in deep sleep mode. BTW, you can deactivate deep sleep by modifying the file common/kernel/power/suspend.c

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 2a4fc43..bedf4d7 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -400,6 +400,9 @@ int pm_suspend(suspend_state_t state)
        int error;
+       if (1)
+               return 0;
        if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
                return -EINVAL;
1 Like

Hello, How can you control the HDMIPWR_EN to turn the USB off? I have been looking but can’t find a command to do this.

Have tried controlling the GPIOH_3 but it’s in use so I can’t control the GPIO bit.

Thanks in advance

edit: I am using a khadas vim1.4 with kernel 5.16.0-rc2