xref: /linux/drivers/usb/gadget/Kconfig (revision 196856db7c792b0f4a8213e29dbddf9acbb1e910)
1cae8dc3bSGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds#
31da177e4SLinus Torvalds# USB Gadget support on a system involves
41da177e4SLinus Torvalds#    (a) a peripheral controller, and
51da177e4SLinus Torvalds#    (b) the gadget driver using it.
61da177e4SLinus Torvalds#
71da177e4SLinus Torvalds# NOTE:  Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !!
81da177e4SLinus Torvalds#
91da177e4SLinus Torvalds#  - Host systems (like PCs) need CONFIG_USB (with "A" jacks).
101da177e4SLinus Torvalds#  - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks).
11cab00891SMatt LaPlante#  - Some systems have both kinds of controllers.
121da177e4SLinus Torvalds#
131da177e4SLinus Torvalds# With help from a special transceiver and a "Mini-AB" jack, systems with
141da177e4SLinus Torvalds# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
151da177e4SLinus Torvalds#
161da177e4SLinus Torvalds
17b75be4abSDenis Chengmenuconfig USB_GADGET
18b75be4abSDenis Cheng	tristate "USB Gadget Support"
19badf6d47SArnd Bergmann	select USB_COMMON
2086dc243cSAlan Stern	select NLS
211da177e4SLinus Torvalds	help
22b9b70170SGreg Kroah-Hartman	   USB is a host/device protocol, organized with one host (such as a
23b9b70170SGreg Kroah-Hartman	   PC) controlling up to 127 peripheral devices.
241da177e4SLinus Torvalds	   The USB hardware is asymmetric, which makes it easier to set up:
251da177e4SLinus Torvalds	   you can't connect a "to-the-host" connector to a peripheral.
261da177e4SLinus Torvalds
271da177e4SLinus Torvalds	   Linux can run in the host, or in the peripheral.  In both cases
281da177e4SLinus Torvalds	   you need a low level bus controller driver, and some software
291da177e4SLinus Torvalds	   talking to it.  Peripheral controllers are often discrete silicon,
301da177e4SLinus Torvalds	   or are integrated with the CPU in a microcontroller.  The more
31e113f29cSJules Villard	   familiar host side controllers have names like "EHCI", "OHCI",
321da177e4SLinus Torvalds	   or "UHCI", and are usually integrated into southbridges on PC
331da177e4SLinus Torvalds	   motherboards.
341da177e4SLinus Torvalds
351da177e4SLinus Torvalds	   Enable this configuration option if you want to run Linux inside
361da177e4SLinus Torvalds	   a USB peripheral device.  Configure one hardware driver for your
371da177e4SLinus Torvalds	   peripheral/device side bus controller, and a "gadget driver" for
381da177e4SLinus Torvalds	   your peripheral protocol.  (If you use modular gadget drivers,
391da177e4SLinus Torvalds	   you may configure more than one.)
401da177e4SLinus Torvalds
411da177e4SLinus Torvalds	   If in doubt, say "N" and don't enable these drivers; most people
421da177e4SLinus Torvalds	   don't have this kind of hardware (except maybe inside Linux PDAs).
431da177e4SLinus Torvalds
441da177e4SLinus Torvalds	   For more information, see <http://www.linux-usb.org/gadget> and
4505853ad6SMauro Carvalho Chehab	   the kernel documentation for this API.
461da177e4SLinus Torvalds
47b75be4abSDenis Chengif USB_GADGET
48b75be4abSDenis Cheng
4970790f63SDavid Brownellconfig USB_GADGET_DEBUG
506341e62bSChristoph Jaeger	bool "Debugging messages (DEVELOPMENT)"
5136e893d2SDavid Brownell	depends on DEBUG_KERNEL
5270790f63SDavid Brownell	help
5370790f63SDavid Brownell	   Many controller and gadget drivers will print some debugging
5470790f63SDavid Brownell	   messages if you use this option to ask for those messages.
5570790f63SDavid Brownell
5670790f63SDavid Brownell	   Avoid enabling these messages, even if you're actively
5770790f63SDavid Brownell	   debugging such a driver.  Many drivers will emit so many
5870790f63SDavid Brownell	   messages that the driver timings are affected, which will
5970790f63SDavid Brownell	   either create new failure modes or remove the one you're
6070790f63SDavid Brownell	   trying to track down.  Never enable these messages for a
6170790f63SDavid Brownell	   production build.
6270790f63SDavid Brownell
63cd108691SAndreas Larssonconfig USB_GADGET_VERBOSE
64cd108691SAndreas Larsson	bool "Verbose debugging Messages (DEVELOPMENT)"
65cd108691SAndreas Larsson	depends on USB_GADGET_DEBUG
66cd108691SAndreas Larsson	help
67cd108691SAndreas Larsson	   Many controller and gadget drivers will print verbose debugging
68cd108691SAndreas Larsson	   messages if you use this option to ask for those messages.
69cd108691SAndreas Larsson
70cd108691SAndreas Larsson	   Avoid enabling these messages, even if you're actively
71cd108691SAndreas Larsson	   debugging such a driver.  Many drivers will emit so many
72cd108691SAndreas Larsson	   messages that the driver timings are affected, which will
73cd108691SAndreas Larsson	   either create new failure modes or remove the one you're
74cd108691SAndreas Larsson	   trying to track down.  Never enable these messages for a
75cd108691SAndreas Larsson	   production build.
76cd108691SAndreas Larsson
771da177e4SLinus Torvaldsconfig USB_GADGET_DEBUG_FILES
786341e62bSChristoph Jaeger	bool "Debugging information files (DEVELOPMENT)"
7936e893d2SDavid Brownell	depends on PROC_FS
801da177e4SLinus Torvalds	help
811da177e4SLinus Torvalds	   Some of the drivers in the "gadget" framework can expose
821da177e4SLinus Torvalds	   debugging information in files such as /proc/driver/udc
831da177e4SLinus Torvalds	   (for a peripheral controller).  The information in these
841da177e4SLinus Torvalds	   files may help when you're troubleshooting or bringing up a
851da177e4SLinus Torvalds	   driver on a new board.   Enable these files by choosing "Y"
861da177e4SLinus Torvalds	   here.  If in doubt, or to conserve kernel memory, say "N".
871da177e4SLinus Torvalds
88914a3f3bSHaavard Skinnemoenconfig USB_GADGET_DEBUG_FS
896341e62bSChristoph Jaeger	bool "Debugging information files in debugfs (DEVELOPMENT)"
9036e893d2SDavid Brownell	depends on DEBUG_FS
91914a3f3bSHaavard Skinnemoen	help
92914a3f3bSHaavard Skinnemoen	   Some of the drivers in the "gadget" framework can expose
93914a3f3bSHaavard Skinnemoen	   debugging information in files under /sys/kernel/debug/.
94914a3f3bSHaavard Skinnemoen	   The information in these files may help when you're
95914a3f3bSHaavard Skinnemoen	   troubleshooting or bringing up a driver on a new board.
96914a3f3bSHaavard Skinnemoen	   Enable these files by choosing "Y" here.  If in doubt, or
97914a3f3bSHaavard Skinnemoen	   to conserve kernel memory, say "N".
98914a3f3bSHaavard Skinnemoen
9936e893d2SDavid Brownellconfig USB_GADGET_VBUS_DRAW
10036e893d2SDavid Brownell	int "Maximum VBUS Power usage (2-500 mA)"
10136e893d2SDavid Brownell	range 2 500
10236e893d2SDavid Brownell	default 2
10336e893d2SDavid Brownell	help
10436e893d2SDavid Brownell	   Some devices need to draw power from USB when they are
10536e893d2SDavid Brownell	   configured, perhaps to operate circuitry or to recharge
10636e893d2SDavid Brownell	   batteries.  This is in addition to any local power supply,
10736e893d2SDavid Brownell	   such as an AC adapter or batteries.
10836e893d2SDavid Brownell
10936e893d2SDavid Brownell	   Enter the maximum power your device draws through USB, in
11036e893d2SDavid Brownell	   milliAmperes.  The permitted range of values is 2 - 500 mA;
11136e893d2SDavid Brownell	   0 mA would be legal, but can make some hosts misbehave.
11236e893d2SDavid Brownell
11336e893d2SDavid Brownell	   This value will be used except for system-specific gadget
11436e893d2SDavid Brownell	   drivers that have more specific information.
11536e893d2SDavid Brownell
1166532c7fdSPer Forlinconfig USB_GADGET_STORAGE_NUM_BUFFERS
1176532c7fdSPer Forlin	int "Number of storage pipeline buffers"
118d8877fc7SFelipe Balbi	range 2 256
1196532c7fdSPer Forlin	default 2
1206532c7fdSPer Forlin	help
1216532c7fdSPer Forlin	   Usually 2 buffers are enough to establish a good buffering
1226532c7fdSPer Forlin	   pipeline. The number may be increased in order to compensate
1236532c7fdSPer Forlin	   for a bursty VFS behaviour. For instance there may be CPU wake up
1246532c7fdSPer Forlin	   latencies that makes the VFS to appear bursty in a system with
1256532c7fdSPer Forlin	   an CPU on-demand governor. Especially if DMA is doing IO to
1266532c7fdSPer Forlin	   offload the CPU. In this case the CPU will go into power
1276532c7fdSPer Forlin	   save often and spin up occasionally to move data within VFS.
1286532c7fdSPer Forlin	   If selecting USB_GADGET_DEBUG_FILES this value may be set by
1296532c7fdSPer Forlin	   a module parameter as well.
1306532c7fdSPer Forlin	   If unsure, say 2.
1316532c7fdSPer Forlin
132a5beaaf3SBaolin Wangconfig U_SERIAL_CONSOLE
133a5beaaf3SBaolin Wang	bool "Serial gadget console support"
134f8faa3bfSThadeu Lima de Souza Cascardo	depends on USB_U_SERIAL
135a5beaaf3SBaolin Wang	help
136a5beaaf3SBaolin Wang	   It supports the serial gadget can be used as a console.
137a5beaaf3SBaolin Wang
13890fccb52SAndrzej Pietrasiewiczsource "drivers/usb/gadget/udc/Kconfig"
1391da177e4SLinus Torvalds
1401da177e4SLinus Torvalds#
1411da177e4SLinus Torvalds# USB Gadget Drivers
1421da177e4SLinus Torvalds#
143a84d9e53SSebastian Andrzej Siewior
144a84d9e53SSebastian Andrzej Siewior# composite based drivers
145a84d9e53SSebastian Andrzej Siewiorconfig USB_LIBCOMPOSITE
146a84d9e53SSebastian Andrzej Siewior	tristate
14788af8bbeSSebastian Andrzej Siewior	select CONFIGFS_FS
148a84d9e53SSebastian Andrzej Siewior	depends on USB_GADGET
149a84d9e53SSebastian Andrzej Siewior
150ff47f594SSebastian Andrzej Siewiorconfig USB_F_ACM
151ff47f594SSebastian Andrzej Siewior	tristate
152ff47f594SSebastian Andrzej Siewior
153cf9a08aeSSebastian Andrzej Siewiorconfig USB_F_SS_LB
154cf9a08aeSSebastian Andrzej Siewior	tristate
155cf9a08aeSSebastian Andrzej Siewior
1563249ca22SSebastian Andrzej Siewiorconfig USB_U_SERIAL
1573249ca22SSebastian Andrzej Siewior	tristate
1583249ca22SSebastian Andrzej Siewior
159f1a1823fSAndrzej Pietrasiewiczconfig USB_U_ETHER
160f1a1823fSAndrzej Pietrasiewicz	tristate
161f1a1823fSAndrzej Pietrasiewicz
162eb9fecb9SRuslan Bilovolconfig USB_U_AUDIO
163eb9fecb9SRuslan Bilovol	tristate
164eb9fecb9SRuslan Bilovol
16560540ea2SAndrzej Pietrasiewiczconfig USB_F_SERIAL
16660540ea2SAndrzej Pietrasiewicz	tristate
16760540ea2SAndrzej Pietrasiewicz
1681d8fc251SAndrzej Pietrasiewiczconfig USB_F_OBEX
1691d8fc251SAndrzej Pietrasiewicz	tristate
1701d8fc251SAndrzej Pietrasiewicz
17140d133d7SAndrzej Pietrasiewiczconfig USB_F_NCM
17240d133d7SAndrzej Pietrasiewicz	tristate
17340d133d7SAndrzej Pietrasiewicz
174fee562a6SAndrzej Pietrasiewiczconfig USB_F_ECM
175fee562a6SAndrzej Pietrasiewicz	tristate
176fee562a6SAndrzej Pietrasiewicz
177fcbdf12eSAndrzej Pietrasiewiczconfig USB_F_PHONET
178fcbdf12eSAndrzej Pietrasiewicz	tristate
179fcbdf12eSAndrzej Pietrasiewicz
180b29002a1SAndrzej Pietrasiewiczconfig USB_F_EEM
181b29002a1SAndrzej Pietrasiewicz	tristate
182b29002a1SAndrzej Pietrasiewicz
1838cedba7cSAndrzej Pietrasiewiczconfig USB_F_SUBSET
1848cedba7cSAndrzej Pietrasiewicz	tristate
1858cedba7cSAndrzej Pietrasiewicz
186f466c635SAndrzej Pietrasiewiczconfig USB_F_RNDIS
187f466c635SAndrzej Pietrasiewicz	tristate
188f466c635SAndrzej Pietrasiewicz
189e5eaa0dcSAndrzej Pietrasiewiczconfig USB_F_MASS_STORAGE
190e5eaa0dcSAndrzej Pietrasiewicz	tristate
191e5eaa0dcSAndrzej Pietrasiewicz
1925920cda6SAndrzej Pietrasiewiczconfig USB_F_FS
1937b07a2a7SPaul Cercueil	select DMA_SHARED_BUFFER
1945920cda6SAndrzej Pietrasiewicz	tristate
1955920cda6SAndrzej Pietrasiewicz
1960591bc23SRuslan Bilovolconfig USB_F_UAC1
1970591bc23SRuslan Bilovol	tristate
1980591bc23SRuslan Bilovol
199d355339eSRuslan Bilovolconfig USB_F_UAC1_LEGACY
200f3a3406bSAndrzej Pietrasiewicz	tristate
201f3a3406bSAndrzej Pietrasiewicz
202f8f93d24SAndrzej Pietrasiewiczconfig USB_F_UAC2
203f8f93d24SAndrzej Pietrasiewicz	tristate
204f8f93d24SAndrzej Pietrasiewicz
2056d11ed76SAndrzej Pietrasiewiczconfig USB_F_UVC
2066d11ed76SAndrzej Pietrasiewicz	tristate
207466be4c9SMichael Grzeschik	select UVC_COMMON
2086d11ed76SAndrzej Pietrasiewicz
209b85e9de9SAndrzej Pietrasiewiczconfig USB_F_MIDI
210b85e9de9SAndrzej Pietrasiewicz	tristate
211b85e9de9SAndrzej Pietrasiewicz
2128b645922STakashi Iwaiconfig USB_F_MIDI2
2138b645922STakashi Iwai	tristate
214*6f660ffcSTakashi Iwai	select SND_UMP
215*6f660ffcSTakashi Iwai	select SND_UMP_LEGACY_RAWMIDI
2168b645922STakashi Iwai
217cb382536SAndrzej Pietrasiewiczconfig USB_F_HID
218cb382536SAndrzej Pietrasiewicz	tristate
219cb382536SAndrzej Pietrasiewicz
220b26394bdSAndrzej Pietrasiewiczconfig USB_F_PRINTER
221b26394bdSAndrzej Pietrasiewicz	tristate
222b26394bdSAndrzej Pietrasiewicz
223dc8c46a5SAndrzej Pietrasiewiczconfig USB_F_TCM
224dc8c46a5SAndrzej Pietrasiewicz	tristate
225dc8c46a5SAndrzej Pietrasiewicz
2261da177e4SLinus Torvalds# this first set of drivers all depend on bulk-capable hardware.
2271da177e4SLinus Torvalds
228d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS
229bc27f66eSRomain Izard	tristate "USB Gadget functions configurable through configfs"
230d1c02452SAndrzej Pietrasiewicz	select USB_LIBCOMPOSITE
231d1c02452SAndrzej Pietrasiewicz	help
232d1c02452SAndrzej Pietrasiewicz	  A Linux USB "gadget" can be set up through configfs.
233d1c02452SAndrzej Pietrasiewicz	  If this is the case, the USB functions (which from the host's
234d1c02452SAndrzej Pietrasiewicz	  perspective are seen as interfaces) and configurations are
235d1c02452SAndrzej Pietrasiewicz	  specified simply by creating appropriate directories in configfs.
236d1c02452SAndrzej Pietrasiewicz	  Associating functions with configurations is done by creating
237d1c02452SAndrzej Pietrasiewicz	  appropriate symbolic links.
238ecefae6dSMauro Carvalho Chehab	  For more information see Documentation/usb/gadget_configfs.rst.
239d1c02452SAndrzej Pietrasiewicz
240d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS_SERIAL
2416341e62bSChristoph Jaeger	bool "Generic serial bulk in/out"
242d1c02452SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
243d1c02452SAndrzej Pietrasiewicz	depends on TTY
244d1c02452SAndrzej Pietrasiewicz	select USB_U_SERIAL
245d1c02452SAndrzej Pietrasiewicz	select USB_F_SERIAL
246d1c02452SAndrzej Pietrasiewicz	help
247d1c02452SAndrzej Pietrasiewicz	  The function talks to the Linux-USB generic serial driver.
248d1c02452SAndrzej Pietrasiewicz
249d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS_ACM
2506341e62bSChristoph Jaeger	bool "Abstract Control Model (CDC ACM)"
251d1c02452SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
252d1c02452SAndrzej Pietrasiewicz	depends on TTY
253d1c02452SAndrzej Pietrasiewicz	select USB_U_SERIAL
254d1c02452SAndrzej Pietrasiewicz	select USB_F_ACM
255d1c02452SAndrzej Pietrasiewicz	help
256d1c02452SAndrzej Pietrasiewicz	  ACM serial link.  This function can be used to interoperate with
257d1c02452SAndrzej Pietrasiewicz	  MS-Windows hosts or with the Linux-USB "cdc-acm" driver.
258d1c02452SAndrzej Pietrasiewicz
259d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS_OBEX
2606341e62bSChristoph Jaeger	bool "Object Exchange Model (CDC OBEX)"
261d1c02452SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
262d1c02452SAndrzej Pietrasiewicz	depends on TTY
263d1c02452SAndrzej Pietrasiewicz	select USB_U_SERIAL
264d1c02452SAndrzej Pietrasiewicz	select USB_F_OBEX
265d1c02452SAndrzej Pietrasiewicz	help
266d1c02452SAndrzej Pietrasiewicz	  You will need a user space OBEX server talking to /dev/ttyGS*,
267d1c02452SAndrzej Pietrasiewicz	  since the kernel itself doesn't implement the OBEX protocol.
268d1c02452SAndrzej Pietrasiewicz
269d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS_NCM
2706341e62bSChristoph Jaeger	bool "Network Control Model (CDC NCM)"
271d1c02452SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
272d1c02452SAndrzej Pietrasiewicz	depends on NET
273d1c02452SAndrzej Pietrasiewicz	select USB_U_ETHER
274d1c02452SAndrzej Pietrasiewicz	select USB_F_NCM
275d7889c20SArnd Bergmann	select CRC32
276d1c02452SAndrzej Pietrasiewicz	help
277d1c02452SAndrzej Pietrasiewicz	  NCM is an advanced protocol for Ethernet encapsulation, allows
278d1c02452SAndrzej Pietrasiewicz	  grouping of several ethernet frames into one USB transfer and
279d1c02452SAndrzej Pietrasiewicz	  different alignment possibilities.
280d1c02452SAndrzej Pietrasiewicz
281d1c02452SAndrzej Pietrasiewiczconfig USB_CONFIGFS_ECM
2826341e62bSChristoph Jaeger	bool "Ethernet Control Model (CDC ECM)"
283d1c02452SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
284d1c02452SAndrzej Pietrasiewicz	depends on NET
285d1c02452SAndrzej Pietrasiewicz	select USB_U_ETHER
286d1c02452SAndrzej Pietrasiewicz	select USB_F_ECM
287d1c02452SAndrzej Pietrasiewicz	help
288d1c02452SAndrzej Pietrasiewicz	  The "Communication Device Class" (CDC) Ethernet Control Model.
289d1c02452SAndrzej Pietrasiewicz	  That protocol is often avoided with pure Ethernet adapters, in
290d1c02452SAndrzej Pietrasiewicz	  favor of simpler vendor-specific hardware, but is widely
291d1c02452SAndrzej Pietrasiewicz	  supported by firmware for smart network devices.
292d1c02452SAndrzej Pietrasiewicz
29302832e56SAndrzej Pietrasiewiczconfig USB_CONFIGFS_ECM_SUBSET
2946341e62bSChristoph Jaeger	bool "Ethernet Control Model (CDC ECM) subset"
29502832e56SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
29602832e56SAndrzej Pietrasiewicz	depends on NET
29702832e56SAndrzej Pietrasiewicz	select USB_U_ETHER
29802832e56SAndrzej Pietrasiewicz	select USB_F_SUBSET
29902832e56SAndrzej Pietrasiewicz	help
30002832e56SAndrzej Pietrasiewicz	  On hardware that can't implement the full protocol,
30102832e56SAndrzej Pietrasiewicz	  a simple CDC subset is used, placing fewer demands on USB.
30202832e56SAndrzej Pietrasiewicz
303b3df2faaSAndrzej Pietrasiewiczconfig USB_CONFIGFS_RNDIS
304b3df2faaSAndrzej Pietrasiewicz	bool "RNDIS"
305b3df2faaSAndrzej Pietrasiewicz	depends on USB_CONFIGFS
306b3df2faaSAndrzej Pietrasiewicz	depends on NET
307b3df2faaSAndrzej Pietrasiewicz	select USB_U_ETHER
308b3df2faaSAndrzej Pietrasiewicz	select USB_F_RNDIS
309b3df2faaSAndrzej Pietrasiewicz	help
310b3df2faaSAndrzej Pietrasiewicz	   Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
311b3df2faaSAndrzej Pietrasiewicz	   and Microsoft provides redistributable binary RNDIS drivers for
312b3df2faaSAndrzej Pietrasiewicz	   older versions of Windows.
313b3df2faaSAndrzej Pietrasiewicz
314b3df2faaSAndrzej Pietrasiewicz	   To make MS-Windows work with this, use Documentation/usb/linux.inf
315b3df2faaSAndrzej Pietrasiewicz	   as the "driver info file".  For versions of MS-Windows older than
316b3df2faaSAndrzej Pietrasiewicz	   XP, you'll need to download drivers from Microsoft's website; a URL
317b3df2faaSAndrzej Pietrasiewicz	   is given in comments found in that info file.
318b3df2faaSAndrzej Pietrasiewicz
31917b80976SAndrzej Pietrasiewiczconfig USB_CONFIGFS_EEM
32017b80976SAndrzej Pietrasiewicz	bool "Ethernet Emulation Model (EEM)"
32117b80976SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
32217b80976SAndrzej Pietrasiewicz	depends on NET
32317b80976SAndrzej Pietrasiewicz	select USB_U_ETHER
32417b80976SAndrzej Pietrasiewicz	select USB_F_EEM
325d7889c20SArnd Bergmann	select CRC32
32617b80976SAndrzej Pietrasiewicz	help
32717b80976SAndrzej Pietrasiewicz	  CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
32817b80976SAndrzej Pietrasiewicz	  and therefore can be supported by more hardware.  Technically ECM and
32917b80976SAndrzej Pietrasiewicz	  EEM are designed for different applications.  The ECM model extends
33017b80976SAndrzej Pietrasiewicz	  the network interface to the target (e.g. a USB cable modem), and the
33117b80976SAndrzej Pietrasiewicz	  EEM model is for mobile devices to communicate with hosts using
33217b80976SAndrzej Pietrasiewicz	  ethernet over USB.  For Linux gadgets, however, the interface with
33317b80976SAndrzej Pietrasiewicz	  the host is the same (a usbX device), so the differences are minimal.
33417b80976SAndrzej Pietrasiewicz
33583408745SAndrzej Pietrasiewiczconfig USB_CONFIGFS_PHONET
3366341e62bSChristoph Jaeger	bool "Phonet protocol"
33783408745SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
33883408745SAndrzej Pietrasiewicz	depends on NET
33983408745SAndrzej Pietrasiewicz	depends on PHONET
34083408745SAndrzej Pietrasiewicz	select USB_U_ETHER
34183408745SAndrzej Pietrasiewicz	select USB_F_PHONET
34283408745SAndrzej Pietrasiewicz	help
34383408745SAndrzej Pietrasiewicz	  The Phonet protocol implementation for USB device.
34483408745SAndrzej Pietrasiewicz
345ef0aa4b9SAndrzej Pietrasiewiczconfig USB_CONFIGFS_MASS_STORAGE
3466341e62bSChristoph Jaeger	bool "Mass storage"
347ef0aa4b9SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
348bc912b0dSAndrzej Pietrasiewicz	depends on BLOCK
349ef0aa4b9SAndrzej Pietrasiewicz	select USB_F_MASS_STORAGE
350ef0aa4b9SAndrzej Pietrasiewicz	help
351ef0aa4b9SAndrzej Pietrasiewicz	  The Mass Storage Gadget acts as a USB Mass Storage disk drive.
352ef0aa4b9SAndrzej Pietrasiewicz	  As its storage repository it can use a regular file or a block
353ef0aa4b9SAndrzej Pietrasiewicz	  device (in much the same way as the "loop" device driver),
354ef0aa4b9SAndrzej Pietrasiewicz	  specified as a module parameter or sysfs option.
355ef0aa4b9SAndrzej Pietrasiewicz
35625d80151SAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_LB_SS
3576341e62bSChristoph Jaeger	bool "Loopback and sourcesink function (for testing)"
358c0501f47SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
359c0501f47SAndrzej Pietrasiewicz	select USB_F_SS_LB
360c0501f47SAndrzej Pietrasiewicz	help
36125d80151SAndrzej Pietrasiewicz	  Loopback function loops back a configurable number of transfers.
36225d80151SAndrzej Pietrasiewicz	  Sourcesink function either sinks and sources bulk data.
363c0501f47SAndrzej Pietrasiewicz	  It also implements control requests, for "chapter 9" conformance.
364c0501f47SAndrzej Pietrasiewicz	  Make this be the first driver you try using on top of any new
365c0501f47SAndrzej Pietrasiewicz	  USB peripheral controller driver.  Then you can use host-side
366c0501f47SAndrzej Pietrasiewicz	  test software, like the "usbtest" driver, to put your hardware
367c0501f47SAndrzej Pietrasiewicz	  and its driver through a basic set of functional tests.
368c0501f47SAndrzej Pietrasiewicz
369b658499fSAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_FS
3706341e62bSChristoph Jaeger	bool "Function filesystem (FunctionFS)"
371b658499fSAndrzej Pietrasiewicz	depends on USB_CONFIGFS
372b658499fSAndrzej Pietrasiewicz	select USB_F_FS
373b658499fSAndrzej Pietrasiewicz	help
374b658499fSAndrzej Pietrasiewicz	  The Function Filesystem (FunctionFS) lets one create USB
375b658499fSAndrzej Pietrasiewicz	  composite functions in user space in the same way GadgetFS
376b658499fSAndrzej Pietrasiewicz	  lets one create USB gadgets in user space.  This allows creation
377b658499fSAndrzej Pietrasiewicz	  of composite gadgets such that some of the functions are
378b658499fSAndrzej Pietrasiewicz	  implemented in kernel space (for instance Ethernet, serial or
379b658499fSAndrzej Pietrasiewicz	  mass storage) and other are implemented in user space.
380b658499fSAndrzej Pietrasiewicz
3810591bc23SRuslan Bilovolconfig USB_CONFIGFS_F_UAC1
3820591bc23SRuslan Bilovol	bool "Audio Class 1.0"
3830591bc23SRuslan Bilovol	depends on USB_CONFIGFS
3840591bc23SRuslan Bilovol	depends on SND
3850591bc23SRuslan Bilovol	select USB_LIBCOMPOSITE
3860591bc23SRuslan Bilovol	select SND_PCM
3870591bc23SRuslan Bilovol	select USB_U_AUDIO
3880591bc23SRuslan Bilovol	select USB_F_UAC1
3890591bc23SRuslan Bilovol	help
3900591bc23SRuslan Bilovol	  This Audio function implements 1 AudioControl interface,
3910591bc23SRuslan Bilovol	  1 AudioStreaming Interface each for USB-OUT and USB-IN.
3920591bc23SRuslan Bilovol	  This driver doesn't expect any real Audio codec to be present
3930591bc23SRuslan Bilovol	  on the device - the audio streams are simply sinked to and
3940591bc23SRuslan Bilovol	  sourced from a virtual ALSA sound card created. The user-space
3950591bc23SRuslan Bilovol	  application may choose to do whatever it wants with the data
3960591bc23SRuslan Bilovol	  received from the USB Host and choose to provide whatever it
3970591bc23SRuslan Bilovol	  wants as audio data to the USB Host.
3980591bc23SRuslan Bilovol
399d355339eSRuslan Bilovolconfig USB_CONFIGFS_F_UAC1_LEGACY
400d355339eSRuslan Bilovol	bool "Audio Class 1.0 (legacy implementation)"
401cb0a59f5SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
402cb0a59f5SAndrzej Pietrasiewicz	depends on SND
403cb0a59f5SAndrzej Pietrasiewicz	select USB_LIBCOMPOSITE
404cb0a59f5SAndrzej Pietrasiewicz	select SND_PCM
405d355339eSRuslan Bilovol	select USB_F_UAC1_LEGACY
406cb0a59f5SAndrzej Pietrasiewicz	help
407cb0a59f5SAndrzej Pietrasiewicz	  This Audio function implements 1 AudioControl interface,
408cb0a59f5SAndrzej Pietrasiewicz	  1 AudioStreaming Interface each for USB-OUT and USB-IN.
4090591bc23SRuslan Bilovol	  This is a legacy driver and requires a real Audio codec
4100591bc23SRuslan Bilovol	  to be present on the device.
411cb0a59f5SAndrzej Pietrasiewicz
412cb0a59f5SAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_UAC2
4136341e62bSChristoph Jaeger	bool "Audio Class 2.0"
414cb0a59f5SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
415cb0a59f5SAndrzej Pietrasiewicz	depends on SND
416cb0a59f5SAndrzej Pietrasiewicz	select USB_LIBCOMPOSITE
417cb0a59f5SAndrzej Pietrasiewicz	select SND_PCM
418eb9fecb9SRuslan Bilovol	select USB_U_AUDIO
419cb0a59f5SAndrzej Pietrasiewicz	select USB_F_UAC2
420cb0a59f5SAndrzej Pietrasiewicz	help
421cb0a59f5SAndrzej Pietrasiewicz	  This Audio function is compatible with USB Audio Class
422cb0a59f5SAndrzej Pietrasiewicz	  specification 2.0. It implements 1 AudioControl interface,
423cb0a59f5SAndrzej Pietrasiewicz	  1 AudioStreaming Interface each for USB-OUT and USB-IN.
424cb0a59f5SAndrzej Pietrasiewicz	  This driver doesn't expect any real Audio codec to be present
425cb0a59f5SAndrzej Pietrasiewicz	  on the device - the audio streams are simply sinked to and
426cb0a59f5SAndrzej Pietrasiewicz	  sourced from a virtual ALSA sound card created. The user-space
427cb0a59f5SAndrzej Pietrasiewicz	  application may choose to do whatever it wants with the data
428cb0a59f5SAndrzej Pietrasiewicz	  received from the USB Host and choose to provide whatever it
429cb0a59f5SAndrzej Pietrasiewicz	  wants as audio data to the USB Host.
430cb0a59f5SAndrzej Pietrasiewicz
4316f1de344SAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_MIDI
4326341e62bSChristoph Jaeger	bool "MIDI function"
4336f1de344SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
4346f1de344SAndrzej Pietrasiewicz	depends on SND
4356f1de344SAndrzej Pietrasiewicz	select USB_LIBCOMPOSITE
4366f1de344SAndrzej Pietrasiewicz	select SND_RAWMIDI
4376f1de344SAndrzej Pietrasiewicz	select USB_F_MIDI
4386f1de344SAndrzej Pietrasiewicz	help
4396f1de344SAndrzej Pietrasiewicz	  The MIDI Function acts as a USB Audio device, with one MIDI
4406f1de344SAndrzej Pietrasiewicz	  input and one MIDI output. These MIDI jacks appear as
4416f1de344SAndrzej Pietrasiewicz	  a sound "card" in the ALSA sound system. Other MIDI
4426f1de344SAndrzej Pietrasiewicz	  connections can then be made on the gadget system, using
4436f1de344SAndrzej Pietrasiewicz	  ALSA's aconnect utility etc.
4446f1de344SAndrzej Pietrasiewicz
4458b645922STakashi Iwaiconfig USB_CONFIGFS_F_MIDI2
4468b645922STakashi Iwai	bool "MIDI 2.0 function"
4478b645922STakashi Iwai	depends on USB_CONFIGFS
4488b645922STakashi Iwai	depends on SND
4498b645922STakashi Iwai	select USB_LIBCOMPOSITE
4508b645922STakashi Iwai	select USB_F_MIDI2
4518b645922STakashi Iwai	help
4528b645922STakashi Iwai	  The MIDI 2.0 function driver provides the generic emulated
4538b645922STakashi Iwai	  USB MIDI 2.0 interface, looped back to ALSA UMP rawmidi
4548b645922STakashi Iwai	  device on the gadget host. It supports UMP 1.1 spec and
4558b645922STakashi Iwai	  responds UMP Stream messages for UMP Endpoint and Function
4568b645922STakashi Iwai	  Block information / configuration.
4578b645922STakashi Iwai
45821a9476aSAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_HID
4596341e62bSChristoph Jaeger	bool "HID function"
46021a9476aSAndrzej Pietrasiewicz	depends on USB_CONFIGFS
46121a9476aSAndrzej Pietrasiewicz	select USB_F_HID
46221a9476aSAndrzej Pietrasiewicz	help
46321a9476aSAndrzej Pietrasiewicz	  The HID function driver provides generic emulation of USB
46421a9476aSAndrzej Pietrasiewicz	  Human Interface Devices (HID).
46521a9476aSAndrzej Pietrasiewicz
466ecefae6dSMauro Carvalho Chehab	  For more information, see Documentation/usb/gadget_hid.rst.
46721a9476aSAndrzej Pietrasiewicz
46846919a23SAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_UVC
4698333d3cdSChristoph Jaeger	bool "USB Webcam function"
47046919a23SAndrzej Pietrasiewicz	depends on USB_CONFIGFS
4719958d30fSMauro Carvalho Chehab	depends on VIDEO_DEV
47246919a23SAndrzej Pietrasiewicz	depends on VIDEO_DEV
473e81e7f9aSMichael Grzeschik	select VIDEOBUF2_DMA_SG
47446919a23SAndrzej Pietrasiewicz	select VIDEOBUF2_VMALLOC
47546919a23SAndrzej Pietrasiewicz	select USB_F_UVC
47646919a23SAndrzej Pietrasiewicz	help
47746919a23SAndrzej Pietrasiewicz	  The Webcam function acts as a composite USB Audio and Video Class
47846919a23SAndrzej Pietrasiewicz	  device. It provides a userspace API to process UVC control requests
47946919a23SAndrzej Pietrasiewicz	  and stream video data to the host.
48046919a23SAndrzej Pietrasiewicz
481ee1cd515SAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_PRINTER
482ee1cd515SAndrzej Pietrasiewicz	bool "Printer function"
483ee1cd515SAndrzej Pietrasiewicz	select USB_F_PRINTER
484f4b4976bSAndrzej Pietrasiewicz	depends on USB_CONFIGFS
485ee1cd515SAndrzej Pietrasiewicz	help
486ee1cd515SAndrzej Pietrasiewicz	  The Printer function channels data between the USB host and a
487ee1cd515SAndrzej Pietrasiewicz	  userspace program driving the print engine. The user space
488ee1cd515SAndrzej Pietrasiewicz	  program reads and writes the device file /dev/g_printer<X> to
489ee1cd515SAndrzej Pietrasiewicz	  receive or send printer data. It can use ioctl calls to
490ee1cd515SAndrzej Pietrasiewicz	  the device file to get or set printer status.
491ee1cd515SAndrzej Pietrasiewicz
492ecefae6dSMauro Carvalho Chehab	  For more information, see Documentation/usb/gadget_printer.rst
493ee1cd515SAndrzej Pietrasiewicz	  which includes sample code for accessing the device file.
494ee1cd515SAndrzej Pietrasiewicz
4954bb8548dSAndrzej Pietrasiewiczconfig USB_CONFIGFS_F_TCM
4964bb8548dSAndrzej Pietrasiewicz	bool "USB Gadget Target Fabric"
4974bb8548dSAndrzej Pietrasiewicz	depends on TARGET_CORE
4984bb8548dSAndrzej Pietrasiewicz	depends on USB_CONFIGFS
4994bb8548dSAndrzej Pietrasiewicz	select USB_LIBCOMPOSITE
5004bb8548dSAndrzej Pietrasiewicz	select USB_F_TCM
5014bb8548dSAndrzej Pietrasiewicz	help
5024bb8548dSAndrzej Pietrasiewicz	  This fabric is a USB gadget component. Two USB protocols are
5034bb8548dSAndrzej Pietrasiewicz	  supported that is BBB or BOT (Bulk Only Transport) and UAS
5044bb8548dSAndrzej Pietrasiewicz	  (USB Attached SCSI). BOT is advertised on alternative
5054bb8548dSAndrzej Pietrasiewicz	  interface 0 (primary) and UAS is on alternative interface 1.
5064bb8548dSAndrzej Pietrasiewicz	  Both protocols can work on USB2.0 and USB3.0.
5074bb8548dSAndrzej Pietrasiewicz	  UAS utilizes the USB 3.0 feature called streams support.
5084bb8548dSAndrzej Pietrasiewicz
5097a9618a2SBart Van Asschesource "drivers/usb/gadget/legacy/Kconfig"
5107a9618a2SBart Van Assche
511b75be4abSDenis Chengendif # USB_GADGET
512