usb: Use composite equipment codes as universal codes for enumeration#10084
usb: Use composite equipment codes as universal codes for enumeration#10084zyfeier wants to merge 3 commits into
Conversation
The enumeration process for composite and non-composite devices has a lot of duplicate code. Treating the code for composite devices as universal enumeration code can reduce redundant code. Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
|
I don't think coupling USB device class logic with composite device logic is a good idea. These are two separate functionalities, and device class logic should not depend on composite logic. Why not move the common USB device logic to a separate file, private for |
Hi, raiden00pl: |
|
Then composite devices and other USB devices should use common USB device logic. Now the code gives the impression that non-composite USB device is just composite device with one supported device - which is wrong and confusing. |
so @raiden00pl do you want to rename the current composite driver to a general name and let's composite driver forward the call to these common function? |
|
@xiaoxiang781216 it would actually make sense that way but composite specific functionality should be keep in the |
|
Ok, let's do it in the next step. |
Summary
The enumeration process in each class driver is similar. Extracting the common enumeration process code to composite.c can reduce redundant code. In this PR, only the adb class has been modified, and it will be applicable to all classes in the next PR.
Impact
usb enumeration
Testing
sim:usbdev and bes board