How to set USB wake-up to default enabled state

Now it has been found on Orin nx that the USB mouse cannot wake up after entering the suspend state, while the USB keyboard can wake up. After using the command to force enabled, clicking with a USB mouse can wake up. Now I want to change the default state to enabled state, which requires changing the USB register. Is there a patch or method for modifying it

Enable command:echo enabled >/sys/bus/usb/devices/1-2.3.1/power/wakeup

Sorry for the late response.

Is this still an issue to support? Any result can be shared?

Not solved yet, I haven’t found how to enable USB wakeup by default in the driver

Hi,

This is related to HID protocol. There is a if-else checking in hid driver.

hid-core.c
1152     /* Some keyboards don't work until their LEDs have been set.
1153      * Since BIOSes do set the LEDs, it must be safe for any device
1154      * that supports the keyboard boot protocol.
1155      * In addition, enable remote wakeup by default for all keyboard
1156      * devices supporting the boot protocol.
1157      */
1158     if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
1159             interface->desc.bInterfaceProtocol ==
1160                 USB_INTERFACE_PROTOCOL_KEYBOARD) {
1161         usbhid_set_leds(hid);
1162         device_set_wakeup_enable(&dev->dev, 1);
1163     }

Currently we only support keyboard with boot protocol that can wake the device.


ex:
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass  -> if this appears, then it would work.
      bInterfaceProtocol      1 Keyboard

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.