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.

Dependency Surface

Detected Declarations

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

Implementation Notes