Kconfig 18 KB

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