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
if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD) { usbhid_set_leds(hid); device_set_wakeup_enable(&dev->dev, 1); }
Regards,
Vu Tran
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 thisCat proc/interrupt to get the irq number of your usb wireless device.Let device enter suspend statedo some thing with your wireless hardwarewake 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 TranVào Th 3, 16 thg 7, 2019 vào lúc 23:08 Mohammad Saleh Dehghanpour <saleh...@gmail.com> đã viết:
--
--
unsubscribe: android-porti...@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-porti...@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.
For more options, visit https://groups.google.com/d/optout.
Hello
--
Hi Tranphong Vu!
Thank you for your response.
1. I tested the "/proc/interrupts" and pasted a sample of it here:
https://paste.ubuntu.com/p/kf4TqxzBYN/
In my experiment, I found that the keyboard (which is a standard
wireless keyboard) is associated with "xhci-hcd:usb1" IRQ and the
counter increases by two for each key press. (one IRQ for key down and
one for key up which seems reasonable)
BUT the IRQ number , remains the same after suspend (i.e. 62). What is
the problem? Is it my mistake to identify correct IRQ entry?
2. The code snippet you posted was already in my AOSP tree too. I
examined that HID driver which is a well-known generic driver and I
guess the problem is not from there. (maybe I am wrong)
P.S. I also posted my problem in more details at stackoverflow at here:
https://stackoverflow.com/q/56914772/
I wish if you could take a look at it.
Thanks
Saleh
On 7/16/19, Tranphong Vu <tranphon...@gmail.com> wrote:
> 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);