Kconfig 15 KB

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