xref: /openbmc/linux/drivers/usb/gadget/legacy/Kconfig (revision 00240714)
1#
2# USB Gadget support on a system involves
3#    (a) a peripheral controller, and
4#    (b) the gadget driver using it.
5#
6# NOTE:  Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !!
7#
8#  - Host systems (like PCs) need CONFIG_USB (with "A" jacks).
9#  - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks).
10#  - Some systems have both kinds of controllers.
11#
12# With help from a special transceiver and a "Mini-AB" jack, systems with
13# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
14#
15
16config USB_ZERO
17	tristate "Gadget Zero (DEVELOPMENT)"
18	select USB_LIBCOMPOSITE
19	select USB_F_SS_LB
20	help
21	  Gadget Zero is a two-configuration device.  It either sinks and
22	  sources bulk data; or it loops back a configurable number of
23	  transfers.  It also implements control requests, for "chapter 9"
24	  conformance.  The driver needs only two bulk-capable endpoints, so
25	  it can work on top of most device-side usb controllers.  It's
26	  useful for testing, and is also a working example showing how
27	  USB "gadget drivers" can be written.
28
29	  Make this be the first driver you try using on top of any new
30	  USB peripheral controller driver.  Then you can use host-side
31	  test software, like the "usbtest" driver, to put your hardware
32	  and its driver through a basic set of functional tests.
33
34	  Gadget Zero also works with the host-side "usb-skeleton" driver,
35	  and with many kinds of host-side test software.  You may need
36	  to tweak product and vendor IDs before host software knows about
37	  this device, and arrange to select an appropriate configuration.
38
39	  Say "y" to link the driver statically, or "m" to build a
40	  dynamically linked module called "g_zero".
41
42config USB_ZERO_HNPTEST
43	bool "HNP Test Device"
44	depends on USB_ZERO && USB_OTG
45	help
46	  You can configure this device to enumerate using the device
47	  identifiers of the USB-OTG test device.  That means that when
48	  this gadget connects to another OTG device, with this one using
49	  the "B-Peripheral" role, that device will use HNP to let this
50	  one serve as the USB host instead (in the "B-Host" role).
51
52config USB_AUDIO
53	tristate "Audio Gadget"
54	depends on SND
55	select USB_LIBCOMPOSITE
56	select SND_PCM
57	select USB_F_UAC1 if GADGET_UAC1
58	select USB_F_UAC2 if !GADGET_UAC1
59	help
60	  This Gadget Audio driver is compatible with USB Audio Class
61	  specification 2.0. It implements 1 AudioControl interface,
62	  1 AudioStreaming Interface each for USB-OUT and USB-IN.
63	  Number of channels, sample rate and sample size can be
64	  specified as module parameters.
65	  This driver doesn't expect any real Audio codec to be present
66	  on the device - the audio streams are simply sinked to and
67	  sourced from a virtual ALSA sound card created. The user-space
68	  application may choose to do whatever it wants with the data
69	  received from the USB Host and choose to provide whatever it
70	  wants as audio data to the USB Host.
71
72	  Say "y" to link the driver statically, or "m" to build a
73	  dynamically linked module called "g_audio".
74
75config GADGET_UAC1
76	bool "UAC 1.0 (Legacy)"
77	depends on USB_AUDIO
78	help
79	  If you instead want older UAC Spec-1.0 driver that also has audio
80	  paths hardwired to the Audio codec chip on-board and doesn't work
81	  without one.
82
83config USB_ETH
84	tristate "Ethernet Gadget (with CDC Ethernet support)"
85	depends on NET
86	select USB_LIBCOMPOSITE
87	select USB_U_ETHER
88	select USB_F_ECM
89	select USB_F_SUBSET
90	select CRC32
91	help
92	  This driver implements Ethernet style communication, in one of
93	  several ways:
94
95	   - The "Communication Device Class" (CDC) Ethernet Control Model.
96	     That protocol is often avoided with pure Ethernet adapters, in
97	     favor of simpler vendor-specific hardware, but is widely
98	     supported by firmware for smart network devices.
99
100	   - On hardware can't implement that protocol, a simple CDC subset
101	     is used, placing fewer demands on USB.
102
103	   - CDC Ethernet Emulation Model (EEM) is a newer standard that has
104	     a simpler interface that can be used by more USB hardware.
105
106	  RNDIS support is an additional option, more demanding than than
107	  subset.
108
109	  Within the USB device, this gadget driver exposes a network device
110	  "usbX", where X depends on what other networking devices you have.
111	  Treat it like a two-node Ethernet link:  host, and gadget.
112
113	  The Linux-USB host-side "usbnet" driver interoperates with this
114	  driver, so that deep I/O queues can be supported.  On 2.4 kernels,
115	  use "CDCEther" instead, if you're using the CDC option. That CDC
116	  mode should also interoperate with standard CDC Ethernet class
117	  drivers on other host operating systems.
118
119	  Say "y" to link the driver statically, or "m" to build a
120	  dynamically linked module called "g_ether".
121
122config USB_ETH_RNDIS
123	bool "RNDIS support"
124	depends on USB_ETH
125	select USB_LIBCOMPOSITE
126	select USB_F_RNDIS
127	default y
128	help
129	   Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
130	   and Microsoft provides redistributable binary RNDIS drivers for
131	   older versions of Windows.
132
133	   If you say "y" here, the Ethernet gadget driver will try to provide
134	   a second device configuration, supporting RNDIS to talk to such
135	   Microsoft USB hosts.
136
137	   To make MS-Windows work with this, use Documentation/usb/linux.inf
138	   as the "driver info file".  For versions of MS-Windows older than
139	   XP, you'll need to download drivers from Microsoft's website; a URL
140	   is given in comments found in that info file.
141
142config USB_ETH_EEM
143       bool "Ethernet Emulation Model (EEM) support"
144       depends on USB_ETH
145	select USB_LIBCOMPOSITE
146	select USB_F_EEM
147       default n
148       help
149         CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
150         and therefore can be supported by more hardware.  Technically ECM and
151         EEM are designed for different applications.  The ECM model extends
152         the network interface to the target (e.g. a USB cable modem), and the
153         EEM model is for mobile devices to communicate with hosts using
154         ethernet over USB.  For Linux gadgets, however, the interface with
155         the host is the same (a usbX device), so the differences are minimal.
156
157         If you say "y" here, the Ethernet gadget driver will use the EEM
158         protocol rather than ECM.  If unsure, say "n".
159
160config USB_G_NCM
161	tristate "Network Control Model (NCM) support"
162	depends on NET
163	select USB_LIBCOMPOSITE
164	select USB_U_ETHER
165	select USB_F_NCM
166	select CRC32
167	help
168	  This driver implements USB CDC NCM subclass standard. NCM is
169	  an advanced protocol for Ethernet encapsulation, allows grouping
170	  of several ethernet frames into one USB transfer and different
171	  alignment possibilities.
172
173	  Say "y" to link the driver statically, or "m" to build a
174	  dynamically linked module called "g_ncm".
175
176config USB_GADGETFS
177	tristate "Gadget Filesystem"
178	help
179	  This driver provides a filesystem based API that lets user mode
180	  programs implement a single-configuration USB device, including
181	  endpoint I/O and control requests that don't relate to enumeration.
182	  All endpoints, transfer speeds, and transfer types supported by
183	  the hardware are available, through read() and write() calls.
184
185	  Say "y" to link the driver statically, or "m" to build a
186	  dynamically linked module called "gadgetfs".
187
188config USB_FUNCTIONFS
189	tristate "Function Filesystem"
190	select USB_LIBCOMPOSITE
191	select USB_F_FS
192	select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS)
193	help
194	  The Function Filesystem (FunctionFS) lets one create USB
195	  composite functions in user space in the same way GadgetFS
196	  lets one create USB gadgets in user space.  This allows creation
197	  of composite gadgets such that some of the functions are
198	  implemented in kernel space (for instance Ethernet, serial or
199	  mass storage) and other are implemented in user space.
200
201	  If you say "y" or "m" here you will be able what kind of
202	  configurations the gadget will provide.
203
204	  Say "y" to link the driver statically, or "m" to build
205	  a dynamically linked module called "g_ffs".
206
207config USB_FUNCTIONFS_ETH
208	bool "Include configuration with CDC ECM (Ethernet)"
209	depends on USB_FUNCTIONFS && NET
210	select USB_U_ETHER
211	select USB_F_ECM
212	select USB_F_SUBSET
213	help
214	  Include a configuration with CDC ECM function (Ethernet) and the
215	  Function Filesystem.
216
217config USB_FUNCTIONFS_RNDIS
218	bool "Include configuration with RNDIS (Ethernet)"
219	depends on USB_FUNCTIONFS && NET
220	select USB_U_ETHER
221	select USB_F_RNDIS
222	help
223	  Include a configuration with RNDIS function (Ethernet) and the Filesystem.
224
225config USB_FUNCTIONFS_GENERIC
226	bool "Include 'pure' configuration"
227	depends on USB_FUNCTIONFS
228	help
229	  Include a configuration with the Function Filesystem alone with
230	  no Ethernet interface.
231
232config USB_MASS_STORAGE
233	tristate "Mass Storage Gadget"
234	depends on BLOCK
235	select USB_LIBCOMPOSITE
236	select USB_F_MASS_STORAGE
237	help
238	  The Mass Storage Gadget acts as a USB Mass Storage disk drive.
239	  As its storage repository it can use a regular file or a block
240	  device (in much the same way as the "loop" device driver),
241	  specified as a module parameter or sysfs option.
242
243	  This driver is a replacement for now removed File-backed
244	  Storage Gadget (g_file_storage).
245
246	  Say "y" to link the driver statically, or "m" to build
247	  a dynamically linked module called "g_mass_storage".
248
249config USB_GADGET_TARGET
250	tristate "USB Gadget Target Fabric Module"
251	depends on TARGET_CORE
252	select USB_LIBCOMPOSITE
253	select USB_F_TCM
254	help
255	  This fabric is an USB gadget. Two USB protocols are supported that is
256	  BBB or BOT (Bulk Only Transport) and UAS (USB Attached SCSI). BOT is
257	  advertised on alternative interface 0 (primary) and UAS is on
258	  alternative interface 1. Both protocols can work on USB2.0 and USB3.0.
259	  UAS utilizes the USB 3.0 feature called streams support.
260
261config USB_G_SERIAL
262	tristate "Serial Gadget (with CDC ACM and CDC OBEX support)"
263	depends on TTY
264	select USB_U_SERIAL
265	select USB_F_ACM
266	select USB_F_SERIAL
267	select USB_F_OBEX
268	select USB_LIBCOMPOSITE
269	help
270	  The Serial Gadget talks to the Linux-USB generic serial driver.
271	  This driver supports a CDC-ACM module option, which can be used
272	  to interoperate with MS-Windows hosts or with the Linux-USB
273	  "cdc-acm" driver.
274
275	  This driver also supports a CDC-OBEX option.  You will need a
276	  user space OBEX server talking to /dev/ttyGS*, since the kernel
277	  itself doesn't implement the OBEX protocol.
278
279	  Say "y" to link the driver statically, or "m" to build a
280	  dynamically linked module called "g_serial".
281
282	  For more information, see Documentation/usb/gadget_serial.txt
283	  which includes instructions and a "driver info file" needed to
284	  make MS-Windows work with CDC ACM.
285
286config USB_MIDI_GADGET
287	tristate "MIDI Gadget"
288	depends on SND
289	select USB_LIBCOMPOSITE
290	select SND_RAWMIDI
291	select USB_F_MIDI
292	help
293	  The MIDI Gadget acts as a USB Audio device, with one MIDI
294	  input and one MIDI output. These MIDI jacks appear as
295	  a sound "card" in the ALSA sound system. Other MIDI
296	  connections can then be made on the gadget system, using
297	  ALSA's aconnect utility etc.
298
299	  Say "y" to link the driver statically, or "m" to build a
300	  dynamically linked module called "g_midi".
301
302config USB_G_PRINTER
303	tristate "Printer Gadget"
304	select USB_LIBCOMPOSITE
305	select USB_F_PRINTER
306	help
307	  The Printer Gadget channels data between the USB host and a
308	  userspace program driving the print engine. The user space
309	  program reads and writes the device file /dev/g_printer to
310	  receive or send printer data. It can use ioctl calls to
311	  the device file to get or set printer status.
312
313	  Say "y" to link the driver statically, or "m" to build a
314	  dynamically linked module called "g_printer".
315
316	  For more information, see Documentation/usb/gadget_printer.txt
317	  which includes sample code for accessing the device file.
318
319if TTY
320
321config USB_CDC_COMPOSITE
322	tristate "CDC Composite Device (Ethernet and ACM)"
323	depends on NET
324	select USB_LIBCOMPOSITE
325	select USB_U_SERIAL
326	select USB_U_ETHER
327	select USB_F_ACM
328	select USB_F_ECM
329	help
330	  This driver provides two functions in one configuration:
331	  a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link.
332
333	  This driver requires four bulk and two interrupt endpoints,
334	  plus the ability to handle altsettings.  Not all peripheral
335	  controllers are that capable.
336
337	  Say "y" to link the driver statically, or "m" to build a
338	  dynamically linked module.
339
340config USB_G_NOKIA
341	tristate "Nokia composite gadget"
342	depends on PHONET
343	depends on BLOCK
344	select USB_LIBCOMPOSITE
345	select USB_U_SERIAL
346	select USB_U_ETHER
347	select USB_F_ACM
348	select USB_F_OBEX
349	select USB_F_PHONET
350	select USB_F_ECM
351	select USB_F_MASS_STORAGE
352	help
353	  The Nokia composite gadget provides support for acm, obex
354	  and phonet in only one composite gadget driver.
355
356	  It's only really useful for N900 hardware. If you're building
357	  a kernel for N900, say Y or M here. If unsure, say N.
358
359config USB_G_ACM_MS
360	tristate "CDC Composite Device (ACM and mass storage)"
361	depends on BLOCK
362	select USB_LIBCOMPOSITE
363	select USB_U_SERIAL
364	select USB_F_ACM
365	select USB_F_MASS_STORAGE
366	help
367	  This driver provides two functions in one configuration:
368	  a mass storage, and a CDC ACM (serial port) link.
369
370	  Say "y" to link the driver statically, or "m" to build a
371	  dynamically linked module called "g_acm_ms".
372
373config USB_G_MULTI
374	tristate "Multifunction Composite Gadget"
375	depends on BLOCK && NET
376	select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS
377	select USB_LIBCOMPOSITE
378	select USB_U_SERIAL
379	select USB_U_ETHER
380	select USB_F_ACM
381	select USB_F_MASS_STORAGE
382	help
383	  The Multifunction Composite Gadget provides Ethernet (RNDIS
384	  and/or CDC Ethernet), mass storage and ACM serial link
385	  interfaces.
386
387	  You will be asked to choose which of the two configurations is
388	  to be available in the gadget.  At least one configuration must
389	  be chosen to make the gadget usable.  Selecting more than one
390	  configuration will prevent Windows from automatically detecting
391	  the gadget as a composite gadget, so an INF file will be needed to
392	  use the gadget.
393
394	  Say "y" to link the driver statically, or "m" to build a
395	  dynamically linked module called "g_multi".
396
397config USB_G_MULTI_RNDIS
398	bool "RNDIS + CDC Serial + Storage configuration"
399	depends on USB_G_MULTI
400	select USB_F_RNDIS
401	default y
402	help
403	  This option enables a configuration with RNDIS, CDC Serial and
404	  Mass Storage functions available in the Multifunction Composite
405	  Gadget.  This is the configuration dedicated for Windows since RNDIS
406	  is Microsoft's protocol.
407
408	  If unsure, say "y".
409
410config USB_G_MULTI_CDC
411	bool "CDC Ethernet + CDC Serial + Storage configuration"
412	depends on USB_G_MULTI
413	default n
414	select USB_F_ECM
415	help
416	  This option enables a configuration with CDC Ethernet (ECM), CDC
417	  Serial and Mass Storage functions available in the Multifunction
418	  Composite Gadget.
419
420	  If unsure, say "y".
421
422endif # TTY
423
424config USB_G_HID
425	tristate "HID Gadget"
426	select USB_LIBCOMPOSITE
427	select USB_F_HID
428	help
429	  The HID gadget driver provides generic emulation of USB
430	  Human Interface Devices (HID).
431
432	  For more information, see Documentation/usb/gadget_hid.txt which
433	  includes sample code for accessing the device files.
434
435	  Say "y" to link the driver statically, or "m" to build a
436	  dynamically linked module called "g_hid".
437
438# Standalone / single function gadgets
439config USB_G_DBGP
440	tristate "EHCI Debug Device Gadget"
441	depends on TTY
442	select USB_LIBCOMPOSITE
443	help
444	  This gadget emulates an EHCI Debug device. This is useful when you want
445	  to interact with an EHCI Debug Port.
446
447	  Say "y" to link the driver statically, or "m" to build a
448	  dynamically linked module called "g_dbgp".
449
450if USB_G_DBGP
451choice
452	prompt "EHCI Debug Device mode"
453	default USB_G_DBGP_SERIAL
454
455config USB_G_DBGP_PRINTK
456	depends on USB_G_DBGP
457	bool "printk"
458	help
459	  Directly printk() received data. No interaction.
460
461config USB_G_DBGP_SERIAL
462	depends on USB_G_DBGP
463	select USB_U_SERIAL
464	bool "serial"
465	help
466	  Userland can interact using /dev/ttyGSxxx.
467endchoice
468endif
469
470# put drivers that need isochronous transfer support (for audio
471# or video class gadget drivers), or specific hardware, here.
472config USB_G_WEBCAM
473	tristate "USB Webcam Gadget"
474	depends on VIDEO_DEV
475	select USB_LIBCOMPOSITE
476	select VIDEOBUF2_VMALLOC
477	select USB_F_UVC
478	help
479	  The Webcam Gadget acts as a composite USB Audio and Video Class
480	  device. It provides a userspace API to process UVC control requests
481	  and stream video data to the host.
482
483	  Say "y" to link the driver statically, or "m" to build a
484	  dynamically linked module called "g_webcam".
485