sound/firewire/motu/motu.h

Source file repositories/reference/linux-study-clean/sound/firewire/motu/motu.h

File Facts

System
Linux kernel
Corpus path
sound/firewire/motu/motu.h
Extension
.h
Size
10753 bytes
Lines
300
Domain
Driver Families
Bucket
sound/firewire
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 snd_motu_packet_format {
	unsigned char midi_flag_offset;
	unsigned char midi_byte_offset;
	unsigned char pcm_byte_offset;

	unsigned char msg_chunks;
	unsigned char pcm_chunks[3];
};

struct amdtp_motu_cache {
	unsigned int *event_offsets;
	unsigned int size;
	unsigned int tail;
	unsigned int tx_cycle_count;
	unsigned int head;
	unsigned int rx_cycle_count;
};

struct snd_motu {
	struct snd_card *card;
	struct fw_unit *unit;
	struct mutex mutex;
	spinlock_t lock;

	/* Model dependent information. */
	const struct snd_motu_spec *spec;

	/* For packet streaming */
	struct snd_motu_packet_format tx_packet_formats;
	struct snd_motu_packet_format rx_packet_formats;
	struct amdtp_stream tx_stream;
	struct amdtp_stream rx_stream;
	struct fw_iso_resources tx_resources;
	struct fw_iso_resources rx_resources;
	unsigned int substreams_counter;

	/* For notification. */
	struct fw_address_handler async_handler;
	u32 msg;

	/* For uapi */
	int dev_lock_count;
	bool dev_lock_changed;
	wait_queue_head_t hwdep_wait;
	struct snd_hwdep *hwdep;

	struct amdtp_domain domain;

	struct amdtp_motu_cache cache;

	void *message_parser;
};

enum snd_motu_spec_flags {
	SND_MOTU_SPEC_RX_MIDI_2ND_Q	= 0x0001,
	SND_MOTU_SPEC_RX_MIDI_3RD_Q	= 0x0002,
	SND_MOTU_SPEC_TX_MIDI_2ND_Q	= 0x0004,
	SND_MOTU_SPEC_TX_MIDI_3RD_Q	= 0x0008,
	SND_MOTU_SPEC_REGISTER_DSP	= 0x0010,
	SND_MOTU_SPEC_COMMAND_DSP	= 0x0020,
};

#define SND_MOTU_CLOCK_RATE_COUNT	6
extern const unsigned int snd_motu_clock_rates[SND_MOTU_CLOCK_RATE_COUNT];

enum snd_motu_clock_source {
	SND_MOTU_CLOCK_SOURCE_INTERNAL,
	SND_MOTU_CLOCK_SOURCE_ADAT_ON_DSUB,
	SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT,
	SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT_A,
	SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT_B,
	SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT,
	SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT_A,
	SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT_B,
	SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX,
	SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR,
	SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC,
	SND_MOTU_CLOCK_SOURCE_SPH,
	SND_MOTU_CLOCK_SOURCE_UNKNOWN,
};

enum snd_motu_protocol_version {
	SND_MOTU_PROTOCOL_V1,
	SND_MOTU_PROTOCOL_V2,
	SND_MOTU_PROTOCOL_V3,
};

struct snd_motu_spec {
	const char *const name;
	enum snd_motu_protocol_version protocol_version;

Annotation

Implementation Notes