11da177e4SLinus Torvalds# 21da177e4SLinus Torvalds# USB Gadget support on a system involves 31da177e4SLinus Torvalds# (a) a peripheral controller, and 41da177e4SLinus Torvalds# (b) the gadget driver using it. 51da177e4SLinus Torvalds# 61da177e4SLinus Torvalds# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !! 71da177e4SLinus Torvalds# 81da177e4SLinus Torvalds# - Host systems (like PCs) need CONFIG_USB (with "A" jacks). 91da177e4SLinus Torvalds# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks). 10cab00891SMatt LaPlante# - Some systems have both kinds of controllers. 111da177e4SLinus Torvalds# 121da177e4SLinus Torvalds# With help from a special transceiver and a "Mini-AB" jack, systems with 131da177e4SLinus Torvalds# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 141da177e4SLinus Torvalds# 151da177e4SLinus Torvalds 16b75be4abSDenis Chengmenuconfig USB_GADGET 17b75be4abSDenis Cheng tristate "USB Gadget Support" 181da177e4SLinus Torvalds help 191da177e4SLinus Torvalds USB is a master/slave protocol, organized with one master 201da177e4SLinus Torvalds host (such as a PC) controlling up to 127 peripheral devices. 211da177e4SLinus Torvalds The USB hardware is asymmetric, which makes it easier to set up: 221da177e4SLinus Torvalds you can't connect a "to-the-host" connector to a peripheral. 231da177e4SLinus Torvalds 241da177e4SLinus Torvalds Linux can run in the host, or in the peripheral. In both cases 251da177e4SLinus Torvalds you need a low level bus controller driver, and some software 261da177e4SLinus Torvalds talking to it. Peripheral controllers are often discrete silicon, 271da177e4SLinus Torvalds or are integrated with the CPU in a microcontroller. The more 28e113f29cSJules Villard familiar host side controllers have names like "EHCI", "OHCI", 291da177e4SLinus Torvalds or "UHCI", and are usually integrated into southbridges on PC 301da177e4SLinus Torvalds motherboards. 311da177e4SLinus Torvalds 321da177e4SLinus Torvalds Enable this configuration option if you want to run Linux inside 331da177e4SLinus Torvalds a USB peripheral device. Configure one hardware driver for your 341da177e4SLinus Torvalds peripheral/device side bus controller, and a "gadget driver" for 351da177e4SLinus Torvalds your peripheral protocol. (If you use modular gadget drivers, 361da177e4SLinus Torvalds you may configure more than one.) 371da177e4SLinus Torvalds 381da177e4SLinus Torvalds If in doubt, say "N" and don't enable these drivers; most people 391da177e4SLinus Torvalds don't have this kind of hardware (except maybe inside Linux PDAs). 401da177e4SLinus Torvalds 411da177e4SLinus Torvalds For more information, see <http://www.linux-usb.org/gadget> and 421da177e4SLinus Torvalds the kernel DocBook documentation for this API. 431da177e4SLinus Torvalds 44b75be4abSDenis Chengif USB_GADGET 45b75be4abSDenis Cheng 4670790f63SDavid Brownellconfig USB_GADGET_DEBUG 4770790f63SDavid Brownell boolean "Debugging messages" 4870790f63SDavid Brownell depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL 4970790f63SDavid Brownell help 5070790f63SDavid Brownell Many controller and gadget drivers will print some debugging 5170790f63SDavid Brownell messages if you use this option to ask for those messages. 5270790f63SDavid Brownell 5370790f63SDavid Brownell Avoid enabling these messages, even if you're actively 5470790f63SDavid Brownell debugging such a driver. Many drivers will emit so many 5570790f63SDavid Brownell messages that the driver timings are affected, which will 5670790f63SDavid Brownell either create new failure modes or remove the one you're 5770790f63SDavid Brownell trying to track down. Never enable these messages for a 5870790f63SDavid Brownell production build. 5970790f63SDavid Brownell 601da177e4SLinus Torvaldsconfig USB_GADGET_DEBUG_FILES 611da177e4SLinus Torvalds boolean "Debugging information files" 621da177e4SLinus Torvalds depends on USB_GADGET && PROC_FS 631da177e4SLinus Torvalds help 641da177e4SLinus Torvalds Some of the drivers in the "gadget" framework can expose 651da177e4SLinus Torvalds debugging information in files such as /proc/driver/udc 661da177e4SLinus Torvalds (for a peripheral controller). The information in these 671da177e4SLinus Torvalds files may help when you're troubleshooting or bringing up a 681da177e4SLinus Torvalds driver on a new board. Enable these files by choosing "Y" 691da177e4SLinus Torvalds here. If in doubt, or to conserve kernel memory, say "N". 701da177e4SLinus Torvalds 71914a3f3bSHaavard Skinnemoenconfig USB_GADGET_DEBUG_FS 72914a3f3bSHaavard Skinnemoen boolean "Debugging information files in debugfs" 73914a3f3bSHaavard Skinnemoen depends on USB_GADGET && DEBUG_FS 74914a3f3bSHaavard Skinnemoen help 75914a3f3bSHaavard Skinnemoen Some of the drivers in the "gadget" framework can expose 76914a3f3bSHaavard Skinnemoen debugging information in files under /sys/kernel/debug/. 77914a3f3bSHaavard Skinnemoen The information in these files may help when you're 78914a3f3bSHaavard Skinnemoen troubleshooting or bringing up a driver on a new board. 79914a3f3bSHaavard Skinnemoen Enable these files by choosing "Y" here. If in doubt, or 80914a3f3bSHaavard Skinnemoen to conserve kernel memory, say "N". 81914a3f3bSHaavard Skinnemoen 82028b271bSDavid Brownellconfig USB_GADGET_SELECTED 83028b271bSDavid Brownell boolean 84028b271bSDavid Brownell 851da177e4SLinus Torvalds# 861da177e4SLinus Torvalds# USB Peripheral Controller Support 871da177e4SLinus Torvalds# 881da177e4SLinus Torvaldschoice 891da177e4SLinus Torvalds prompt "USB Peripheral Controller" 901da177e4SLinus Torvalds depends on USB_GADGET 911da177e4SLinus Torvalds help 921da177e4SLinus Torvalds A USB device uses a controller to talk to its host. 931da177e4SLinus Torvalds Systems should have only one such upstream link. 941da177e4SLinus Torvalds Many controller drivers are platform-specific; these 951da177e4SLinus Torvalds often need board-specific hooks. 961da177e4SLinus Torvalds 9755d402d8SThomas Dahlmannconfig USB_GADGET_AMD5536UDC 9855d402d8SThomas Dahlmann boolean "AMD5536 UDC" 9955d402d8SThomas Dahlmann depends on PCI 10055d402d8SThomas Dahlmann select USB_GADGET_DUALSPEED 10155d402d8SThomas Dahlmann help 10255d402d8SThomas Dahlmann The AMD5536 UDC is part of the AMD Geode CS5536, an x86 southbridge. 10355d402d8SThomas Dahlmann It is a USB Highspeed DMA capable USB device controller. Beside ep0 10455d402d8SThomas Dahlmann it provides 4 IN and 4 OUT endpoints (bulk or interrupt type). 10555d402d8SThomas Dahlmann The UDC port supports OTG operation, and may be used as a host port 10655d402d8SThomas Dahlmann if it's not being used to implement peripheral or OTG roles. 10755d402d8SThomas Dahlmann 10855d402d8SThomas Dahlmann Say "y" to link the driver statically, or "m" to build a 10955d402d8SThomas Dahlmann dynamically linked module called "amd5536udc" and force all 11055d402d8SThomas Dahlmann gadget drivers to also be dynamically linked. 11155d402d8SThomas Dahlmann 11255d402d8SThomas Dahlmannconfig USB_AMD5536UDC 11355d402d8SThomas Dahlmann tristate 11455d402d8SThomas Dahlmann depends on USB_GADGET_AMD5536UDC 11555d402d8SThomas Dahlmann default USB_GADGET 11655d402d8SThomas Dahlmann select USB_GADGET_SELECTED 11755d402d8SThomas Dahlmann 118914a3f3bSHaavard Skinnemoenconfig USB_GADGET_ATMEL_USBA 119914a3f3bSHaavard Skinnemoen boolean "Atmel USBA" 120914a3f3bSHaavard Skinnemoen select USB_GADGET_DUALSPEED 121914a3f3bSHaavard Skinnemoen depends on AVR32 122914a3f3bSHaavard Skinnemoen help 123914a3f3bSHaavard Skinnemoen USBA is the integrated high-speed USB Device controller on 124914a3f3bSHaavard Skinnemoen the AT32AP700x processors from Atmel. 125914a3f3bSHaavard Skinnemoen 126914a3f3bSHaavard Skinnemoenconfig USB_ATMEL_USBA 127914a3f3bSHaavard Skinnemoen tristate 128914a3f3bSHaavard Skinnemoen depends on USB_GADGET_ATMEL_USBA 129914a3f3bSHaavard Skinnemoen default USB_GADGET 130914a3f3bSHaavard Skinnemoen select USB_GADGET_SELECTED 131914a3f3bSHaavard Skinnemoen 132b504882dSLi Yangconfig USB_GADGET_FSL_USB2 133b504882dSLi Yang boolean "Freescale Highspeed USB DR Peripheral Controller" 13433635efaSLi Yang depends on FSL_SOC 135b504882dSLi Yang select USB_GADGET_DUALSPEED 136b504882dSLi Yang help 137b504882dSLi Yang Some of Freescale PowerPC processors have a High Speed 138b504882dSLi Yang Dual-Role(DR) USB controller, which supports device mode. 139b504882dSLi Yang 140b504882dSLi Yang The number of programmable endpoints is different through 141b504882dSLi Yang SOC revisions. 142b504882dSLi Yang 143b504882dSLi Yang Say "y" to link the driver statically, or "m" to build a 144b504882dSLi Yang dynamically linked module called "fsl_usb2_udc" and force 145b504882dSLi Yang all gadget drivers to also be dynamically linked. 146b504882dSLi Yang 147b504882dSLi Yangconfig USB_FSL_USB2 148b504882dSLi Yang tristate 149b504882dSLi Yang depends on USB_GADGET_FSL_USB2 150b504882dSLi Yang default USB_GADGET 151b504882dSLi Yang select USB_GADGET_SELECTED 152b504882dSLi Yang 1531da177e4SLinus Torvaldsconfig USB_GADGET_NET2280 154950ee4c8SGuennadi Liakhovetski boolean "NetChip 228x" 1551da177e4SLinus Torvalds depends on PCI 1561da177e4SLinus Torvalds select USB_GADGET_DUALSPEED 1571da177e4SLinus Torvalds help 158950ee4c8SGuennadi Liakhovetski NetChip 2280 / 2282 is a PCI based USB peripheral controller which 1591da177e4SLinus Torvalds supports both full and high speed USB 2.0 data transfers. 1601da177e4SLinus Torvalds 1611da177e4SLinus Torvalds It has six configurable endpoints, as well as endpoint zero 1621da177e4SLinus Torvalds (for control transfers) and several endpoints with dedicated 1631da177e4SLinus Torvalds functions. 1641da177e4SLinus Torvalds 1651da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 1661da177e4SLinus Torvalds dynamically linked module called "net2280" and force all 1671da177e4SLinus Torvalds gadget drivers to also be dynamically linked. 1681da177e4SLinus Torvalds 1691da177e4SLinus Torvaldsconfig USB_NET2280 1701da177e4SLinus Torvalds tristate 1711da177e4SLinus Torvalds depends on USB_GADGET_NET2280 1721da177e4SLinus Torvalds default USB_GADGET 173028b271bSDavid Brownell select USB_GADGET_SELECTED 1741da177e4SLinus Torvalds 1751da177e4SLinus Torvaldsconfig USB_GADGET_PXA2XX 1761da177e4SLinus Torvalds boolean "PXA 25x or IXP 4xx" 1771da177e4SLinus Torvalds depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX 1781da177e4SLinus Torvalds help 1791da177e4SLinus Torvalds Intel's PXA 25x series XScale ARM-5TE processors include 1801da177e4SLinus Torvalds an integrated full speed USB 1.1 device controller. The 1811da177e4SLinus Torvalds controller in the IXP 4xx series is register-compatible. 1821da177e4SLinus Torvalds 1831da177e4SLinus Torvalds It has fifteen fixed-function endpoints, as well as endpoint 1841da177e4SLinus Torvalds zero (for control transfers). 1851da177e4SLinus Torvalds 1861da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 1871da177e4SLinus Torvalds dynamically linked module called "pxa2xx_udc" and force all 1881da177e4SLinus Torvalds gadget drivers to also be dynamically linked. 1891da177e4SLinus Torvalds 1901da177e4SLinus Torvaldsconfig USB_PXA2XX 1911da177e4SLinus Torvalds tristate 1921da177e4SLinus Torvalds depends on USB_GADGET_PXA2XX 1931da177e4SLinus Torvalds default USB_GADGET 194028b271bSDavid Brownell select USB_GADGET_SELECTED 1951da177e4SLinus Torvalds 1961da177e4SLinus Torvalds# if there's only one gadget driver, using only two bulk endpoints, 1971da177e4SLinus Torvalds# don't waste memory for the other endpoints 1981da177e4SLinus Torvaldsconfig USB_PXA2XX_SMALL 1991da177e4SLinus Torvalds depends on USB_GADGET_PXA2XX 2001da177e4SLinus Torvalds bool 2011da177e4SLinus Torvalds default n if USB_ETH_RNDIS 2021da177e4SLinus Torvalds default y if USB_ZERO 2031da177e4SLinus Torvalds default y if USB_ETH 2041da177e4SLinus Torvalds default y if USB_G_SERIAL 2051da177e4SLinus Torvalds 206598f22e1SYoshihiro Shimodaconfig USB_GADGET_M66592 207598f22e1SYoshihiro Shimoda boolean "Renesas M66592 USB Peripheral Controller" 208598f22e1SYoshihiro Shimoda select USB_GADGET_DUALSPEED 209598f22e1SYoshihiro Shimoda help 210598f22e1SYoshihiro Shimoda M66592 is a discrete USB peripheral controller chip that 211598f22e1SYoshihiro Shimoda supports both full and high speed USB 2.0 data transfers. 212598f22e1SYoshihiro Shimoda It has seven configurable endpoints, and endpoint zero. 213598f22e1SYoshihiro Shimoda 214598f22e1SYoshihiro Shimoda Say "y" to link the driver statically, or "m" to build a 215598f22e1SYoshihiro Shimoda dynamically linked module called "m66592_udc" and force all 216598f22e1SYoshihiro Shimoda gadget drivers to also be dynamically linked. 217598f22e1SYoshihiro Shimoda 218598f22e1SYoshihiro Shimodaconfig USB_M66592 219598f22e1SYoshihiro Shimoda tristate 220598f22e1SYoshihiro Shimoda depends on USB_GADGET_M66592 221598f22e1SYoshihiro Shimoda default USB_GADGET 222598f22e1SYoshihiro Shimoda select USB_GADGET_SELECTED 223598f22e1SYoshihiro Shimoda 2248c73aff6SYoshihiro Shimodaconfig SUPERH_BUILT_IN_M66592 2258c73aff6SYoshihiro Shimoda boolean "Enable SuperH built-in USB like the M66592" 2268c73aff6SYoshihiro Shimoda depends on USB_GADGET_M66592 && CPU_SUBTYPE_SH7722 2278c73aff6SYoshihiro Shimoda help 2288c73aff6SYoshihiro Shimoda SH7722 has USB like the M66592. 2298c73aff6SYoshihiro Shimoda 2308c73aff6SYoshihiro Shimoda The transfer rate is very slow when use "Ethernet Gadget". 2318c73aff6SYoshihiro Shimoda However, this problem is improved if change a value of 2328c73aff6SYoshihiro Shimoda NET_IP_ALIGN to 4. 2338c73aff6SYoshihiro Shimoda 2341da177e4SLinus Torvaldsconfig USB_GADGET_GOKU 2351da177e4SLinus Torvalds boolean "Toshiba TC86C001 'Goku-S'" 2361da177e4SLinus Torvalds depends on PCI 2371da177e4SLinus Torvalds help 2381da177e4SLinus Torvalds The Toshiba TC86C001 is a PCI device which includes controllers 2391da177e4SLinus Torvalds for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI). 2401da177e4SLinus Torvalds 2411da177e4SLinus Torvalds The device controller has three configurable (bulk or interrupt) 2421da177e4SLinus Torvalds endpoints, plus endpoint zero (for control transfers). 2431da177e4SLinus Torvalds 2441da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 2451da177e4SLinus Torvalds dynamically linked module called "goku_udc" and to force all 2461da177e4SLinus Torvalds gadget drivers to also be dynamically linked. 2471da177e4SLinus Torvalds 2481da177e4SLinus Torvaldsconfig USB_GOKU 2491da177e4SLinus Torvalds tristate 2501da177e4SLinus Torvalds depends on USB_GADGET_GOKU 2511da177e4SLinus Torvalds default USB_GADGET 252028b271bSDavid Brownell select USB_GADGET_SELECTED 2531da177e4SLinus Torvalds 2541da177e4SLinus Torvalds 2551da177e4SLinus Torvaldsconfig USB_GADGET_LH7A40X 2561da177e4SLinus Torvalds boolean "LH7A40X" 2571da177e4SLinus Torvalds depends on ARCH_LH7A40X 2581da177e4SLinus Torvalds help 2591da177e4SLinus Torvalds This driver provides USB Device Controller driver for LH7A40x 2601da177e4SLinus Torvalds 2611da177e4SLinus Torvaldsconfig USB_LH7A40X 2621da177e4SLinus Torvalds tristate 2631da177e4SLinus Torvalds depends on USB_GADGET_LH7A40X 2641da177e4SLinus Torvalds default USB_GADGET 265028b271bSDavid Brownell select USB_GADGET_SELECTED 2661da177e4SLinus Torvalds 2671da177e4SLinus Torvaldsconfig USB_GADGET_OMAP 2681da177e4SLinus Torvalds boolean "OMAP USB Device Controller" 2691da177e4SLinus Torvalds depends on ARCH_OMAP 2701da177e4SLinus Torvalds select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 2711da177e4SLinus Torvalds help 2721da177e4SLinus Torvalds Many Texas Instruments OMAP processors have flexible full 2731da177e4SLinus Torvalds speed USB device controllers, with support for up to 30 2741da177e4SLinus Torvalds endpoints (plus endpoint zero). This driver supports the 2751da177e4SLinus Torvalds controller in the OMAP 1611, and should work with controllers 2761da177e4SLinus Torvalds in other OMAP processors too, given minor tweaks. 2771da177e4SLinus Torvalds 2781da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 2791da177e4SLinus Torvalds dynamically linked module called "omap_udc" and force all 2801da177e4SLinus Torvalds gadget drivers to also be dynamically linked. 2811da177e4SLinus Torvalds 2821da177e4SLinus Torvaldsconfig USB_OMAP 2831da177e4SLinus Torvalds tristate 2841da177e4SLinus Torvalds depends on USB_GADGET_OMAP 2851da177e4SLinus Torvalds default USB_GADGET 286028b271bSDavid Brownell select USB_GADGET_SELECTED 2871da177e4SLinus Torvalds 2881da177e4SLinus Torvaldsconfig USB_OTG 2891da177e4SLinus Torvalds boolean "OTG Support" 2901da177e4SLinus Torvalds depends on USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD 2911da177e4SLinus Torvalds help 2921da177e4SLinus Torvalds The most notable feature of USB OTG is support for a 2931da177e4SLinus Torvalds "Dual-Role" device, which can act as either a device 2941da177e4SLinus Torvalds or a host. The initial role choice can be changed 2951da177e4SLinus Torvalds later, when two dual-role devices talk to each other. 2961da177e4SLinus Torvalds 2971da177e4SLinus Torvalds Select this only if your OMAP board has a Mini-AB connector. 2981da177e4SLinus Torvalds 2993fc154b6SArnaud Patardconfig USB_GADGET_S3C2410 3003fc154b6SArnaud Patard boolean "S3C2410 USB Device Controller" 3013fc154b6SArnaud Patard depends on ARCH_S3C2410 3023fc154b6SArnaud Patard help 3033fc154b6SArnaud Patard Samsung's S3C2410 is an ARM-4 processor with an integrated 3043fc154b6SArnaud Patard full speed USB 1.1 device controller. It has 4 configurable 3053fc154b6SArnaud Patard endpoints, as well as endpoint zero (for control transfers). 3063fc154b6SArnaud Patard 3073fc154b6SArnaud Patard This driver has been tested on the S3C2410, S3C2412, and 3083fc154b6SArnaud Patard S3C2440 processors. 3093fc154b6SArnaud Patard 3103fc154b6SArnaud Patardconfig USB_S3C2410 3113fc154b6SArnaud Patard tristate 3123fc154b6SArnaud Patard depends on USB_GADGET_S3C2410 3133fc154b6SArnaud Patard default USB_GADGET 3143fc154b6SArnaud Patard select USB_GADGET_SELECTED 3153fc154b6SArnaud Patard 3163fc154b6SArnaud Patardconfig USB_S3C2410_DEBUG 3173fc154b6SArnaud Patard boolean "S3C2410 udc debug messages" 3183fc154b6SArnaud Patard depends on USB_GADGET_S3C2410 3193fc154b6SArnaud Patard 320bae4bd84SDavid Brownellconfig USB_GADGET_AT91 321bae4bd84SDavid Brownell boolean "AT91 USB Device Port" 3222b3b3516SAndrew Victor depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 323bae4bd84SDavid Brownell select USB_GADGET_SELECTED 324bae4bd84SDavid Brownell help 325bae4bd84SDavid Brownell Many Atmel AT91 processors (such as the AT91RM2000) have a 326bae4bd84SDavid Brownell full speed USB Device Port with support for five configurable 327bae4bd84SDavid Brownell endpoints (plus endpoint zero). 328bae4bd84SDavid Brownell 329bae4bd84SDavid Brownell Say "y" to link the driver statically, or "m" to build a 330bae4bd84SDavid Brownell dynamically linked module called "at91_udc" and force all 331bae4bd84SDavid Brownell gadget drivers to also be dynamically linked. 332bae4bd84SDavid Brownell 333bae4bd84SDavid Brownellconfig USB_AT91 334bae4bd84SDavid Brownell tristate 335bae4bd84SDavid Brownell depends on USB_GADGET_AT91 336bae4bd84SDavid Brownell default USB_GADGET 3371da177e4SLinus Torvalds 3381da177e4SLinus Torvaldsconfig USB_GADGET_DUMMY_HCD 3391da177e4SLinus Torvalds boolean "Dummy HCD (DEVELOPMENT)" 340be0c8015SAdrian Bunk depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL 3411da177e4SLinus Torvalds select USB_GADGET_DUALSPEED 3421da177e4SLinus Torvalds help 3431da177e4SLinus Torvalds This host controller driver emulates USB, looping all data transfer 3441da177e4SLinus Torvalds requests back to a USB "gadget driver" in the same host. The host 3451da177e4SLinus Torvalds side is the master; the gadget side is the slave. Gadget drivers 3461da177e4SLinus Torvalds can be high, full, or low speed; and they have access to endpoints 3471da177e4SLinus Torvalds like those from NET2280, PXA2xx, or SA1100 hardware. 3481da177e4SLinus Torvalds 3491da177e4SLinus Torvalds This may help in some stages of creating a driver to embed in a 3501da177e4SLinus Torvalds Linux device, since it lets you debug several parts of the gadget 3511da177e4SLinus Torvalds driver without its hardware or drivers being involved. 3521da177e4SLinus Torvalds 3531da177e4SLinus Torvalds Since such a gadget side driver needs to interoperate with a host 3541da177e4SLinus Torvalds side Linux-USB device driver, this may help to debug both sides 3551da177e4SLinus Torvalds of a USB protocol stack. 3561da177e4SLinus Torvalds 3571da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 3581da177e4SLinus Torvalds dynamically linked module called "dummy_hcd" and force all 3591da177e4SLinus Torvalds gadget drivers to also be dynamically linked. 3601da177e4SLinus Torvalds 3611da177e4SLinus Torvaldsconfig USB_DUMMY_HCD 3621da177e4SLinus Torvalds tristate 3631da177e4SLinus Torvalds depends on USB_GADGET_DUMMY_HCD 3641da177e4SLinus Torvalds default USB_GADGET 365028b271bSDavid Brownell select USB_GADGET_SELECTED 3661da177e4SLinus Torvalds 3671da177e4SLinus Torvalds# NOTE: Please keep dummy_hcd LAST so that "real hardware" appears 3681da177e4SLinus Torvalds# first and will be selected by default. 3691da177e4SLinus Torvalds 3701da177e4SLinus Torvaldsendchoice 3711da177e4SLinus Torvalds 3721da177e4SLinus Torvaldsconfig USB_GADGET_DUALSPEED 3731da177e4SLinus Torvalds bool 3741da177e4SLinus Torvalds depends on USB_GADGET 3751da177e4SLinus Torvalds default n 3761da177e4SLinus Torvalds help 3771da177e4SLinus Torvalds Means that gadget drivers should include extra descriptors 3781da177e4SLinus Torvalds and code to handle dual-speed controllers. 3791da177e4SLinus Torvalds 3801da177e4SLinus Torvalds# 3811da177e4SLinus Torvalds# USB Gadget Drivers 3821da177e4SLinus Torvalds# 3831da177e4SLinus Torvaldschoice 3841da177e4SLinus Torvalds tristate "USB Gadget Drivers" 385028b271bSDavid Brownell depends on USB_GADGET && USB_GADGET_SELECTED 3861da177e4SLinus Torvalds default USB_ETH 3871da177e4SLinus Torvalds help 3881da177e4SLinus Torvalds A Linux "Gadget Driver" talks to the USB Peripheral Controller 3891da177e4SLinus Torvalds driver through the abstract "gadget" API. Some other operating 3901da177e4SLinus Torvalds systems call these "client" drivers, of which "class drivers" 3911da177e4SLinus Torvalds are a subset (implementing a USB device class specification). 3921da177e4SLinus Torvalds A gadget driver implements one or more USB functions using 3931da177e4SLinus Torvalds the peripheral hardware. 3941da177e4SLinus Torvalds 3951da177e4SLinus Torvalds Gadget drivers are hardware-neutral, or "platform independent", 3961da177e4SLinus Torvalds except that they sometimes must understand quirks or limitations 3971da177e4SLinus Torvalds of the particular controllers they work with. For example, when 3981da177e4SLinus Torvalds a controller doesn't support alternate configurations or provide 3991da177e4SLinus Torvalds enough of the right types of endpoints, the gadget driver might 4001da177e4SLinus Torvalds not be able work with that controller, or might need to implement 4011da177e4SLinus Torvalds a less common variant of a device class protocol. 4021da177e4SLinus Torvalds 4031da177e4SLinus Torvalds# this first set of drivers all depend on bulk-capable hardware. 4041da177e4SLinus Torvalds 4051da177e4SLinus Torvaldsconfig USB_ZERO 4061da177e4SLinus Torvalds tristate "Gadget Zero (DEVELOPMENT)" 4071da177e4SLinus Torvalds depends on EXPERIMENTAL 4081da177e4SLinus Torvalds help 4091da177e4SLinus Torvalds Gadget Zero is a two-configuration device. It either sinks and 4101da177e4SLinus Torvalds sources bulk data; or it loops back a configurable number of 4111da177e4SLinus Torvalds transfers. It also implements control requests, for "chapter 9" 4121da177e4SLinus Torvalds conformance. The driver needs only two bulk-capable endpoints, so 4131da177e4SLinus Torvalds it can work on top of most device-side usb controllers. It's 4141da177e4SLinus Torvalds useful for testing, and is also a working example showing how 4151da177e4SLinus Torvalds USB "gadget drivers" can be written. 4161da177e4SLinus Torvalds 4171da177e4SLinus Torvalds Make this be the first driver you try using on top of any new 4181da177e4SLinus Torvalds USB peripheral controller driver. Then you can use host-side 4191da177e4SLinus Torvalds test software, like the "usbtest" driver, to put your hardware 4201da177e4SLinus Torvalds and its driver through a basic set of functional tests. 4211da177e4SLinus Torvalds 4221da177e4SLinus Torvalds Gadget Zero also works with the host-side "usb-skeleton" driver, 4231da177e4SLinus Torvalds and with many kinds of host-side test software. You may need 4241da177e4SLinus Torvalds to tweak product and vendor IDs before host software knows about 4251da177e4SLinus Torvalds this device, and arrange to select an appropriate configuration. 4261da177e4SLinus Torvalds 4271da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 4281da177e4SLinus Torvalds dynamically linked module called "g_zero". 4291da177e4SLinus Torvalds 4301da177e4SLinus Torvaldsconfig USB_ZERO_HNPTEST 4311da177e4SLinus Torvalds boolean "HNP Test Device" 4321da177e4SLinus Torvalds depends on USB_ZERO && USB_OTG 4331da177e4SLinus Torvalds help 4341da177e4SLinus Torvalds You can configure this device to enumerate using the device 4351da177e4SLinus Torvalds identifiers of the USB-OTG test device. That means that when 4361da177e4SLinus Torvalds this gadget connects to another OTG device, with this one using 4371da177e4SLinus Torvalds the "B-Peripheral" role, that device will use HNP to let this 4381da177e4SLinus Torvalds one serve as the USB host instead (in the "B-Host" role). 4391da177e4SLinus Torvalds 4401da177e4SLinus Torvaldsconfig USB_ETH 4411da177e4SLinus Torvalds tristate "Ethernet Gadget (with CDC Ethernet support)" 4421da177e4SLinus Torvalds depends on NET 4431da177e4SLinus Torvalds help 4441da177e4SLinus Torvalds This driver implements Ethernet style communication, in either 4451da177e4SLinus Torvalds of two ways: 4461da177e4SLinus Torvalds 4471da177e4SLinus Torvalds - The "Communication Device Class" (CDC) Ethernet Control Model. 4481da177e4SLinus Torvalds That protocol is often avoided with pure Ethernet adapters, in 4491da177e4SLinus Torvalds favor of simpler vendor-specific hardware, but is widely 4501da177e4SLinus Torvalds supported by firmware for smart network devices. 4511da177e4SLinus Torvalds 4521da177e4SLinus Torvalds - On hardware can't implement that protocol, a simple CDC subset 4531da177e4SLinus Torvalds is used, placing fewer demands on USB. 4541da177e4SLinus Torvalds 4551da177e4SLinus Torvalds RNDIS support is a third option, more demanding than that subset. 4561da177e4SLinus Torvalds 4571da177e4SLinus Torvalds Within the USB device, this gadget driver exposes a network device 4581da177e4SLinus Torvalds "usbX", where X depends on what other networking devices you have. 4591da177e4SLinus Torvalds Treat it like a two-node Ethernet link: host, and gadget. 4601da177e4SLinus Torvalds 4611da177e4SLinus Torvalds The Linux-USB host-side "usbnet" driver interoperates with this 4621da177e4SLinus Torvalds driver, so that deep I/O queues can be supported. On 2.4 kernels, 4631da177e4SLinus Torvalds use "CDCEther" instead, if you're using the CDC option. That CDC 4641da177e4SLinus Torvalds mode should also interoperate with standard CDC Ethernet class 4651da177e4SLinus Torvalds drivers on other host operating systems. 4661da177e4SLinus Torvalds 4671da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 4681da177e4SLinus Torvalds dynamically linked module called "g_ether". 4691da177e4SLinus Torvalds 4701da177e4SLinus Torvaldsconfig USB_ETH_RNDIS 4711da177e4SLinus Torvalds bool "RNDIS support (EXPERIMENTAL)" 4721da177e4SLinus Torvalds depends on USB_ETH && EXPERIMENTAL 4731da177e4SLinus Torvalds default y 4741da177e4SLinus Torvalds help 4751da177e4SLinus Torvalds Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, 4761da177e4SLinus Torvalds and Microsoft provides redistributable binary RNDIS drivers for 4771da177e4SLinus Torvalds older versions of Windows. 4781da177e4SLinus Torvalds 4791da177e4SLinus Torvalds If you say "y" here, the Ethernet gadget driver will try to provide 4801da177e4SLinus Torvalds a second device configuration, supporting RNDIS to talk to such 4811da177e4SLinus Torvalds Microsoft USB hosts. 4821da177e4SLinus Torvalds 4831da177e4SLinus Torvalds To make MS-Windows work with this, use Documentation/usb/linux.inf 4841da177e4SLinus Torvalds as the "driver info file". For versions of MS-Windows older than 4851da177e4SLinus Torvalds XP, you'll need to download drivers from Microsoft's website; a URL 4861da177e4SLinus Torvalds is given in comments found in that info file. 4871da177e4SLinus Torvalds 4881da177e4SLinus Torvaldsconfig USB_GADGETFS 4891da177e4SLinus Torvalds tristate "Gadget Filesystem (EXPERIMENTAL)" 4901da177e4SLinus Torvalds depends on EXPERIMENTAL 4911da177e4SLinus Torvalds help 4921da177e4SLinus Torvalds This driver provides a filesystem based API that lets user mode 4931da177e4SLinus Torvalds programs implement a single-configuration USB device, including 4941da177e4SLinus Torvalds endpoint I/O and control requests that don't relate to enumeration. 4951da177e4SLinus Torvalds All endpoints, transfer speeds, and transfer types supported by 4961da177e4SLinus Torvalds the hardware are available, through read() and write() calls. 4971da177e4SLinus Torvalds 4981da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 4991da177e4SLinus Torvalds dynamically linked module called "gadgetfs". 5001da177e4SLinus Torvalds 5011da177e4SLinus Torvaldsconfig USB_FILE_STORAGE 5021da177e4SLinus Torvalds tristate "File-backed Storage Gadget" 50387840289SRandy Dunlap depends on BLOCK 5041da177e4SLinus Torvalds help 5051da177e4SLinus Torvalds The File-backed Storage Gadget acts as a USB Mass Storage 5061da177e4SLinus Torvalds disk drive. As its storage repository it can use a regular 5071da177e4SLinus Torvalds file or a block device (in much the same way as the "loop" 5081da177e4SLinus Torvalds device driver), specified as a module parameter. 5091da177e4SLinus Torvalds 5101da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 5111da177e4SLinus Torvalds dynamically linked module called "g_file_storage". 5121da177e4SLinus Torvalds 5131da177e4SLinus Torvaldsconfig USB_FILE_STORAGE_TEST 5141da177e4SLinus Torvalds bool "File-backed Storage Gadget testing version" 5151da177e4SLinus Torvalds depends on USB_FILE_STORAGE 5161da177e4SLinus Torvalds default n 5171da177e4SLinus Torvalds help 5181da177e4SLinus Torvalds Say "y" to generate the larger testing version of the 5191da177e4SLinus Torvalds File-backed Storage Gadget, useful for probing the 5201da177e4SLinus Torvalds behavior of USB Mass Storage hosts. Not needed for 5211da177e4SLinus Torvalds normal operation. 5221da177e4SLinus Torvalds 5231da177e4SLinus Torvaldsconfig USB_G_SERIAL 5241da177e4SLinus Torvalds tristate "Serial Gadget (with CDC ACM support)" 5251da177e4SLinus Torvalds help 5261da177e4SLinus Torvalds The Serial Gadget talks to the Linux-USB generic serial driver. 5271da177e4SLinus Torvalds This driver supports a CDC-ACM module option, which can be used 5281da177e4SLinus Torvalds to interoperate with MS-Windows hosts or with the Linux-USB 5291da177e4SLinus Torvalds "cdc-acm" driver. 5301da177e4SLinus Torvalds 5311da177e4SLinus Torvalds Say "y" to link the driver statically, or "m" to build a 5321da177e4SLinus Torvalds dynamically linked module called "g_serial". 5331da177e4SLinus Torvalds 5341da177e4SLinus Torvalds For more information, see Documentation/usb/gadget_serial.txt 5351da177e4SLinus Torvalds which includes instructions and a "driver info file" needed to 5361da177e4SLinus Torvalds make MS-Windows work with this driver. 5371da177e4SLinus Torvalds 538f2ebf92cSBen Williamsonconfig USB_MIDI_GADGET 539f2ebf92cSBen Williamson tristate "MIDI Gadget (EXPERIMENTAL)" 540f2ebf92cSBen Williamson depends on SND && EXPERIMENTAL 541f2ebf92cSBen Williamson select SND_RAWMIDI 542f2ebf92cSBen Williamson help 543f2ebf92cSBen Williamson The MIDI Gadget acts as a USB Audio device, with one MIDI 544f2ebf92cSBen Williamson input and one MIDI output. These MIDI jacks appear as 545f2ebf92cSBen Williamson a sound "card" in the ALSA sound system. Other MIDI 546f2ebf92cSBen Williamson connections can then be made on the gadget system, using 547f2ebf92cSBen Williamson ALSA's aconnect utility etc. 548f2ebf92cSBen Williamson 549f2ebf92cSBen Williamson Say "y" to link the driver statically, or "m" to build a 550f2ebf92cSBen Williamson dynamically linked module called "g_midi". 551f2ebf92cSBen Williamson 55225a010c8SCraig W. Nadlerconfig USB_G_PRINTER 55325a010c8SCraig W. Nadler tristate "Printer Gadget" 55425a010c8SCraig W. Nadler help 55525a010c8SCraig W. Nadler The Printer Gadget channels data between the USB host and a 55625a010c8SCraig W. Nadler userspace program driving the print engine. The user space 55725a010c8SCraig W. Nadler program reads and writes the device file /dev/g_printer to 55825a010c8SCraig W. Nadler receive or send printer data. It can use ioctl calls to 55925a010c8SCraig W. Nadler the device file to get or set printer status. 56025a010c8SCraig W. Nadler 56125a010c8SCraig W. Nadler Say "y" to link the driver statically, or "m" to build a 56225a010c8SCraig W. Nadler dynamically linked module called "g_printer". 56325a010c8SCraig W. Nadler 56425a010c8SCraig W. Nadler For more information, see Documentation/usb/gadget_printer.txt 56525a010c8SCraig W. Nadler which includes sample code for accessing the device file. 5661da177e4SLinus Torvalds 5671da177e4SLinus Torvalds# put drivers that need isochronous transfer support (for audio 5681da177e4SLinus Torvalds# or video class gadget drivers), or specific hardware, here. 5691da177e4SLinus Torvalds 5701da177e4SLinus Torvalds# - none yet 5711da177e4SLinus Torvalds 5721da177e4SLinus Torvaldsendchoice 5731da177e4SLinus Torvalds 574b75be4abSDenis Chengendif # USB_GADGET 575