15

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)

Saleh
  • 1,819
  • 1
  • 17
  • 44
  • What board do you have? It may be a hardware limitation that your board isn't supplying the correct power to maintain the wireless receiver. – Das_Geek Jul 09 '19 at 13:02
  • May I ask the name of the board you are working on (or at least the MPU/SoC model)? – danrodlor Jul 09 '19 at 13:09
  • I work on p212 reference board of amlogic. Its SoC is Amlogic S905X and I know existing firmwares which are okay with usb remote wakeup. (So it is not a hardware limitation) Thank you @danlor – Saleh Jul 09 '19 at 15:07
  • Hi @Das_Geek . Please take a look at my second edit. Thanks (I really need help) – Saleh Jul 09 '19 at 20:33
  • Can we see your device tree (concerning usb-peripheral)? The kernel `.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. – danrodlor Jul 10 '19 at 09:12
  • Hi @danlor . Please take a look at my "EDIT 3". Thanks – Saleh Jul 10 '19 at 10:47
  • 1
    Nice, could you check the result of `cat /sys/bus/usb/devices/..../power/wakeup` (I'm not sure whether this is the asctual path in your rootfs or not, but you can use `find /sys/ -name wakeup`)? – danrodlor Jul 10 '19 at 12:13
  • It is "disabled" But when I run `echo enabled > ... ` it writes wnabled to the file but anyway no effect happens @danlor – Saleh Jul 10 '19 at 12:15
  • Have you double-checked that you enabled the right USB bus/port (`lsusb -t`)? If you wonder, just enable all of them. – danrodlor Jul 10 '19 at 12:23
  • I'm sure all of ports are enabled. (They all work as expected). Also `lsusb -t` is the same as `lsusb` 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 – Saleh Jul 10 '19 at 12:47

0 Answers0