Hi Dehqanpour,
About 1,
I dont sure that interrupt number is increased when it happens while device
in suspend state. But i think system should record this.
About 2,
Normally android would not be wake up from bluetooth mouse. At you see in
my code example, this code is need to wake up device from usb keyboard. So
if you want to wake up device from usb wireless mouse you need to aplly
this code to your wireless mouse device.

Now i think you should confirm 1 with usb mouse. Normally usb mouse would
wake up device because original hid usb drive apply my example code for usb
mouse hid class. You can disable this feature by remove the above code for
usb mouse hid.
Then check the irq is increased or not in suspend state. If it is same with
your usb mouse you can apply code for your wireless mouse. If not i think
you need to find a method to let usb wireless mouse generate irq in suspend
state like dont power off usb wireless when device enter suspend state ...

Regards,
Vu tran

On Wed, 17 Jul 2019, 01:53 Dehqanpour, <salehde...@gmail.com> wrote:

> 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 <tranphongvu070...@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);
> >       }
> >
> >
> > 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/CADfFnWhqN7-XnpyStkaCOsP7L3CLN6hUaeXe1602EDUfwQwYgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to