drivers/usb/gadget/function

USB Gadget Function Drivers (Peripheral-Mode USB Roles)

A collection of USB peripheral-mode "function" modules that a Linux board exposes to a host computer when it acts as a USB device rather than a host. Composed via configfs, they implement roles such as ACM serial, ECM/NCM/RNDIS/EEM Ethernet, mass storage, UVC webcam, UAC audio, MIDI, HID, and printer, and are widely used on SoCs and single-board computers like the Raspberry Pi.

keep conf=0.90 deploy=medium replacement=none subsystem=usb category=bus-usb
90%

recommendation

It should stay because this is the active library of USB peripheral roles that lets a Linux device pretend to be a serial port, network adapter, mass-storage disk, webcam, MIDI device, HID, printer, and more when plugged into a host. Modern hardware still sold in 2025, including Raspberry Pi 4, 5, 500, and Compute Module 5, relies on it for features like SSH-over-USB, and upstream is still landing fixes and refactors through 2026 with no removal discussion in sight.

repository signals

68 files
49,587 source lines
464 commits, 5y
+15,008 / −4,230 lines added / removed, 5y
157 authors, 5y
monthly commits · 2021-04-21 → 2026-04-21 · 464 total · active in 59/61 months
2021 2022 2023 2024 2025 2026 2021-04: 2 commits · +1 −6 2021-05: 4 commits · +13 −10 2021-06: 15 commits · +661 −113 2021-07: 17 commits · +1,759 −156 2021-08: 7 commits · +214 −86 2021-09: 7 commits · +132 −48 2021-10: 17 commits · +262 −70 2021-11: 2 commits · +3 −3 2021-12: 2 commits · +12 −13 2022-01: 24 commits · +949 −212 2022-02: 5 commits · +56 −58 2022-03: 2 commits · +3 −0 2022-04: 10 commits · +233 −149 2022-05: 3 commits · +42 −7 2022-06: 7 commits · +75 −40 2022-07: 4 commits · +65 −19 2022-08: 6 commits · +51 −48 2022-09: 9 commits · +346 −19 2022-10: 7 commits · +74 −82 2022-11: 8 commits · +63 −69 2022-12: 5 commits · +30 −23 2023-01: 9 commits · +126 −57 2023-02: 19 commits · +1,129 −154 2023-03: 7 commits · +213 −134 2023-04: 1 commit · +1 −1 2023-05: 5 commits · +42 −11 2023-06: 6 commits · +55 −47 2023-07: 8 commits · +3,138 −173 2023-08: 10 commits · +95 −180 2023-09: 8 commits · +74 −19 2023-10: 7 commits · +33 −48 2023-11: 8 commits · +391 −150 2023-12: 10 commits · +206 −39 2024-01: 7 commits · +549 −32 2024-02: 10 commits · +99 −68 2024-03: 6 commits · +28 −9 2024-04: 9 commits · +118 −52 2024-05: 0 commits · +0 −0 2024-06: 5 commits · +56 −13 2024-07: 6 commits · +87 −23 2024-08: 10 commits · +477 −96 2024-09: 5 commits · +374 −26 2024-10: 13 commits · +344 −151 2024-11: 3 commits · +15 −13 2024-12: 33 commits · +571 −212 2025-01: 5 commits · +23 −14 2025-02: 5 commits · +7 −8 2025-03: 5 commits · +36 −19 2025-04: 4 commits · +149 −33 2025-05: 3 commits · +9 −2 2025-06: 5 commits · +9 −18 2025-07: 4 commits · +12 −12 2025-08: 5 commits · +12 −8 2025-09: 9 commits · +146 −179 2025-10: 0 commits · +0 −0 2025-11: 7 commits · +65 −29 2025-12: 7 commits · +473 −159 2026-01: 9 commits · +97 −85 2026-02: 9 commits · +233 −227 2026-03: 18 commits · +435 −488 2026-04: 1 commit · +37 −10

sources

  1. git.kernel.org

    Upstream tree history for this directory remains active; local `git log` against the same path showed many 2025-2026 fixes and refactors rather than abandonment.

  2. docs.kernel.org

    Kernel documentation describes these as configfs-selectable USB gadget functions used to compose active gadget devices on systems with a USB Device Controller (UDC), with examples such as `functions/ncm.usb0`.

  3. docs.kernel.org

    Current kernel documentation still documents and tests many functions implemented from this directory, including ACM, ECM, EEM, FFS, HID, mass-storage, MIDI, NCM, RNDIS, serial, UAC, UVC, printer, and others.

  4. raspberrypi.com

    Still-sold Raspberry Pi boards in 2026 (including Raspberry Pi 4, 5, 500/500+, and Compute Module 5) are documented as supporting USB gadget mode, showing ongoing real-world deployment on new hardware.

codex reasoning notes (technical)

Real driver subtree, not an early-exit helper-only path: it contains many `DECLARE_USB_FUNCTION_INIT`/`module_init` entry points for gadget functions. Upstream attention was checked first via local shell: `git -c safe.directory=... log --since=2025-01-01 -- drivers/usb/gadget/function` showed sustained fixes through 2026-04; no lore removal/deprecation hits were found with `web.search_query` against `site:lore.kernel.org`, so I saw no active removal push. `docs.kernel.org` URLs were obtained via web search/open; Raspberry Pi deployment evidence was obtained via web search/open. The git.kernel.org log URL is canonical recall pointing at the same path whose activity was verified locally. This directory is a generic USB peripheral-mode function stack used by modern embedded/SoC hardware, so there is no single replacement driver and removal would regress current gadget use cases.