1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# USB Gadget support on a system involves 4*4882a593Smuzhiyun# (a) a peripheral controller, and 5*4882a593Smuzhiyun# (b) the gadget driver using it. 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !! 8*4882a593Smuzhiyun# 9*4882a593Smuzhiyun# - Host systems (like PCs) need CONFIG_USB (with "A" jacks). 10*4882a593Smuzhiyun# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks). 11*4882a593Smuzhiyun# - Some systems have both kinds of controllers. 12*4882a593Smuzhiyun# 13*4882a593Smuzhiyun# With help from a special transceiver and a "Mini-AB" jack, systems with 14*4882a593Smuzhiyun# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 15*4882a593Smuzhiyun# 16*4882a593Smuzhiyun 17*4882a593Smuzhiyunmenuconfig USB_GADGET 18*4882a593Smuzhiyun tristate "USB Gadget Support" 19*4882a593Smuzhiyun select USB_COMMON 20*4882a593Smuzhiyun select NLS 21*4882a593Smuzhiyun help 22*4882a593Smuzhiyun USB is a host/device protocol, organized with one host (such as a 23*4882a593Smuzhiyun PC) controlling up to 127 peripheral devices. 24*4882a593Smuzhiyun The USB hardware is asymmetric, which makes it easier to set up: 25*4882a593Smuzhiyun you can't connect a "to-the-host" connector to a peripheral. 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun Linux can run in the host, or in the peripheral. In both cases 28*4882a593Smuzhiyun you need a low level bus controller driver, and some software 29*4882a593Smuzhiyun talking to it. Peripheral controllers are often discrete silicon, 30*4882a593Smuzhiyun or are integrated with the CPU in a microcontroller. The more 31*4882a593Smuzhiyun familiar host side controllers have names like "EHCI", "OHCI", 32*4882a593Smuzhiyun or "UHCI", and are usually integrated into southbridges on PC 33*4882a593Smuzhiyun motherboards. 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun Enable this configuration option if you want to run Linux inside 36*4882a593Smuzhiyun a USB peripheral device. Configure one hardware driver for your 37*4882a593Smuzhiyun peripheral/device side bus controller, and a "gadget driver" for 38*4882a593Smuzhiyun your peripheral protocol. (If you use modular gadget drivers, 39*4882a593Smuzhiyun you may configure more than one.) 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun If in doubt, say "N" and don't enable these drivers; most people 42*4882a593Smuzhiyun don't have this kind of hardware (except maybe inside Linux PDAs). 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun For more information, see <http://www.linux-usb.org/gadget> and 45*4882a593Smuzhiyun the kernel documentation for this API. 46*4882a593Smuzhiyun 47*4882a593Smuzhiyunif USB_GADGET 48*4882a593Smuzhiyun 49*4882a593Smuzhiyunconfig USB_GADGET_DEBUG 50*4882a593Smuzhiyun bool "Debugging messages (DEVELOPMENT)" 51*4882a593Smuzhiyun depends on DEBUG_KERNEL 52*4882a593Smuzhiyun help 53*4882a593Smuzhiyun Many controller and gadget drivers will print some debugging 54*4882a593Smuzhiyun messages if you use this option to ask for those messages. 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun Avoid enabling these messages, even if you're actively 57*4882a593Smuzhiyun debugging such a driver. Many drivers will emit so many 58*4882a593Smuzhiyun messages that the driver timings are affected, which will 59*4882a593Smuzhiyun either create new failure modes or remove the one you're 60*4882a593Smuzhiyun trying to track down. Never enable these messages for a 61*4882a593Smuzhiyun production build. 62*4882a593Smuzhiyun 63*4882a593Smuzhiyunconfig USB_GADGET_VERBOSE 64*4882a593Smuzhiyun bool "Verbose debugging Messages (DEVELOPMENT)" 65*4882a593Smuzhiyun depends on USB_GADGET_DEBUG 66*4882a593Smuzhiyun help 67*4882a593Smuzhiyun Many controller and gadget drivers will print verbose debugging 68*4882a593Smuzhiyun messages if you use this option to ask for those messages. 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun Avoid enabling these messages, even if you're actively 71*4882a593Smuzhiyun debugging such a driver. Many drivers will emit so many 72*4882a593Smuzhiyun messages that the driver timings are affected, which will 73*4882a593Smuzhiyun either create new failure modes or remove the one you're 74*4882a593Smuzhiyun trying to track down. Never enable these messages for a 75*4882a593Smuzhiyun production build. 76*4882a593Smuzhiyun 77*4882a593Smuzhiyunconfig USB_GADGET_DEBUG_FILES 78*4882a593Smuzhiyun bool "Debugging information files (DEVELOPMENT)" 79*4882a593Smuzhiyun depends on PROC_FS 80*4882a593Smuzhiyun help 81*4882a593Smuzhiyun Some of the drivers in the "gadget" framework can expose 82*4882a593Smuzhiyun debugging information in files such as /proc/driver/udc 83*4882a593Smuzhiyun (for a peripheral controller). The information in these 84*4882a593Smuzhiyun files may help when you're troubleshooting or bringing up a 85*4882a593Smuzhiyun driver on a new board. Enable these files by choosing "Y" 86*4882a593Smuzhiyun here. If in doubt, or to conserve kernel memory, say "N". 87*4882a593Smuzhiyun 88*4882a593Smuzhiyunconfig USB_GADGET_DEBUG_FS 89*4882a593Smuzhiyun bool "Debugging information files in debugfs (DEVELOPMENT)" 90*4882a593Smuzhiyun depends on DEBUG_FS 91*4882a593Smuzhiyun help 92*4882a593Smuzhiyun Some of the drivers in the "gadget" framework can expose 93*4882a593Smuzhiyun debugging information in files under /sys/kernel/debug/. 94*4882a593Smuzhiyun The information in these files may help when you're 95*4882a593Smuzhiyun troubleshooting or bringing up a driver on a new board. 96*4882a593Smuzhiyun Enable these files by choosing "Y" here. If in doubt, or 97*4882a593Smuzhiyun to conserve kernel memory, say "N". 98*4882a593Smuzhiyun 99*4882a593Smuzhiyunconfig USB_GADGET_VBUS_DRAW 100*4882a593Smuzhiyun int "Maximum VBUS Power usage (2-500 mA)" 101*4882a593Smuzhiyun range 2 500 102*4882a593Smuzhiyun default 2 103*4882a593Smuzhiyun help 104*4882a593Smuzhiyun Some devices need to draw power from USB when they are 105*4882a593Smuzhiyun configured, perhaps to operate circuitry or to recharge 106*4882a593Smuzhiyun batteries. This is in addition to any local power supply, 107*4882a593Smuzhiyun such as an AC adapter or batteries. 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun Enter the maximum power your device draws through USB, in 110*4882a593Smuzhiyun milliAmperes. The permitted range of values is 2 - 500 mA; 111*4882a593Smuzhiyun 0 mA would be legal, but can make some hosts misbehave. 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun This value will be used except for system-specific gadget 114*4882a593Smuzhiyun drivers that have more specific information. 115*4882a593Smuzhiyun 116*4882a593Smuzhiyunconfig USB_GADGET_STORAGE_NUM_BUFFERS 117*4882a593Smuzhiyun int "Number of storage pipeline buffers" 118*4882a593Smuzhiyun range 2 256 119*4882a593Smuzhiyun default 2 120*4882a593Smuzhiyun help 121*4882a593Smuzhiyun Usually 2 buffers are enough to establish a good buffering 122*4882a593Smuzhiyun pipeline. The number may be increased in order to compensate 123*4882a593Smuzhiyun for a bursty VFS behaviour. For instance there may be CPU wake up 124*4882a593Smuzhiyun latencies that makes the VFS to appear bursty in a system with 125*4882a593Smuzhiyun an CPU on-demand governor. Especially if DMA is doing IO to 126*4882a593Smuzhiyun offload the CPU. In this case the CPU will go into power 127*4882a593Smuzhiyun save often and spin up occasionally to move data within VFS. 128*4882a593Smuzhiyun If selecting USB_GADGET_DEBUG_FILES this value may be set by 129*4882a593Smuzhiyun a module parameter as well. 130*4882a593Smuzhiyun If unsure, say 2. 131*4882a593Smuzhiyun 132*4882a593Smuzhiyunconfig U_SERIAL_CONSOLE 133*4882a593Smuzhiyun bool "Serial gadget console support" 134*4882a593Smuzhiyun depends on USB_U_SERIAL 135*4882a593Smuzhiyun help 136*4882a593Smuzhiyun It supports the serial gadget can be used as a console. 137*4882a593Smuzhiyun 138*4882a593Smuzhiyunsource "drivers/usb/gadget/udc/Kconfig" 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun# 141*4882a593Smuzhiyun# USB Gadget Drivers 142*4882a593Smuzhiyun# 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun# composite based drivers 145*4882a593Smuzhiyunconfig USB_LIBCOMPOSITE 146*4882a593Smuzhiyun tristate 147*4882a593Smuzhiyun select CONFIGFS_FS 148*4882a593Smuzhiyun depends on USB_GADGET 149*4882a593Smuzhiyun 150*4882a593Smuzhiyunconfig USB_F_ACM 151*4882a593Smuzhiyun tristate 152*4882a593Smuzhiyun 153*4882a593Smuzhiyunconfig USB_F_SS_LB 154*4882a593Smuzhiyun tristate 155*4882a593Smuzhiyun 156*4882a593Smuzhiyunconfig USB_U_SERIAL 157*4882a593Smuzhiyun tristate 158*4882a593Smuzhiyun 159*4882a593Smuzhiyunconfig USB_U_ETHER 160*4882a593Smuzhiyun tristate 161*4882a593Smuzhiyun 162*4882a593Smuzhiyunconfig USB_U_AUDIO 163*4882a593Smuzhiyun tristate 164*4882a593Smuzhiyun 165*4882a593Smuzhiyunconfig USB_F_SERIAL 166*4882a593Smuzhiyun tristate 167*4882a593Smuzhiyun 168*4882a593Smuzhiyunconfig USB_F_OBEX 169*4882a593Smuzhiyun tristate 170*4882a593Smuzhiyun 171*4882a593Smuzhiyunconfig USB_F_NCM 172*4882a593Smuzhiyun tristate 173*4882a593Smuzhiyun 174*4882a593Smuzhiyunconfig USB_F_ECM 175*4882a593Smuzhiyun tristate 176*4882a593Smuzhiyun 177*4882a593Smuzhiyunconfig USB_F_PHONET 178*4882a593Smuzhiyun tristate 179*4882a593Smuzhiyun 180*4882a593Smuzhiyunconfig USB_F_EEM 181*4882a593Smuzhiyun tristate 182*4882a593Smuzhiyun 183*4882a593Smuzhiyunconfig USB_F_SUBSET 184*4882a593Smuzhiyun tristate 185*4882a593Smuzhiyun 186*4882a593Smuzhiyunconfig USB_F_RNDIS 187*4882a593Smuzhiyun tristate 188*4882a593Smuzhiyun 189*4882a593Smuzhiyunconfig USB_F_MASS_STORAGE 190*4882a593Smuzhiyun tristate 191*4882a593Smuzhiyun 192*4882a593Smuzhiyunconfig USB_F_FS 193*4882a593Smuzhiyun tristate 194*4882a593Smuzhiyun 195*4882a593Smuzhiyunconfig USB_F_UAC1 196*4882a593Smuzhiyun tristate 197*4882a593Smuzhiyun 198*4882a593Smuzhiyunconfig USB_F_UAC1_LEGACY 199*4882a593Smuzhiyun tristate 200*4882a593Smuzhiyun 201*4882a593Smuzhiyunconfig USB_F_UAC2 202*4882a593Smuzhiyun tristate 203*4882a593Smuzhiyun 204*4882a593Smuzhiyunconfig USB_F_UVC 205*4882a593Smuzhiyun tristate 206*4882a593Smuzhiyun 207*4882a593Smuzhiyunconfig USB_F_MIDI 208*4882a593Smuzhiyun tristate 209*4882a593Smuzhiyun 210*4882a593Smuzhiyunconfig USB_F_HID 211*4882a593Smuzhiyun tristate 212*4882a593Smuzhiyun 213*4882a593Smuzhiyunconfig USB_F_PRINTER 214*4882a593Smuzhiyun tristate 215*4882a593Smuzhiyun 216*4882a593Smuzhiyunconfig USB_F_TCM 217*4882a593Smuzhiyun tristate 218*4882a593Smuzhiyun 219*4882a593Smuzhiyunconfig USB_F_ACC 220*4882a593Smuzhiyun tristate 221*4882a593Smuzhiyun 222*4882a593Smuzhiyunconfig USB_F_AUDIO_SRC 223*4882a593Smuzhiyun tristate 224*4882a593Smuzhiyun 225*4882a593Smuzhiyun# this first set of drivers all depend on bulk-capable hardware. 226*4882a593Smuzhiyun 227*4882a593Smuzhiyunconfig USB_CONFIGFS 228*4882a593Smuzhiyun tristate "USB Gadget functions configurable through configfs" 229*4882a593Smuzhiyun select USB_LIBCOMPOSITE 230*4882a593Smuzhiyun help 231*4882a593Smuzhiyun A Linux USB "gadget" can be set up through configfs. 232*4882a593Smuzhiyun If this is the case, the USB functions (which from the host's 233*4882a593Smuzhiyun perspective are seen as interfaces) and configurations are 234*4882a593Smuzhiyun specified simply by creating appropriate directories in configfs. 235*4882a593Smuzhiyun Associating functions with configurations is done by creating 236*4882a593Smuzhiyun appropriate symbolic links. 237*4882a593Smuzhiyun For more information see Documentation/usb/gadget_configfs.rst. 238*4882a593Smuzhiyun 239*4882a593Smuzhiyunconfig USB_CONFIGFS_UEVENT 240*4882a593Smuzhiyun bool "Uevent notification of Gadget state" 241*4882a593Smuzhiyun depends on USB_CONFIGFS 242*4882a593Smuzhiyun help 243*4882a593Smuzhiyun Enable uevent notifications to userspace when the gadget 244*4882a593Smuzhiyun state changes. The gadget can be in any of the following 245*4882a593Smuzhiyun three states: "CONNECTED/DISCONNECTED/CONFIGURED" 246*4882a593Smuzhiyun 247*4882a593Smuzhiyunconfig USB_CONFIGFS_SERIAL 248*4882a593Smuzhiyun bool "Generic serial bulk in/out" 249*4882a593Smuzhiyun depends on USB_CONFIGFS 250*4882a593Smuzhiyun depends on TTY 251*4882a593Smuzhiyun select USB_U_SERIAL 252*4882a593Smuzhiyun select USB_F_SERIAL 253*4882a593Smuzhiyun help 254*4882a593Smuzhiyun The function talks to the Linux-USB generic serial driver. 255*4882a593Smuzhiyun 256*4882a593Smuzhiyunconfig USB_CONFIGFS_ACM 257*4882a593Smuzhiyun bool "Abstract Control Model (CDC ACM)" 258*4882a593Smuzhiyun depends on USB_CONFIGFS 259*4882a593Smuzhiyun depends on TTY 260*4882a593Smuzhiyun select USB_U_SERIAL 261*4882a593Smuzhiyun select USB_F_ACM 262*4882a593Smuzhiyun help 263*4882a593Smuzhiyun ACM serial link. This function can be used to interoperate with 264*4882a593Smuzhiyun MS-Windows hosts or with the Linux-USB "cdc-acm" driver. 265*4882a593Smuzhiyun 266*4882a593Smuzhiyunconfig USB_CONFIGFS_OBEX 267*4882a593Smuzhiyun bool "Object Exchange Model (CDC OBEX)" 268*4882a593Smuzhiyun depends on USB_CONFIGFS 269*4882a593Smuzhiyun depends on TTY 270*4882a593Smuzhiyun select USB_U_SERIAL 271*4882a593Smuzhiyun select USB_F_OBEX 272*4882a593Smuzhiyun help 273*4882a593Smuzhiyun You will need a user space OBEX server talking to /dev/ttyGS*, 274*4882a593Smuzhiyun since the kernel itself doesn't implement the OBEX protocol. 275*4882a593Smuzhiyun 276*4882a593Smuzhiyunconfig USB_CONFIGFS_NCM 277*4882a593Smuzhiyun bool "Network Control Model (CDC NCM)" 278*4882a593Smuzhiyun depends on USB_CONFIGFS 279*4882a593Smuzhiyun depends on NET 280*4882a593Smuzhiyun select USB_U_ETHER 281*4882a593Smuzhiyun select USB_F_NCM 282*4882a593Smuzhiyun select CRC32 283*4882a593Smuzhiyun help 284*4882a593Smuzhiyun NCM is an advanced protocol for Ethernet encapsulation, allows 285*4882a593Smuzhiyun grouping of several ethernet frames into one USB transfer and 286*4882a593Smuzhiyun different alignment possibilities. 287*4882a593Smuzhiyun 288*4882a593Smuzhiyunconfig USB_CONFIGFS_ECM 289*4882a593Smuzhiyun bool "Ethernet Control Model (CDC ECM)" 290*4882a593Smuzhiyun depends on USB_CONFIGFS 291*4882a593Smuzhiyun depends on NET 292*4882a593Smuzhiyun select USB_U_ETHER 293*4882a593Smuzhiyun select USB_F_ECM 294*4882a593Smuzhiyun help 295*4882a593Smuzhiyun The "Communication Device Class" (CDC) Ethernet Control Model. 296*4882a593Smuzhiyun That protocol is often avoided with pure Ethernet adapters, in 297*4882a593Smuzhiyun favor of simpler vendor-specific hardware, but is widely 298*4882a593Smuzhiyun supported by firmware for smart network devices. 299*4882a593Smuzhiyun 300*4882a593Smuzhiyunconfig USB_CONFIGFS_ECM_SUBSET 301*4882a593Smuzhiyun bool "Ethernet Control Model (CDC ECM) subset" 302*4882a593Smuzhiyun depends on USB_CONFIGFS 303*4882a593Smuzhiyun depends on NET 304*4882a593Smuzhiyun select USB_U_ETHER 305*4882a593Smuzhiyun select USB_F_SUBSET 306*4882a593Smuzhiyun help 307*4882a593Smuzhiyun On hardware that can't implement the full protocol, 308*4882a593Smuzhiyun a simple CDC subset is used, placing fewer demands on USB. 309*4882a593Smuzhiyun 310*4882a593Smuzhiyunconfig USB_CONFIGFS_RNDIS 311*4882a593Smuzhiyun bool "RNDIS" 312*4882a593Smuzhiyun depends on USB_CONFIGFS 313*4882a593Smuzhiyun depends on NET 314*4882a593Smuzhiyun select USB_U_ETHER 315*4882a593Smuzhiyun select USB_F_RNDIS 316*4882a593Smuzhiyun help 317*4882a593Smuzhiyun Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, 318*4882a593Smuzhiyun and Microsoft provides redistributable binary RNDIS drivers for 319*4882a593Smuzhiyun older versions of Windows. 320*4882a593Smuzhiyun 321*4882a593Smuzhiyun To make MS-Windows work with this, use Documentation/usb/linux.inf 322*4882a593Smuzhiyun as the "driver info file". For versions of MS-Windows older than 323*4882a593Smuzhiyun XP, you'll need to download drivers from Microsoft's website; a URL 324*4882a593Smuzhiyun is given in comments found in that info file. 325*4882a593Smuzhiyun 326*4882a593Smuzhiyunconfig USB_CONFIGFS_EEM 327*4882a593Smuzhiyun bool "Ethernet Emulation Model (EEM)" 328*4882a593Smuzhiyun depends on USB_CONFIGFS 329*4882a593Smuzhiyun depends on NET 330*4882a593Smuzhiyun select USB_U_ETHER 331*4882a593Smuzhiyun select USB_F_EEM 332*4882a593Smuzhiyun select CRC32 333*4882a593Smuzhiyun help 334*4882a593Smuzhiyun CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM 335*4882a593Smuzhiyun and therefore can be supported by more hardware. Technically ECM and 336*4882a593Smuzhiyun EEM are designed for different applications. The ECM model extends 337*4882a593Smuzhiyun the network interface to the target (e.g. a USB cable modem), and the 338*4882a593Smuzhiyun EEM model is for mobile devices to communicate with hosts using 339*4882a593Smuzhiyun ethernet over USB. For Linux gadgets, however, the interface with 340*4882a593Smuzhiyun the host is the same (a usbX device), so the differences are minimal. 341*4882a593Smuzhiyun 342*4882a593Smuzhiyunconfig USB_CONFIGFS_PHONET 343*4882a593Smuzhiyun bool "Phonet protocol" 344*4882a593Smuzhiyun depends on USB_CONFIGFS 345*4882a593Smuzhiyun depends on NET 346*4882a593Smuzhiyun depends on PHONET 347*4882a593Smuzhiyun select USB_U_ETHER 348*4882a593Smuzhiyun select USB_F_PHONET 349*4882a593Smuzhiyun help 350*4882a593Smuzhiyun The Phonet protocol implementation for USB device. 351*4882a593Smuzhiyun 352*4882a593Smuzhiyunconfig USB_CONFIGFS_MASS_STORAGE 353*4882a593Smuzhiyun bool "Mass storage" 354*4882a593Smuzhiyun depends on USB_CONFIGFS 355*4882a593Smuzhiyun depends on BLOCK 356*4882a593Smuzhiyun select USB_F_MASS_STORAGE 357*4882a593Smuzhiyun help 358*4882a593Smuzhiyun The Mass Storage Gadget acts as a USB Mass Storage disk drive. 359*4882a593Smuzhiyun As its storage repository it can use a regular file or a block 360*4882a593Smuzhiyun device (in much the same way as the "loop" device driver), 361*4882a593Smuzhiyun specified as a module parameter or sysfs option. 362*4882a593Smuzhiyun 363*4882a593Smuzhiyunconfig USB_CONFIGFS_F_LB_SS 364*4882a593Smuzhiyun bool "Loopback and sourcesink function (for testing)" 365*4882a593Smuzhiyun depends on USB_CONFIGFS 366*4882a593Smuzhiyun select USB_F_SS_LB 367*4882a593Smuzhiyun help 368*4882a593Smuzhiyun Loopback function loops back a configurable number of transfers. 369*4882a593Smuzhiyun Sourcesink function either sinks and sources bulk data. 370*4882a593Smuzhiyun It also implements control requests, for "chapter 9" conformance. 371*4882a593Smuzhiyun Make this be the first driver you try using on top of any new 372*4882a593Smuzhiyun USB peripheral controller driver. Then you can use host-side 373*4882a593Smuzhiyun test software, like the "usbtest" driver, to put your hardware 374*4882a593Smuzhiyun and its driver through a basic set of functional tests. 375*4882a593Smuzhiyun 376*4882a593Smuzhiyunconfig USB_CONFIGFS_F_FS 377*4882a593Smuzhiyun bool "Function filesystem (FunctionFS)" 378*4882a593Smuzhiyun depends on USB_CONFIGFS 379*4882a593Smuzhiyun select USB_F_FS 380*4882a593Smuzhiyun help 381*4882a593Smuzhiyun The Function Filesystem (FunctionFS) lets one create USB 382*4882a593Smuzhiyun composite functions in user space in the same way GadgetFS 383*4882a593Smuzhiyun lets one create USB gadgets in user space. This allows creation 384*4882a593Smuzhiyun of composite gadgets such that some of the functions are 385*4882a593Smuzhiyun implemented in kernel space (for instance Ethernet, serial or 386*4882a593Smuzhiyun mass storage) and other are implemented in user space. 387*4882a593Smuzhiyun 388*4882a593Smuzhiyunconfig USB_CONFIGFS_F_ACC 389*4882a593Smuzhiyun bool "Accessory gadget" 390*4882a593Smuzhiyun depends on USB_CONFIGFS 391*4882a593Smuzhiyun depends on HID=y 392*4882a593Smuzhiyun select USB_F_ACC 393*4882a593Smuzhiyun help 394*4882a593Smuzhiyun USB gadget Accessory support 395*4882a593Smuzhiyun 396*4882a593Smuzhiyunconfig USB_CONFIGFS_F_AUDIO_SRC 397*4882a593Smuzhiyun bool "Audio Source gadget" 398*4882a593Smuzhiyun depends on USB_CONFIGFS 399*4882a593Smuzhiyun depends on SND 400*4882a593Smuzhiyun select SND_PCM 401*4882a593Smuzhiyun select USB_F_AUDIO_SRC 402*4882a593Smuzhiyun help 403*4882a593Smuzhiyun USB gadget Audio Source support 404*4882a593Smuzhiyun 405*4882a593Smuzhiyunconfig USB_CONFIGFS_F_UAC1 406*4882a593Smuzhiyun bool "Audio Class 1.0" 407*4882a593Smuzhiyun depends on USB_CONFIGFS 408*4882a593Smuzhiyun depends on SND 409*4882a593Smuzhiyun select USB_LIBCOMPOSITE 410*4882a593Smuzhiyun select SND_PCM 411*4882a593Smuzhiyun select USB_U_AUDIO 412*4882a593Smuzhiyun select USB_F_UAC1 413*4882a593Smuzhiyun help 414*4882a593Smuzhiyun This Audio function implements 1 AudioControl interface, 415*4882a593Smuzhiyun 1 AudioStreaming Interface each for USB-OUT and USB-IN. 416*4882a593Smuzhiyun This driver doesn't expect any real Audio codec to be present 417*4882a593Smuzhiyun on the device - the audio streams are simply sinked to and 418*4882a593Smuzhiyun sourced from a virtual ALSA sound card created. The user-space 419*4882a593Smuzhiyun application may choose to do whatever it wants with the data 420*4882a593Smuzhiyun received from the USB Host and choose to provide whatever it 421*4882a593Smuzhiyun wants as audio data to the USB Host. 422*4882a593Smuzhiyun 423*4882a593Smuzhiyunconfig USB_CONFIGFS_F_UAC1_LEGACY 424*4882a593Smuzhiyun bool "Audio Class 1.0 (legacy implementation)" 425*4882a593Smuzhiyun depends on USB_CONFIGFS 426*4882a593Smuzhiyun depends on SND 427*4882a593Smuzhiyun select USB_LIBCOMPOSITE 428*4882a593Smuzhiyun select SND_PCM 429*4882a593Smuzhiyun select USB_F_UAC1_LEGACY 430*4882a593Smuzhiyun help 431*4882a593Smuzhiyun This Audio function implements 1 AudioControl interface, 432*4882a593Smuzhiyun 1 AudioStreaming Interface each for USB-OUT and USB-IN. 433*4882a593Smuzhiyun This is a legacy driver and requires a real Audio codec 434*4882a593Smuzhiyun to be present on the device. 435*4882a593Smuzhiyun 436*4882a593Smuzhiyunconfig USB_CONFIGFS_F_UAC2 437*4882a593Smuzhiyun bool "Audio Class 2.0" 438*4882a593Smuzhiyun depends on USB_CONFIGFS 439*4882a593Smuzhiyun depends on SND 440*4882a593Smuzhiyun select USB_LIBCOMPOSITE 441*4882a593Smuzhiyun select SND_PCM 442*4882a593Smuzhiyun select USB_U_AUDIO 443*4882a593Smuzhiyun select USB_F_UAC2 444*4882a593Smuzhiyun help 445*4882a593Smuzhiyun This Audio function is compatible with USB Audio Class 446*4882a593Smuzhiyun specification 2.0. It implements 1 AudioControl interface, 447*4882a593Smuzhiyun 1 AudioStreaming Interface each for USB-OUT and USB-IN. 448*4882a593Smuzhiyun This driver doesn't expect any real Audio codec to be present 449*4882a593Smuzhiyun on the device - the audio streams are simply sinked to and 450*4882a593Smuzhiyun sourced from a virtual ALSA sound card created. The user-space 451*4882a593Smuzhiyun application may choose to do whatever it wants with the data 452*4882a593Smuzhiyun received from the USB Host and choose to provide whatever it 453*4882a593Smuzhiyun wants as audio data to the USB Host. 454*4882a593Smuzhiyun 455*4882a593Smuzhiyunconfig USB_CONFIGFS_F_MIDI 456*4882a593Smuzhiyun bool "MIDI function" 457*4882a593Smuzhiyun depends on USB_CONFIGFS 458*4882a593Smuzhiyun depends on SND 459*4882a593Smuzhiyun select USB_LIBCOMPOSITE 460*4882a593Smuzhiyun select SND_RAWMIDI 461*4882a593Smuzhiyun select USB_F_MIDI 462*4882a593Smuzhiyun help 463*4882a593Smuzhiyun The MIDI Function acts as a USB Audio device, with one MIDI 464*4882a593Smuzhiyun input and one MIDI output. These MIDI jacks appear as 465*4882a593Smuzhiyun a sound "card" in the ALSA sound system. Other MIDI 466*4882a593Smuzhiyun connections can then be made on the gadget system, using 467*4882a593Smuzhiyun ALSA's aconnect utility etc. 468*4882a593Smuzhiyun 469*4882a593Smuzhiyunconfig USB_CONFIGFS_F_HID 470*4882a593Smuzhiyun bool "HID function" 471*4882a593Smuzhiyun depends on USB_CONFIGFS 472*4882a593Smuzhiyun select USB_F_HID 473*4882a593Smuzhiyun help 474*4882a593Smuzhiyun The HID function driver provides generic emulation of USB 475*4882a593Smuzhiyun Human Interface Devices (HID). 476*4882a593Smuzhiyun 477*4882a593Smuzhiyun For more information, see Documentation/usb/gadget_hid.rst. 478*4882a593Smuzhiyun 479*4882a593Smuzhiyunconfig USB_CONFIGFS_F_UVC 480*4882a593Smuzhiyun bool "USB Webcam function" 481*4882a593Smuzhiyun depends on USB_CONFIGFS 482*4882a593Smuzhiyun depends on VIDEO_V4L2 483*4882a593Smuzhiyun depends on VIDEO_DEV 484*4882a593Smuzhiyun select VIDEOBUF2_VMALLOC 485*4882a593Smuzhiyun select USB_F_UVC 486*4882a593Smuzhiyun help 487*4882a593Smuzhiyun The Webcam function acts as a composite USB Audio and Video Class 488*4882a593Smuzhiyun device. It provides a userspace API to process UVC control requests 489*4882a593Smuzhiyun and stream video data to the host. 490*4882a593Smuzhiyun 491*4882a593Smuzhiyunconfig USB_CONFIGFS_F_PRINTER 492*4882a593Smuzhiyun bool "Printer function" 493*4882a593Smuzhiyun select USB_F_PRINTER 494*4882a593Smuzhiyun depends on USB_CONFIGFS 495*4882a593Smuzhiyun help 496*4882a593Smuzhiyun The Printer function channels data between the USB host and a 497*4882a593Smuzhiyun userspace program driving the print engine. The user space 498*4882a593Smuzhiyun program reads and writes the device file /dev/g_printer<X> to 499*4882a593Smuzhiyun receive or send printer data. It can use ioctl calls to 500*4882a593Smuzhiyun the device file to get or set printer status. 501*4882a593Smuzhiyun 502*4882a593Smuzhiyun For more information, see Documentation/usb/gadget_printer.rst 503*4882a593Smuzhiyun which includes sample code for accessing the device file. 504*4882a593Smuzhiyun 505*4882a593Smuzhiyunconfig USB_CONFIGFS_F_TCM 506*4882a593Smuzhiyun bool "USB Gadget Target Fabric" 507*4882a593Smuzhiyun depends on TARGET_CORE 508*4882a593Smuzhiyun depends on USB_CONFIGFS 509*4882a593Smuzhiyun select USB_LIBCOMPOSITE 510*4882a593Smuzhiyun select USB_F_TCM 511*4882a593Smuzhiyun help 512*4882a593Smuzhiyun This fabric is a USB gadget component. Two USB protocols are 513*4882a593Smuzhiyun supported that is BBB or BOT (Bulk Only Transport) and UAS 514*4882a593Smuzhiyun (USB Attached SCSI). BOT is advertised on alternative 515*4882a593Smuzhiyun interface 0 (primary) and UAS is on alternative interface 1. 516*4882a593Smuzhiyun Both protocols can work on USB2.0 and USB3.0. 517*4882a593Smuzhiyun UAS utilizes the USB 3.0 feature called streams support. 518*4882a593Smuzhiyun 519*4882a593Smuzhiyunsource "drivers/usb/gadget/legacy/Kconfig" 520*4882a593Smuzhiyun 521*4882a593Smuzhiyunendif # USB_GADGET 522