usbdev: support usb adb fastboot

Enable CONFIG_USBFASTBOOT to support fastboot driver.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-07-18 15:43:21 +08:00 committed by Xiang Xiao
parent 573317cada
commit fb7c36978f
2 changed files with 18 additions and 2 deletions

View File

@ -596,6 +596,12 @@ menuconfig USBADB
if USBADB
config USBFASTBOOT
bool "USB Android Debug Bridge (FASTBOOT) support"
default n
---help---
Enables USB Android Debug Bridge (FASTBOOT) support
menuconfig USBADB_COMPOSITE
bool "USBADB composite support"
default n

View File

@ -48,7 +48,11 @@
/* FIXME use minor for char device npath */
#define USBADB_CHARDEV_PATH "/dev/adb0"
#ifdef CONFIG_USBFASTBOOT
# define USBADB_CHARDEV_PATH "/dev/fastboot"
#else
# define USBADB_CHARDEV_PATH "/dev/adb0"
#endif
/* USB Controller */
@ -98,6 +102,12 @@
#define USBADB_NCONFIGS (1)
#ifdef CONFIG_USBFASTBOOT
# define USBADB_INTERFACEPROTOCOL (3)
#else
# define USBADB_INTERFACEPROTOCOL (1)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
@ -209,7 +219,7 @@ static const struct usb_ifdesc_s g_adb_ifdesc =
.neps = 2,
.classid = USB_CLASS_VENDOR_SPEC,
.subclass = 0x42,
.protocol = 0x01,
.protocol = USBADB_INTERFACEPROTOCOL,
.iif = USBADB_INTERFACESTRID
};