Sorry i miss the example code for this, This is example code in my AOSP linux kernel to enable this feature for a usb keyboard. that uses USB HID driver.
*if* (interface <http://test.zien.vn:8082/source/s?defs=interface&project=MX50_N>->desc <http://test.zien.vn:8082/source/s?defs=desc&project=MX50_N>.bInterfaceSubClass <http://test.zien.vn:8082/source/s?defs=bInterfaceSubClass&project=MX50_N> == USB_INTERFACE_SUBCLASS_BOOT <http://test.zien.vn:8082/source/s?defs=USB_INTERFACE_SUBCLASS_BOOT&project=MX50_N> && interface <http://test.zien.vn:8082/source/s?defs=interface&project=MX50_N>->desc <http://test.zien.vn:8082/source/s?defs=desc&project=MX50_N>.bInterfaceProtocol <http://test.zien.vn:8082/source/s?defs=bInterfaceProtocol&project=MX50_N> == USB_INTERFACE_PROTOCOL_KEYBOARD <http://test.zien.vn:8082/source/s?defs=USB_INTERFACE_PROTOCOL_KEYBOARD&project=MX50_N>) { usbhid_set_leds <http://test.zien.vn:8082/source/xref/MX50_N/kernel/cht/drivers/hid/usbhid/hid-core.c#usbhid_set_leds>(hid <http://test.zien.vn:8082/source/s?defs=hid&project=MX50_N>); device_set_wakeup_enable <http://test.zien.vn:8082/source/s?defs=device_set_wakeup_enable&project=MX50_N>(&dev <http://test.zien.vn:8082/source/s?defs=dev&project=MX50_N>->dev <http://test.zien.vn:8082/source/s?defs=dev&project=MX50_N>, 1); } Regards, Vu Tran Vào Th 3, 16 thg 7, 2019 vào lúc 23:19 Tranphong Vu < tranphongvu070...@gmail.com> đã viết: > Hi Mohammad Saleh Dehghanpour, > > base on your description, i think you need to enable wake up feature in > your usb wireless keyboard. > 1. Base on my hardware experience, your usb hardware should support this. > But we should confirm this > Cat proc/interrupt to get the irq number of your usb wireless device. > Let device enter suspend state > do some thing with your wireless hardware > wake up device. check the number of irq happens for your wirelese device. > If they are different it means your hardware support this go to step 2. if > not your hardware does not, > you can enable this feature. > > 2. You need to get the driver of your wireless hardware device(usb hid, > specific driver ...). dig in this . usb driver would have a Flag to > indicate that irq for this device would wake up device. > Only need to set this flag, then done. > > Regards, > Vu Tran > > Vào Th 3, 16 thg 7, 2019 vào lúc 23:08 Mohammad Saleh Dehghanpour < > salehde...@gmail.com> đã viết: > >> Hello >> >> >> 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. >> >> >> Anyone has an idea about how to handle remote wakeup for usb in android >> stack? >> >> >> 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! >> >> >> Thanks >> >> -- >> -- >> unsubscribe: android-porting+unsubscr...@googlegroups.com >> website: http://groups.google.com/group/android-porting >> >> --- >> You received this message because you are subscribed to the Google Groups >> "android-porting" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to android-porting+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/android-porting/c0d82a42-d03b-4048-b044-025a64bc19db%40googlegroups.com >> <https://groups.google.com/d/msgid/android-porting/c0d82a42-d03b-4048-b044-025a64bc19db%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting --- You received this message because you are subscribed to the Google Groups "android-porting" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/CADfFnWikQ31ehpdCgfL3Mp9QO2B5PFKjF6TbD7pT7X8Em-BtHg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.