sound/usb/implicit.c
Source file repositories/reference/linux-study-clean/sound/usb/implicit.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/implicit.c- Extension
.c- Size
- 15107 bytes
- Lines
- 495
- Domain
- Driver Families
- Bucket
- sound/usb
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/usb.hlinux/usb/audio.hlinux/usb/audio-v2.hsound/core.hsound/pcm.hsound/pcm_params.husbaudio.hcard.hhelper.hpcm.himplicit.h
Detected Declarations
struct snd_usb_implicit_fb_matchfunction add_implicit_fb_sync_epfunction add_generic_uac2_implicit_fbfunction roland_sanity_check_ifacefunction add_roland_implicit_fbfunction add_roland_capture_quirkfunction is_pioneer_implicit_fbfunction __add_generic_implicit_fbfunction add_generic_implicit_fbfunction find_implicit_fb_entryfunction audioformat_implicit_fb_quirkfunction audioformat_capture_quirkfunction snd_usb_parse_implicit_fb_quirkfunction match_endpoint_audioformatsfunction find_matching_substreamfunction list_for_each_entryfunction snd_usb_find_implicit_fb_sync_format
Annotated Snippet
struct snd_usb_implicit_fb_match {
unsigned int id;
unsigned int iface_class;
unsigned int ep_num;
unsigned int iface;
int type;
};
#define IMPLICIT_FB_GENERIC_DEV(vend, prod) \
{ .id = USB_ID(vend, prod), .type = IMPLICIT_FB_GENERIC }
#define IMPLICIT_FB_FIXED_DEV(vend, prod, ep, ifnum) \
{ .id = USB_ID(vend, prod), .type = IMPLICIT_FB_FIXED, .ep_num = (ep),\
.iface = (ifnum) }
#define IMPLICIT_FB_BOTH_DEV(vend, prod, ep, ifnum) \
{ .id = USB_ID(vend, prod), .type = IMPLICIT_FB_BOTH, .ep_num = (ep),\
.iface = (ifnum) }
#define IMPLICIT_FB_SKIP_DEV(vend, prod) \
{ .id = USB_ID(vend, prod), .type = IMPLICIT_FB_NONE }
/* Implicit feedback quirk table for playback */
static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = {
/* Fixed EP */
/* FIXME: check the availability of generic matching */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2030, 0x81, 3), /* M-Audio Fast Track C400 */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2031, 0x81, 3), /* M-Audio Fast Track C600 */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2080, 0x81, 2), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2081, 0x81, 2), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal Audio Axe-Fx III */
IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0001, 0x81, 2), /* Solid State Logic SSL2 */
IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State Logic SSL2+ */
IMPLICIT_FB_FIXED_DEV(0x0499, 0x172f, 0x81, 2), /* Steinberg UR22C */
IMPLICIT_FB_FIXED_DEV(0x0d9a, 0x00df, 0x81, 2), /* RTX6001 */
IMPLICIT_FB_FIXED_DEV(0x19f7, 0x000a, 0x84, 3), /* RODE AI-1 */
IMPLICIT_FB_FIXED_DEV(0x22f0, 0x0006, 0x81, 3), /* Allen&Heath Qu-16 */
IMPLICIT_FB_FIXED_DEV(0x1686, 0xf029, 0x82, 2), /* Zoom UAC-2 */
IMPLICIT_FB_FIXED_DEV(0x2466, 0x8003, 0x86, 2), /* Fractal Audio Axe-Fx II */
IMPLICIT_FB_FIXED_DEV(0x0499, 0x172a, 0x86, 2), /* Yamaha MODX */
/* Special matching */
{ .id = USB_ID(0x07fd, 0x0004), .iface_class = USB_CLASS_AUDIO,
.type = IMPLICIT_FB_NONE }, /* MicroBook IIc */
/* ep = 0x84, ifnum = 0 */
{ .id = USB_ID(0x07fd, 0x0004), .iface_class = USB_CLASS_VENDOR_SPEC,
.type = IMPLICIT_FB_FIXED,
.ep_num = 0x84, .iface = 0 }, /* MOTU MicroBook II */
{} /* terminator */
};
/* Implicit feedback quirk table for capture: only FIXED type */
static const struct snd_usb_implicit_fb_match capture_implicit_fb_quirks[] = {
{} /* terminator */
};
/* set up sync EP information on the audioformat */
static int add_implicit_fb_sync_ep(struct snd_usb_audio *chip,
struct audioformat *fmt,
int ep, int ep_idx, int ifnum,
const struct usb_host_interface *alts)
{
struct usb_interface *iface;
if (!alts) {
iface = usb_ifnum_to_if(chip->dev, ifnum);
if (!iface || iface->num_altsetting < 2)
return 0;
alts = &iface->altsetting[1];
}
fmt->sync_ep = ep;
fmt->sync_iface = ifnum;
fmt->sync_altsetting = alts->desc.bAlternateSetting;
fmt->sync_ep_idx = ep_idx;
fmt->implicit_fb = 1;
usb_audio_dbg(chip,
"%d:%d: added %s implicit_fb sync_ep %x, iface %d:%d\n",
fmt->iface, fmt->altsetting,
(ep & USB_DIR_IN) ? "playback" : "capture",
fmt->sync_ep, fmt->sync_iface, fmt->sync_altsetting);
return 1;
}
/* Check whether the given UAC2 iface:altset points to an implicit fb source */
static int add_generic_uac2_implicit_fb(struct snd_usb_audio *chip,
struct audioformat *fmt,
unsigned int ifnum,
unsigned int altsetting)
{
struct usb_host_interface *alts;
struct usb_endpoint_descriptor *epd;
Annotation
- Immediate include surface: `linux/init.h`, `linux/usb.h`, `linux/usb/audio.h`, `linux/usb/audio-v2.h`, `sound/core.h`, `sound/pcm.h`, `sound/pcm_params.h`, `usbaudio.h`.
- Detected declarations: `struct snd_usb_implicit_fb_match`, `function add_implicit_fb_sync_ep`, `function add_generic_uac2_implicit_fb`, `function roland_sanity_check_iface`, `function add_roland_implicit_fb`, `function add_roland_capture_quirk`, `function is_pioneer_implicit_fb`, `function __add_generic_implicit_fb`, `function add_generic_implicit_fb`, `function find_implicit_fb_entry`.
- Atlas domain: Driver Families / sound/usb.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.