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
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