I have an AOSP tree compiled on my board. 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.
I tried several ways in my bootloader (uboot), kernel, etc. But no effect. Additionally I made an experiment and found out that in the sleep state, my usb port (which has a dongle in it) has just 1-5 mA. But it should be higher for the dongle to work!
Has anyone experienced this? How to enable remote wakeup for usb in android?
Thanks
More info: The uboot supports usb host controller interface. I tweaked kernel build options. but these two actions has no effect.
EDIT : I work on p212 reference board of amlogic. Its SoC is Amlogic S905X.
EDIT 2 : I tested the board (which is a tv box actually) using my phone and its charger and I found that when the box goes to sleep, the charging is stopped!! So I can deduce that the dongle has not enough power to stay alive! (yet to send wake signal to SoC !)
Then I carried out a second experiment: I connected the phone using a USB charger which only has two pin instead of four. (Just voltage supply; differential pins (signal pins) are disconnected). The result: my phone is charging now!! It seems when the SoC is suspending, it sends a signal to USB peripherals telling them to not draw power. Am I correct? How can I configure my AOSP tree and Linux kernel and uboot bootloader to avoid happening this? Please guide me how to fix it in kernel or other parts of stack!
EDIT 3 :
I have pasted my kernel config here. I configured these options to y
but has no effect:
CONFIG_PM_RUNTIME=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_DEBUG=y
CONFIG_USB_OTG_WAKELOCK=y
CONFIG_USB_DEBUG=y
CONFIG_USB_OTG=y
Also this link is my device tree files. (in kernel. NOT uboot)
.config
file could help to debug this as well, just to check that you have configured the kernel/driver PM features in a proper way. – Agouticat /sys/bus/usb/devices/..<usb_device_ id>../power/wakeup
(I'm not sure whether this is the asctual path in your rootfs or not, but you can usefind /sys/ -name wakeup
)? – Agoutiecho enabled > ...
it writes wnabled to the file but anyway no effect happens @danlor – Jourdainlsusb -t
)? If you wonder, just enable all of them. – Agoutilsusb -t
is the same aslsusb
in android shell. @danlor .. I suspect maybe the problem is from android parts of stack (framework, ...) but not sure. Maybe it can be handled via kernel.... I need source of related information to research more on it – Jourdain