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