sound/usb/usx2y/us144mkii.h
Source file repositories/reference/linux-study-clean/sound/usb/usx2y/us144mkii.h
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/usx2y/us144mkii.h- Extension
.h- Size
- 13066 bytes
- Lines
- 368
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kfifo.hlinux/timer.hlinux/usb.hlinux/workqueue.hsound/control.hsound/core.hsound/initval.hsound/pcm.hsound/rawmidi.hus144mkii_pcm.h
Detected Declarations
struct us144mkii_frame_pattern_observerstruct tascam_cardenum uac_requestenum uac_control_selectorenum tascam_vendor_requestenum tascam_mode_valueenum tascam_register
Annotated Snippet
struct us144mkii_frame_pattern_observer {
unsigned int sample_rate_khz;
unsigned int base_feedback_value;
int feedback_offset;
unsigned int full_frame_patterns[5][8];
unsigned int current_index;
unsigned int previous_index;
bool sync_locked;
};
/**
* struct tascam_card - Main driver data structure for the TASCAM US-144MKII.
* @dev: Pointer to the USB device.
* @iface0: Pointer to USB interface 0 (audio).
* @iface1: Pointer to USB interface 1 (MIDI).
* @card: Pointer to the ALSA sound card instance.
* @pcm: Pointer to the ALSA PCM device.
* @rmidi: Pointer to the ALSA rawmidi device.
*
* @playback_substream: Pointer to the active playback PCM substream.
* @playback_urbs: Array of URBs for playback.
* @playback_urb_alloc_size: Size of allocated buffer for each playback URB.
* @feedback_urbs: Array of URBs for feedback.
* @feedback_urb_alloc_size: Size of allocated buffer for each feedback URB.
* @playback_active: Atomic flag indicating if playback is active.
* @playback_frames_consumed: Total frames consumed by playback.
* @driver_playback_pos: Current position in the ALSA playback buffer (frames).
* @last_period_pos: Last reported period position for playback.
*
* @capture_substream: Pointer to the active capture PCM substream.
* @capture_urbs: Array of URBs for capture.
* @capture_urb_alloc_size: Size of allocated buffer for each capture URB.
* @capture_active: Atomic flag indicating if capture is active.
* @driver_capture_pos: Current position in the ALSA capture buffer (frames).
* @capture_frames_processed: Total frames processed for capture.
* @last_capture_period_pos: Last reported period position for capture.
* @capture_ring_buffer: Ring buffer for raw capture data from USB.
* @capture_ring_buffer_read_ptr: Read pointer for the capture ring buffer.
* @capture_ring_buffer_write_ptr: Write pointer for the capture ring buffer.
* @capture_decode_raw_block: Buffer for a raw 512-byte capture block.
* @capture_decode_dst_block: Buffer for decoded 32-bit capture samples.
* @capture_routing_buffer: Intermediate buffer for capture routing.
* @capture_work: Work struct for deferred capture processing.
* @stop_work: Work struct for deferred stream stopping.
* @stop_pcm_work: Work struct for stopping PCM due to a fatal error (e.g.
* xrun).
*
* @midi_in_substream: Pointer to the active MIDI input substream.
* @midi_out_substream: Pointer to the active MIDI output substream.
* @midi_in_urbs: Array of URBs for MIDI input.
* @midi_out_urbs: Array of URBs for MIDI output.
* @midi_in_active: Atomic flag indicating if MIDI input is active.
* @midi_out_active: Atomic flag indicating if MIDI output is active.
* @midi_in_fifo: FIFO for raw MIDI input data.
* @midi_in_work: Work struct for deferred MIDI input processing.
* @midi_out_work: Work struct for deferred MIDI output processing.
* @midi_in_lock: Spinlock for MIDI input FIFO.
* @midi_out_lock: Spinlock for MIDI output.
* @midi_out_urbs_in_flight: Bitmap of MIDI output URBs currently in flight.
* @midi_running_status: Stores the last MIDI status byte for running status.
* @error_timer: Timer for MIDI error retry logic.
*
* @lock: Main spinlock for protecting shared driver state.
* @active_urbs: Atomic counter for active URBs.
* @current_rate: Currently configured sample rate of the device.
* @line_out_source: Source for Line Outputs (0: Playback 1-2, 1: Playback 3-4).
* @digital_out_source: Source for Digital Outputs (0: Playback 1-2, 1: Playback
* 3-4).
* @capture_12_source: Source for Capture channels 1-2 (0: Analog In, 1: Digital
* In).
* @capture_34_source: Source for Capture channels 3-4 (0: Analog In, 1: Digital
* In).
*
* @feedback_accumulator_pattern: Stores the calculated frames per packet for
* feedback.
* @feedback_pattern_out_idx: Read index for feedback_accumulator_pattern.
* @feedback_pattern_in_idx: Write index for feedback_accumulator_pattern.
* @feedback_synced: Flag indicating if feedback is synced.
* @feedback_consecutive_errors: Counter for consecutive feedback errors.
* @feedback_urb_skip_count: Number of feedback URBs to skip initially for
* stabilization.
* @fpo: Holds the state for the dynamic feedback pattern generation.
*
* @playback_anchor: USB anchor for playback URBs.
* @capture_anchor: USB anchor for capture URBs.
* @feedback_anchor: USB anchor for feedback URBs.
* @midi_in_anchor: USB anchor for MIDI input URBs.
* @midi_out_anchor: USB anchor for MIDI output URBs.
*/
struct tascam_card {
Annotation
- Immediate include surface: `linux/kfifo.h`, `linux/timer.h`, `linux/usb.h`, `linux/workqueue.h`, `sound/control.h`, `sound/core.h`, `sound/initval.h`, `sound/pcm.h`.
- Detected declarations: `struct us144mkii_frame_pattern_observer`, `struct tascam_card`, `enum uac_request`, `enum uac_control_selector`, `enum tascam_vendor_request`, `enum tascam_mode_value`, `enum tascam_register`.
- 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.