mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-29 03:22:36 +00:00
When a device is enumerated by the host, its usb configuration state
changes to positively identify that it is ready to go. Conversely,
when it is powered down, its configuration state indicates that it
is no longer in that ready ('configured') state.
A side effect of the power saving for the USB peripheral would change
the device into a suspended state if it is not configured, but this
mechanism does not work reliably on the Orin AGX devkit.
Additionally, the gadget device sysfs node changed from a single
/UDC/device/gadget function to /UDC/device/gadget.# in kernels newer
than the current L4T 5.15, breaking the previous method for newer
kernels.
Use this more direct method of determining if the usb host is using
the device so it will work across various platforms as well as kernel
versions.
Signed-off-by: Kurt Kiefer <kekiefer@gmail.com>