usb: new attributes implementation to enable/disable usb data

Bug: 188760285
Test: driver probe and attributes access normally
Signed-off-by: Albert Wang <[email protected]>
Change-Id: I0aec98eebff9454cdec065bb09825f6442ac013b
This commit is contained in:
Albert Wang 2021-07-02 21:06:34 +08:00 • committed by Michael Bestas
commit 082f70a89c
No known key found for this signature in database
GPG key ID: CC95044519BE6669
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,16 @@
What: /sys/class/udc/<udc name>/device/usb_data_enabled
Date: December 2020
Contact: "Ray Chi" <[email protected]>
Description:
The attribute can allow user space can check and modify
the value to enable or disable usb functionality. Therefore,
if the attritube is set to 0, USB host and USB peripheral
modes wouldn't be working.
Example:
Enable USB data functionality
# echo 1 > /sys/class/udc/.../device/usb_data_enabled
Disable USB data functionality
# echo 0 > /sys/class/udc/.../device/usb_data_enabled