Kconfig 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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 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_U_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_U_AUDIO
  137. tristate
  138. config USB_F_SERIAL
  139. tristate
  140. config USB_F_OBEX
  141. tristate
  142. config USB_F_NCM
  143. tristate
  144. config USB_F_ECM
  145. tristate
  146. config USB_F_PHONET
  147. tristate
  148. config USB_F_EEM
  149. tristate
  150. config USB_F_SUBSET
  151. tristate
  152. config USB_F_RNDIS
  153. tristate
  154. config USB_F_MASS_STORAGE
  155. tristate
  156. config USB_F_FS
  157. tristate
  158. config USB_F_UAC1
  159. tristate
  160. config USB_F_UAC1_LEGACY
  161. tristate
  162. config USB_F_UAC2
  163. tristate
  164. config USB_F_UVC
  165. tristate
  166. config USB_F_MIDI
  167. tristate
  168. config USB_F_HID
  169. tristate
  170. config USB_F_PRINTER
  171. tristate
  172. config USB_F_TCM
  173. tristate
  174. # this first set of drivers all depend on bulk-capable hardware.
  175. config USB_CONFIGFS
  176. tristate "USB Gadget functions configurable through configfs"
  177. select USB_LIBCOMPOSITE
  178. help
  179. A Linux USB "gadget" can be set up through configfs.
  180. If this is the case, the USB functions (which from the host's
  181. perspective are seen as interfaces) and configurations are
  182. specified simply by creating appropriate directories in configfs.
  183. Associating functions with configurations is done by creating
  184. appropriate symbolic links.
  185. For more information see Documentation/usb/gadget_configfs.txt.
  186. config USB_CONFIGFS_SERIAL
  187. bool "Generic serial bulk in/out"
  188. depends on USB_CONFIGFS
  189. depends on TTY
  190. select USB_U_SERIAL
  191. select USB_F_SERIAL
  192. help
  193. The function talks to the Linux-USB generic serial driver.
  194. config USB_CONFIGFS_ACM
  195. bool "Abstract Control Model (CDC ACM)"
  196. depends on USB_CONFIGFS
  197. depends on TTY
  198. select USB_U_SERIAL
  199. select USB_F_ACM
  200. help
  201. ACM serial link. This function can be used to interoperate with
  202. MS-Windows hosts or with the Linux-USB "cdc-acm" driver.
  203. config USB_CONFIGFS_OBEX
  204. bool "Object Exchange Model (CDC OBEX)"
  205. depends on USB_CONFIGFS
  206. depends on TTY
  207. select USB_U_SERIAL
  208. select USB_F_OBEX
  209. help
  210. You will need a user space OBEX server talking to /dev/ttyGS*,
  211. since the kernel itself doesn't implement the OBEX protocol.
  212. config USB_CONFIGFS_NCM
  213. bool "Network Control Model (CDC NCM)"
  214. depends on USB_CONFIGFS
  215. depends on NET
  216. select USB_U_ETHER
  217. select USB_F_NCM
  218. help
  219. NCM is an advanced protocol for Ethernet encapsulation, allows
  220. grouping of several ethernet frames into one USB transfer and
  221. different alignment possibilities.
  222. config USB_CONFIGFS_ECM
  223. bool "Ethernet Control Model (CDC ECM)"
  224. depends on USB_CONFIGFS
  225. depends on NET
  226. select USB_U_ETHER
  227. select USB_F_ECM
  228. help
  229. The "Communication Device Class" (CDC) Ethernet Control Model.
  230. That protocol is often avoided with pure Ethernet adapters, in
  231. favor of simpler vendor-specific hardware, but is widely
  232. supported by firmware for smart network devices.
  233. config USB_CONFIGFS_ECM_SUBSET
  234. bool "Ethernet Control Model (CDC ECM) subset"
  235. depends on USB_CONFIGFS
  236. depends on NET
  237. select USB_U_ETHER
  238. select USB_F_SUBSET
  239. help
  240. On hardware that can't implement the full protocol,
  241. a simple CDC subset is used, placing fewer demands on USB.
  242. config USB_CONFIGFS_RNDIS
  243. bool "RNDIS"
  244. depends on USB_CONFIGFS
  245. depends on NET
  246. select USB_U_ETHER
  247. select USB_F_RNDIS
  248. help
  249. Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
  250. and Microsoft provides redistributable binary RNDIS drivers for
  251. older versions of Windows.
  252. To make MS-Windows work with this, use Documentation/usb/linux.inf
  253. as the "driver info file". For versions of MS-Windows older than
  254. XP, you'll need to download drivers from Microsoft's website; a URL
  255. is given in comments found in that info file.
  256. config USB_CONFIGFS_EEM
  257. bool "Ethernet Emulation Model (EEM)"
  258. depends on USB_CONFIGFS
  259. depends on NET
  260. select USB_U_ETHER
  261. select USB_F_EEM
  262. help
  263. CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
  264. and therefore can be supported by more hardware. Technically ECM and
  265. EEM are designed for different applications. The ECM model extends
  266. the network interface to the target (e.g. a USB cable modem), and the
  267. EEM model is for mobile devices to communicate with hosts using
  268. ethernet over USB. For Linux gadgets, however, the interface with
  269. the host is the same (a usbX device), so the differences are minimal.
  270. config USB_CONFIGFS_PHONET
  271. bool "Phonet protocol"
  272. depends on USB_CONFIGFS
  273. depends on NET
  274. depends on PHONET
  275. select USB_U_ETHER
  276. select USB_F_PHONET
  277. help
  278. The Phonet protocol implementation for USB device.
  279. config USB_CONFIGFS_MASS_STORAGE
  280. bool "Mass storage"
  281. depends on USB_CONFIGFS
  282. depends on BLOCK
  283. select USB_F_MASS_STORAGE
  284. help
  285. The Mass Storage Gadget acts as a USB Mass Storage disk drive.
  286. As its storage repository it can use a regular file or a block
  287. device (in much the same way as the "loop" device driver),
  288. specified as a module parameter or sysfs option.
  289. config USB_CONFIGFS_F_LB_SS
  290. bool "Loopback and sourcesink function (for testing)"
  291. depends on USB_CONFIGFS
  292. select USB_F_SS_LB
  293. help
  294. Loopback function loops back a configurable number of transfers.
  295. Sourcesink function either sinks and sources bulk data.
  296. It also implements control requests, for "chapter 9" conformance.
  297. Make this be the first driver you try using on top of any new
  298. USB peripheral controller driver. Then you can use host-side
  299. test software, like the "usbtest" driver, to put your hardware
  300. and its driver through a basic set of functional tests.
  301. config USB_CONFIGFS_F_FS
  302. bool "Function filesystem (FunctionFS)"
  303. depends on USB_CONFIGFS
  304. select USB_F_FS
  305. help
  306. The Function Filesystem (FunctionFS) lets one create USB
  307. composite functions in user space in the same way GadgetFS
  308. lets one create USB gadgets in user space. This allows creation
  309. of composite gadgets such that some of the functions are
  310. implemented in kernel space (for instance Ethernet, serial or
  311. mass storage) and other are implemented in user space.
  312. config USB_CONFIGFS_F_UAC1
  313. bool "Audio Class 1.0"
  314. depends on USB_CONFIGFS
  315. depends on SND
  316. select USB_LIBCOMPOSITE
  317. select SND_PCM
  318. select USB_U_AUDIO
  319. select USB_F_UAC1
  320. help
  321. This Audio function implements 1 AudioControl interface,
  322. 1 AudioStreaming Interface each for USB-OUT and USB-IN.
  323. This driver doesn't expect any real Audio codec to be present
  324. on the device - the audio streams are simply sinked to and
  325. sourced from a virtual ALSA sound card created. The user-space
  326. application may choose to do whatever it wants with the data
  327. received from the USB Host and choose to provide whatever it
  328. wants as audio data to the USB Host.
  329. config USB_CONFIGFS_F_UAC1_LEGACY
  330. bool "Audio Class 1.0 (legacy implementation)"
  331. depends on USB_CONFIGFS
  332. depends on SND
  333. select USB_LIBCOMPOSITE
  334. select SND_PCM
  335. select USB_F_UAC1_LEGACY
  336. help
  337. This Audio function implements 1 AudioControl interface,
  338. 1 AudioStreaming Interface each for USB-OUT and USB-IN.
  339. This is a legacy driver and requires a real Audio codec
  340. to be present on the device.
  341. config USB_CONFIGFS_F_UAC2
  342. bool "Audio Class 2.0"
  343. depends on USB_CONFIGFS
  344. depends on SND
  345. select USB_LIBCOMPOSITE
  346. select SND_PCM
  347. select USB_U_AUDIO
  348. select USB_F_UAC2
  349. help
  350. This Audio function is compatible with USB Audio Class
  351. specification 2.0. It implements 1 AudioControl interface,
  352. 1 AudioStreaming Interface each for USB-OUT and USB-IN.
  353. This driver doesn't expect any real Audio codec to be present
  354. on the device - the audio streams are simply sinked to and
  355. sourced from a virtual ALSA sound card created. The user-space
  356. application may choose to do whatever it wants with the data
  357. received from the USB Host and choose to provide whatever it
  358. wants as audio data to the USB Host.
  359. config USB_CONFIGFS_F_MIDI
  360. bool "MIDI function"
  361. depends on USB_CONFIGFS
  362. depends on SND
  363. select USB_LIBCOMPOSITE
  364. select SND_RAWMIDI
  365. select USB_F_MIDI
  366. help
  367. The MIDI Function acts as a USB Audio device, with one MIDI
  368. input and one MIDI output. These MIDI jacks appear as
  369. a sound "card" in the ALSA sound system. Other MIDI
  370. connections can then be made on the gadget system, using
  371. ALSA's aconnect utility etc.
  372. config USB_CONFIGFS_F_HID
  373. bool "HID function"
  374. depends on USB_CONFIGFS
  375. select USB_F_HID
  376. help
  377. The HID function driver provides generic emulation of USB
  378. Human Interface Devices (HID).
  379. For more information, see Documentation/usb/gadget_hid.txt.
  380. config USB_CONFIGFS_F_UVC
  381. bool "USB Webcam function"
  382. depends on USB_CONFIGFS
  383. depends on VIDEO_V4L2
  384. depends on VIDEO_DEV
  385. select VIDEOBUF2_VMALLOC
  386. select USB_F_UVC
  387. help
  388. The Webcam function acts as a composite USB Audio and Video Class
  389. device. It provides a userspace API to process UVC control requests
  390. and stream video data to the host.
  391. config USB_CONFIGFS_F_PRINTER
  392. bool "Printer function"
  393. select USB_F_PRINTER
  394. depends on USB_CONFIGFS
  395. help
  396. The Printer function channels data between the USB host and a
  397. userspace program driving the print engine. The user space
  398. program reads and writes the device file /dev/g_printer<X> to
  399. receive or send printer data. It can use ioctl calls to
  400. the device file to get or set printer status.
  401. For more information, see Documentation/usb/gadget_printer.txt
  402. which includes sample code for accessing the device file.
  403. config USB_CONFIGFS_F_TCM
  404. bool "USB Gadget Target Fabric"
  405. depends on TARGET_CORE
  406. depends on USB_CONFIGFS
  407. select USB_LIBCOMPOSITE
  408. select USB_F_TCM
  409. help
  410. This fabric is a USB gadget component. Two USB protocols are
  411. supported that is BBB or BOT (Bulk Only Transport) and UAS
  412. (USB Attached SCSI). BOT is advertised on alternative
  413. interface 0 (primary) and UAS is on alternative interface 1.
  414. Both protocols can work on USB2.0 and USB3.0.
  415. UAS utilizes the USB 3.0 feature called streams support.
  416. choice
  417. tristate "USB Gadget precomposed configurations"
  418. default USB_ETH
  419. optional
  420. help
  421. A Linux "Gadget Driver" talks to the USB Peripheral Controller
  422. driver through the abstract "gadget" API. Some other operating
  423. systems call these "client" drivers, of which "class drivers"
  424. are a subset (implementing a USB device class specification).
  425. A gadget driver implements one or more USB functions using
  426. the peripheral hardware.
  427. Gadget drivers are hardware-neutral, or "platform independent",
  428. except that they sometimes must understand quirks or limitations
  429. of the particular controllers they work with. For example, when
  430. a controller doesn't support alternate configurations or provide
  431. enough of the right types of endpoints, the gadget driver might
  432. not be able work with that controller, or might need to implement
  433. a less common variant of a device class protocol.
  434. The available choices each represent a single precomposed USB
  435. gadget configuration. In the device model, each option contains
  436. both the device instantiation as a child for a USB gadget
  437. controller, and the relevant drivers for each function declared
  438. by the device.
  439. source "drivers/usb/gadget/legacy/Kconfig"
  440. endchoice
  441. endif # USB_GADGET