0

I connect the following to an Android in OTG USB mode:

  • Mouse (HID)
  • Mass storage (MSD)
  • USB to Serial port (CDC)
  • Some headsets (ADC)

When the phone goes into sleep mode, the USB does NOT send a suspend command, and does NOT go into L2 mode.

When I connect some other headphones, (ADC and HID), and the phone goes into sleep mode, the USB does send out a suspend command and the USB port does go into L2 mode.

How do I get Android's host USB to go into L2 mode when the phone goes asleep with, for example, CDC. (And yes, remote wake up is enabled in the device)

I have seen no obvious option in the CDC drivers of my target board that would tell the USB host more or other than what the ADC+HID device does. (I have source code for both)

Thanks

Adrian
  • 1
  • 3
  • What makes you think that something as legacy as serial port would know anything about power management? It may help to refer to USB protocol documents regarding supported features. – Morrison Chang Apr 27 '18 at 08:32
  • I am implementing CDC on something a bit smarter than a legacy serial port. When a PC goes to sleep, it puts the USB bus into L2 mode, no matter what is plugged into it. So I am surprised Android does so selectively depending on what USB device is plugged in. And my question I guess is two fold now: What can I do to Android to put the USB into L2 mode when going to sleep when a CDC device is plugged in? Or better, is there something in the set up of a USB CDC device I missed, to enable the this? – Adrian Apr 30 '18 at 00:03
  • Have you reached out to the board manufacturer for guidance? Just double confirming that when you are in CDC are you sure that the Android board is in host mode and not swapped via Host Negotiation Protocol in USB 2.0 or Role Swap Protocol in USB 3.0. One other suggestion is to get the datasheet for the USB chip on the Android side to see what to look for/modify in the Android kernel/USB driver. – Morrison Chang Apr 30 '18 at 02:05
  • We are the board manufacturer. Looking for an Android wide solution, so not dependant on any particular hardware. And no, the Android phone is in Host mode. As seen by a sniffer and the connection to our CDC device as well as other USB devices. – Adrian May 03 '18 at 03:10

0 Answers0