sound/usb/usx2y/usbusx2yaudio.c
Source file repositories/reference/linux-study-clean/sound/usb/usx2y/usbusx2yaudio.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/usx2y/usbusx2yaudio.c- Extension
.c- Size
- 26763 bytes
- Lines
- 1009
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/slab.hlinux/usb.hlinux/moduleparam.hsound/core.hsound/info.hsound/pcm.hsound/pcm_params.husx2y.husbusx2y.h
Detected Declarations
struct s_c2function Copyrightfunction usx2y_urb_play_preparefunction usx2y_urb_play_retirefunction usx2y_urb_submitfunction usx2y_usbframe_completefunction usx2y_clients_stopfunction usx2y_error_urb_statusfunction i_usx2y_urb_completefunction usx2y_urbs_set_completefunction usx2y_subs_startup_finishfunction i_usx2y_subs_startupfunction usx2y_subs_preparefunction usx2y_urb_releasefunction usx2y_urbs_releasefunction usx2y_urbs_allocatefunction usx2y_subs_startupfunction usx2y_urbs_startfunction snd_usx2y_pcm_pointerfunction snd_usx2y_pcm_triggerfunction i_usx2y_04intfunction usx2y_rate_setfunction usx2y_format_setfunction snd_usx2y_pcm_hw_paramsfunction snd_usx2y_pcm_hw_freefunction snd_usx2y_pcm_preparefunction snd_usx2y_pcm_openfunction snd_usx2y_pcm_closefunction usx2y_audio_stream_freefunction for_each_pcm_streamsfunction snd_usx2y_pcm_private_freefunction usx2y_audio_stream_newfunction usx2y_audio_create
Annotated Snippet
struct s_c2 {
char c1, c2;
};
static const struct s_c2 setrate_44100[] = {
{ 0x14, 0x08}, // this line sets 44100, well actually a little less
{ 0x18, 0x40}, // only tascam / frontier design knows the further lines .......
{ 0x18, 0x42},
{ 0x18, 0x45},
{ 0x18, 0x46},
{ 0x18, 0x48},
{ 0x18, 0x4A},
{ 0x18, 0x4C},
{ 0x18, 0x4E},
{ 0x18, 0x50},
{ 0x18, 0x52},
{ 0x18, 0x54},
{ 0x18, 0x56},
{ 0x18, 0x58},
{ 0x18, 0x5A},
{ 0x18, 0x5C},
{ 0x18, 0x5E},
{ 0x18, 0x60},
{ 0x18, 0x62},
{ 0x18, 0x64},
{ 0x18, 0x66},
{ 0x18, 0x68},
{ 0x18, 0x6A},
{ 0x18, 0x6C},
{ 0x18, 0x6E},
{ 0x18, 0x70},
{ 0x18, 0x72},
{ 0x18, 0x74},
{ 0x18, 0x76},
{ 0x18, 0x78},
{ 0x18, 0x7A},
{ 0x18, 0x7C},
{ 0x18, 0x7E}
};
static const struct s_c2 setrate_48000[] = {
{ 0x14, 0x09}, // this line sets 48000, well actually a little less
{ 0x18, 0x40}, // only tascam / frontier design knows the further lines .......
{ 0x18, 0x42},
{ 0x18, 0x45},
{ 0x18, 0x46},
{ 0x18, 0x48},
{ 0x18, 0x4A},
{ 0x18, 0x4C},
{ 0x18, 0x4E},
{ 0x18, 0x50},
{ 0x18, 0x52},
{ 0x18, 0x54},
{ 0x18, 0x56},
{ 0x18, 0x58},
{ 0x18, 0x5A},
{ 0x18, 0x5C},
{ 0x18, 0x5E},
{ 0x18, 0x60},
{ 0x18, 0x62},
{ 0x18, 0x64},
{ 0x18, 0x66},
{ 0x18, 0x68},
{ 0x18, 0x6A},
{ 0x18, 0x6C},
{ 0x18, 0x6E},
{ 0x18, 0x70},
{ 0x18, 0x73},
{ 0x18, 0x74},
{ 0x18, 0x76},
{ 0x18, 0x78},
{ 0x18, 0x7A},
{ 0x18, 0x7C},
{ 0x18, 0x7E}
};
#define NOOF_SETRATE_URBS ARRAY_SIZE(setrate_48000)
static void i_usx2y_04int(struct urb *urb)
{
struct usx2ydev *usx2y = urb->context;
if (urb->status)
dev_err(&urb->dev->dev, "%s() urb->status=%i\n",
__func__, urb->status);
if (!--usx2y->us04->len)
wake_up(&usx2y->in04_wait_queue);
}
static int usx2y_rate_set(struct usx2ydev *usx2y, int rate)
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/slab.h`, `linux/usb.h`, `linux/moduleparam.h`, `sound/core.h`, `sound/info.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `struct s_c2`, `function Copyright`, `function usx2y_urb_play_prepare`, `function usx2y_urb_play_retire`, `function usx2y_urb_submit`, `function usx2y_usbframe_complete`, `function usx2y_clients_stop`, `function usx2y_error_urb_status`, `function i_usx2y_urb_complete`, `function usx2y_urbs_set_complete`.
- Atlas domain: Driver Families / sound/usb.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.