xref: /openbmc/linux/drivers/usb/gadget/Kconfig (revision b75be4ab)
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
16menuconfig USB_GADGET
17	tristate "USB Gadget Support"
18	help
19	   USB is a master/slave protocol, organized with one master
20	   host (such as a PC) controlling up to 127 peripheral devices.
21	   The USB hardware is asymmetric, which makes it easier to set up:
22	   you can't connect a "to-the-host" connector to a peripheral.
23
24	   Linux can run in the host, or in the peripheral.  In both cases
25	   you need a low level bus controller driver, and some software
26	   talking to it.  Peripheral controllers are often discrete silicon,
27	   or are integrated with the CPU in a microcontroller.  The more
28	   familiar host side controllers have names like "EHCI", "OHCI",
29	   or "UHCI", and are usually integrated into southbridges on PC
30	   motherboards.
31
32	   Enable this configuration option if you want to run Linux inside
33	   a USB peripheral device.  Configure one hardware driver for your
34	   peripheral/device side bus controller, and a "gadget driver" for
35	   your peripheral protocol.  (If you use modular gadget drivers,
36	   you may configure more than one.)
37
38	   If in doubt, say "N" and don't enable these drivers; most people
39	   don't have this kind of hardware (except maybe inside Linux PDAs).
40
41	   For more information, see <http://www.linux-usb.org/gadget> and
42	   the kernel DocBook documentation for this API.
43
44if USB_GADGET
45
46config USB_GADGET_DEBUG
47	boolean "Debugging messages"
48	depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
49	help
50	   Many controller and gadget drivers will print some debugging
51	   messages if you use this option to ask for those messages.
52
53	   Avoid enabling these messages, even if you're actively
54	   debugging such a driver.  Many drivers will emit so many
55	   messages that the driver timings are affected, which will
56	   either create new failure modes or remove the one you're
57	   trying to track down.  Never enable these messages for a
58	   production build.
59
60config USB_GADGET_DEBUG_FILES
61	boolean "Debugging information files"
62	depends on USB_GADGET && PROC_FS
63	help
64	   Some of the drivers in the "gadget" framework can expose
65	   debugging information in files such as /proc/driver/udc
66	   (for a peripheral controller).  The information in these
67	   files may help when you're troubleshooting or bringing up a
68	   driver on a new board.   Enable these files by choosing "Y"
69	   here.  If in doubt, or to conserve kernel memory, say "N".
70
71config USB_GADGET_DEBUG_FS
72	boolean "Debugging information files in debugfs"
73	depends on USB_GADGET && DEBUG_FS
74	help
75	   Some of the drivers in the "gadget" framework can expose
76	   debugging information in files under /sys/kernel/debug/.
77	   The information in these files may help when you're
78	   troubleshooting or bringing up a driver on a new board.
79	   Enable these files by choosing "Y" here.  If in doubt, or
80	   to conserve kernel memory, say "N".
81
82config	USB_GADGET_SELECTED
83	boolean
84
85#
86# USB Peripheral Controller Support
87#
88choice
89	prompt "USB Peripheral Controller"
90	depends on USB_GADGET
91	help
92	   A USB device uses a controller to talk to its host.
93	   Systems should have only one such upstream link.
94	   Many controller drivers are platform-specific; these
95	   often need board-specific hooks.
96
97config USB_GADGET_AMD5536UDC
98	boolean "AMD5536 UDC"
99	depends on PCI
100	select USB_GADGET_DUALSPEED
101	help
102	   The AMD5536 UDC is part of the AMD Geode CS5536, an x86 southbridge.
103	   It is a USB Highspeed DMA capable USB device controller. Beside ep0
104	   it provides 4 IN and 4 OUT endpoints (bulk or interrupt type).
105	   The UDC port supports OTG operation, and may be used as a host port
106	   if it's not being used to implement peripheral or OTG roles.
107
108	   Say "y" to link the driver statically, or "m" to build a
109	   dynamically linked module called "amd5536udc" and force all
110	   gadget drivers to also be dynamically linked.
111
112config USB_AMD5536UDC
113	tristate
114	depends on USB_GADGET_AMD5536UDC
115	default USB_GADGET
116	select USB_GADGET_SELECTED
117
118config USB_GADGET_ATMEL_USBA
119	boolean "Atmel USBA"
120	select USB_GADGET_DUALSPEED
121	depends on AVR32
122	help
123	  USBA is the integrated high-speed USB Device controller on
124	  the AT32AP700x processors from Atmel.
125
126config USB_ATMEL_USBA
127	tristate
128	depends on USB_GADGET_ATMEL_USBA
129	default USB_GADGET
130	select USB_GADGET_SELECTED
131
132config USB_GADGET_FSL_USB2
133	boolean "Freescale Highspeed USB DR Peripheral Controller"
134	depends on MPC834x || PPC_MPC831x
135	select USB_GADGET_DUALSPEED
136	help
137	   Some of Freescale PowerPC processors have a High Speed
138	   Dual-Role(DR) USB controller, which supports device mode.
139
140	   The number of programmable endpoints is different through
141	   SOC revisions.
142
143	   Say "y" to link the driver statically, or "m" to build a
144	   dynamically linked module called "fsl_usb2_udc" and force
145	   all gadget drivers to also be dynamically linked.
146
147config USB_FSL_USB2
148	tristate
149	depends on USB_GADGET_FSL_USB2
150	default USB_GADGET
151	select USB_GADGET_SELECTED
152
153config USB_GADGET_NET2280
154	boolean "NetChip 228x"
155	depends on PCI
156	select USB_GADGET_DUALSPEED
157	help
158	   NetChip 2280 / 2282 is a PCI based USB peripheral controller which
159	   supports both full and high speed USB 2.0 data transfers.
160
161	   It has six configurable endpoints, as well as endpoint zero
162	   (for control transfers) and several endpoints with dedicated
163	   functions.
164
165	   Say "y" to link the driver statically, or "m" to build a
166	   dynamically linked module called "net2280" and force all
167	   gadget drivers to also be dynamically linked.
168
169config USB_NET2280
170	tristate
171	depends on USB_GADGET_NET2280
172	default USB_GADGET
173	select USB_GADGET_SELECTED
174
175config USB_GADGET_PXA2XX
176	boolean "PXA 25x or IXP 4xx"
177	depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX
178	help
179	   Intel's PXA 25x series XScale ARM-5TE processors include
180	   an integrated full speed USB 1.1 device controller.  The
181	   controller in the IXP 4xx series is register-compatible.
182
183	   It has fifteen fixed-function endpoints, as well as endpoint
184	   zero (for control transfers).
185
186	   Say "y" to link the driver statically, or "m" to build a
187	   dynamically linked module called "pxa2xx_udc" and force all
188	   gadget drivers to also be dynamically linked.
189
190config USB_PXA2XX
191	tristate
192	depends on USB_GADGET_PXA2XX
193	default USB_GADGET
194	select USB_GADGET_SELECTED
195
196# if there's only one gadget driver, using only two bulk endpoints,
197# don't waste memory for the other endpoints
198config USB_PXA2XX_SMALL
199	depends on USB_GADGET_PXA2XX
200	bool
201	default n if USB_ETH_RNDIS
202	default y if USB_ZERO
203	default y if USB_ETH
204	default y if USB_G_SERIAL
205
206config USB_GADGET_M66592
207	boolean "Renesas M66592 USB Peripheral Controller"
208	select USB_GADGET_DUALSPEED
209	help
210	   M66592 is a discrete USB peripheral controller chip that
211	   supports both full and high speed USB 2.0 data transfers.
212	   It has seven configurable endpoints, and endpoint zero.
213
214	   Say "y" to link the driver statically, or "m" to build a
215	   dynamically linked module called "m66592_udc" and force all
216	   gadget drivers to also be dynamically linked.
217
218config USB_M66592
219	tristate
220	depends on USB_GADGET_M66592
221	default USB_GADGET
222	select USB_GADGET_SELECTED
223
224config SUPERH_BUILT_IN_M66592
225	boolean "Enable SuperH built-in USB like the M66592"
226	depends on USB_GADGET_M66592 && CPU_SUBTYPE_SH7722
227	help
228	   SH7722 has USB like the M66592.
229
230	   The transfer rate is very slow when use "Ethernet Gadget".
231	   However, this problem is improved if change a value of
232	   NET_IP_ALIGN to 4.
233
234config USB_GADGET_GOKU
235	boolean "Toshiba TC86C001 'Goku-S'"
236	depends on PCI
237	help
238	   The Toshiba TC86C001 is a PCI device which includes controllers
239	   for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI).
240
241	   The device controller has three configurable (bulk or interrupt)
242	   endpoints, plus endpoint zero (for control transfers).
243
244	   Say "y" to link the driver statically, or "m" to build a
245	   dynamically linked module called "goku_udc" and to force all
246	   gadget drivers to also be dynamically linked.
247
248config USB_GOKU
249	tristate
250	depends on USB_GADGET_GOKU
251	default USB_GADGET
252	select USB_GADGET_SELECTED
253
254
255config USB_GADGET_LH7A40X
256	boolean "LH7A40X"
257	depends on ARCH_LH7A40X
258	help
259    This driver provides USB Device Controller driver for LH7A40x
260
261config USB_LH7A40X
262	tristate
263	depends on USB_GADGET_LH7A40X
264	default USB_GADGET
265	select USB_GADGET_SELECTED
266
267config USB_GADGET_OMAP
268	boolean "OMAP USB Device Controller"
269	depends on ARCH_OMAP
270	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
271	help
272	   Many Texas Instruments OMAP processors have flexible full
273	   speed USB device controllers, with support for up to 30
274	   endpoints (plus endpoint zero).  This driver supports the
275	   controller in the OMAP 1611, and should work with controllers
276	   in other OMAP processors too, given minor tweaks.
277
278	   Say "y" to link the driver statically, or "m" to build a
279	   dynamically linked module called "omap_udc" and force all
280	   gadget drivers to also be dynamically linked.
281
282config USB_OMAP
283	tristate
284	depends on USB_GADGET_OMAP
285	default USB_GADGET
286	select USB_GADGET_SELECTED
287
288config USB_OTG
289	boolean "OTG Support"
290	depends on USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD
291	help
292	   The most notable feature of USB OTG is support for a
293	   "Dual-Role" device, which can act as either a device
294	   or a host.  The initial role choice can be changed
295	   later, when two dual-role devices talk to each other.
296
297	   Select this only if your OMAP board has a Mini-AB connector.
298
299config USB_GADGET_S3C2410
300	boolean "S3C2410 USB Device Controller"
301	depends on ARCH_S3C2410
302	help
303	  Samsung's S3C2410 is an ARM-4 processor with an integrated
304	  full speed USB 1.1 device controller.  It has 4 configurable
305	  endpoints, as well as endpoint zero (for control transfers).
306
307	  This driver has been tested on the S3C2410, S3C2412, and
308	  S3C2440 processors.
309
310config USB_S3C2410
311	tristate
312	depends on USB_GADGET_S3C2410
313	default USB_GADGET
314	select USB_GADGET_SELECTED
315
316config USB_S3C2410_DEBUG
317	boolean "S3C2410 udc debug messages"
318	depends on USB_GADGET_S3C2410
319
320config USB_GADGET_AT91
321	boolean "AT91 USB Device Port"
322	depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9
323	select USB_GADGET_SELECTED
324	help
325	   Many Atmel AT91 processors (such as the AT91RM2000) have a
326	   full speed USB Device Port with support for five configurable
327	   endpoints (plus endpoint zero).
328
329	   Say "y" to link the driver statically, or "m" to build a
330	   dynamically linked module called "at91_udc" and force all
331	   gadget drivers to also be dynamically linked.
332
333config USB_AT91
334	tristate
335	depends on USB_GADGET_AT91
336	default USB_GADGET
337
338config USB_GADGET_DUMMY_HCD
339	boolean "Dummy HCD (DEVELOPMENT)"
340	depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL
341	select USB_GADGET_DUALSPEED
342	help
343	  This host controller driver emulates USB, looping all data transfer
344	  requests back to a USB "gadget driver" in the same host.  The host
345	  side is the master; the gadget side is the slave.  Gadget drivers
346	  can be high, full, or low speed; and they have access to endpoints
347	  like those from NET2280, PXA2xx, or SA1100 hardware.
348
349	  This may help in some stages of creating a driver to embed in a
350	  Linux device, since it lets you debug several parts of the gadget
351	  driver without its hardware or drivers being involved.
352
353	  Since such a gadget side driver needs to interoperate with a host
354	  side Linux-USB device driver, this may help to debug both sides
355	  of a USB protocol stack.
356
357	  Say "y" to link the driver statically, or "m" to build a
358	  dynamically linked module called "dummy_hcd" and force all
359	  gadget drivers to also be dynamically linked.
360
361config USB_DUMMY_HCD
362	tristate
363	depends on USB_GADGET_DUMMY_HCD
364	default USB_GADGET
365	select USB_GADGET_SELECTED
366
367# NOTE:  Please keep dummy_hcd LAST so that "real hardware" appears
368# first and will be selected by default.
369
370endchoice
371
372config USB_GADGET_DUALSPEED
373	bool
374	depends on USB_GADGET
375	default n
376	help
377	  Means that gadget drivers should include extra descriptors
378	  and code to handle dual-speed controllers.
379
380#
381# USB Gadget Drivers
382#
383choice
384	tristate "USB Gadget Drivers"
385	depends on USB_GADGET && USB_GADGET_SELECTED
386	default USB_ETH
387	help
388	  A Linux "Gadget Driver" talks to the USB Peripheral Controller
389	  driver through the abstract "gadget" API.  Some other operating
390	  systems call these "client" drivers, of which "class drivers"
391	  are a subset (implementing a USB device class specification).
392	  A gadget driver implements one or more USB functions using
393	  the peripheral hardware.
394
395	  Gadget drivers are hardware-neutral, or "platform independent",
396	  except that they sometimes must understand quirks or limitations
397	  of the particular controllers they work with.  For example, when
398	  a controller doesn't support alternate configurations or provide
399	  enough of the right types of endpoints, the gadget driver might
400	  not be able work with that controller, or might need to implement
401	  a less common variant of a device class protocol.
402
403# this first set of drivers all depend on bulk-capable hardware.
404
405config USB_ZERO
406	tristate "Gadget Zero (DEVELOPMENT)"
407	depends on EXPERIMENTAL
408	help
409	  Gadget Zero is a two-configuration device.  It either sinks and
410	  sources bulk data; or it loops back a configurable number of
411	  transfers.  It also implements control requests, for "chapter 9"
412	  conformance.  The driver needs only two bulk-capable endpoints, so
413	  it can work on top of most device-side usb controllers.  It's
414	  useful for testing, and is also a working example showing how
415	  USB "gadget drivers" can be written.
416
417	  Make this be the first driver you try using on top of any new
418	  USB peripheral controller driver.  Then you can use host-side
419	  test software, like the "usbtest" driver, to put your hardware
420	  and its driver through a basic set of functional tests.
421
422	  Gadget Zero also works with the host-side "usb-skeleton" driver,
423	  and with many kinds of host-side test software.  You may need
424	  to tweak product and vendor IDs before host software knows about
425	  this device, and arrange to select an appropriate configuration.
426
427	  Say "y" to link the driver statically, or "m" to build a
428	  dynamically linked module called "g_zero".
429
430config USB_ZERO_HNPTEST
431	boolean "HNP Test Device"
432	depends on USB_ZERO && USB_OTG
433	help
434	  You can configure this device to enumerate using the device
435	  identifiers of the USB-OTG test device.  That means that when
436	  this gadget connects to another OTG device, with this one using
437	  the "B-Peripheral" role, that device will use HNP to let this
438	  one serve as the USB host instead (in the "B-Host" role).
439
440config USB_ETH
441	tristate "Ethernet Gadget (with CDC Ethernet support)"
442	depends on NET
443	help
444	  This driver implements Ethernet style communication, in either
445	  of two ways:
446
447	   - The "Communication Device Class" (CDC) Ethernet Control Model.
448	     That protocol is often avoided with pure Ethernet adapters, in
449	     favor of simpler vendor-specific hardware, but is widely
450	     supported by firmware for smart network devices.
451
452	   - On hardware can't implement that protocol, a simple CDC subset
453	     is used, placing fewer demands on USB.
454
455	  RNDIS support is a third option, more demanding than that subset.
456
457	  Within the USB device, this gadget driver exposes a network device
458	  "usbX", where X depends on what other networking devices you have.
459	  Treat it like a two-node Ethernet link:  host, and gadget.
460
461	  The Linux-USB host-side "usbnet" driver interoperates with this
462	  driver, so that deep I/O queues can be supported.  On 2.4 kernels,
463	  use "CDCEther" instead, if you're using the CDC option. That CDC
464	  mode should also interoperate with standard CDC Ethernet class
465	  drivers on other host operating systems.
466
467	  Say "y" to link the driver statically, or "m" to build a
468	  dynamically linked module called "g_ether".
469
470config USB_ETH_RNDIS
471	bool "RNDIS support (EXPERIMENTAL)"
472	depends on USB_ETH && EXPERIMENTAL
473	default y
474	help
475	   Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
476	   and Microsoft provides redistributable binary RNDIS drivers for
477	   older versions of Windows.
478
479	   If you say "y" here, the Ethernet gadget driver will try to provide
480	   a second device configuration, supporting RNDIS to talk to such
481	   Microsoft USB hosts.
482
483	   To make MS-Windows work with this, use Documentation/usb/linux.inf
484	   as the "driver info file".  For versions of MS-Windows older than
485	   XP, you'll need to download drivers from Microsoft's website; a URL
486	   is given in comments found in that info file.
487
488config USB_GADGETFS
489	tristate "Gadget Filesystem (EXPERIMENTAL)"
490	depends on EXPERIMENTAL
491	help
492	  This driver provides a filesystem based API that lets user mode
493	  programs implement a single-configuration USB device, including
494	  endpoint I/O and control requests that don't relate to enumeration.
495	  All endpoints, transfer speeds, and transfer types supported by
496	  the hardware are available, through read() and write() calls.
497
498	  Say "y" to link the driver statically, or "m" to build a
499	  dynamically linked module called "gadgetfs".
500
501config USB_FILE_STORAGE
502	tristate "File-backed Storage Gadget"
503	depends on BLOCK
504	help
505	  The File-backed Storage Gadget acts as a USB Mass Storage
506	  disk drive.  As its storage repository it can use a regular
507	  file or a block device (in much the same way as the "loop"
508	  device driver), specified as a module parameter.
509
510	  Say "y" to link the driver statically, or "m" to build a
511	  dynamically linked module called "g_file_storage".
512
513config USB_FILE_STORAGE_TEST
514	bool "File-backed Storage Gadget testing version"
515	depends on USB_FILE_STORAGE
516	default n
517	help
518	  Say "y" to generate the larger testing version of the
519	  File-backed Storage Gadget, useful for probing the
520	  behavior of USB Mass Storage hosts.  Not needed for
521	  normal operation.
522
523config USB_G_SERIAL
524	tristate "Serial Gadget (with CDC ACM support)"
525	help
526	  The Serial Gadget talks to the Linux-USB generic serial driver.
527	  This driver supports a CDC-ACM module option, which can be used
528	  to interoperate with MS-Windows hosts or with the Linux-USB
529	  "cdc-acm" driver.
530
531	  Say "y" to link the driver statically, or "m" to build a
532	  dynamically linked module called "g_serial".
533
534	  For more information, see Documentation/usb/gadget_serial.txt
535	  which includes instructions and a "driver info file" needed to
536	  make MS-Windows work with this driver.
537
538config USB_MIDI_GADGET
539	tristate "MIDI Gadget (EXPERIMENTAL)"
540	depends on SND && EXPERIMENTAL
541	select SND_RAWMIDI
542	help
543	  The MIDI Gadget acts as a USB Audio device, with one MIDI
544	  input and one MIDI output. These MIDI jacks appear as
545	  a sound "card" in the ALSA sound system. Other MIDI
546	  connections can then be made on the gadget system, using
547	  ALSA's aconnect utility etc.
548
549	  Say "y" to link the driver statically, or "m" to build a
550	  dynamically linked module called "g_midi".
551
552config USB_G_PRINTER
553	tristate "Printer Gadget"
554	help
555	  The Printer Gadget channels data between the USB host and a
556	  userspace program driving the print engine. The user space
557	  program reads and writes the device file /dev/g_printer to
558	  receive or send printer data. It can use ioctl calls to
559	  the device file to get or set printer status.
560
561	  Say "y" to link the driver statically, or "m" to build a
562	  dynamically linked module called "g_printer".
563
564	  For more information, see Documentation/usb/gadget_printer.txt
565	  which includes sample code for accessing the device file.
566
567# put drivers that need isochronous transfer support (for audio
568# or video class gadget drivers), or specific hardware, here.
569
570# - none yet
571
572endchoice
573
574endif # USB_GADGET
575