sound/firewire/bebob/bebob.h

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

File Facts

System
Linux kernel
Corpus path
sound/firewire/bebob/bebob.h
Extension
.h
Size
8008 bytes
Lines
257
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_bebob_stream_formation {
	unsigned int pcm;
	unsigned int midi;
};
/* this is a lookup table for index of stream formations */
extern const unsigned int snd_bebob_rate_table[SND_BEBOB_STRM_FMT_ENTRIES];

/* device specific operations */
enum snd_bebob_clock_type {
	SND_BEBOB_CLOCK_TYPE_INTERNAL = 0,
	SND_BEBOB_CLOCK_TYPE_EXTERNAL,
	SND_BEBOB_CLOCK_TYPE_SYT,
};
struct snd_bebob_clock_spec {
	unsigned int num;
	const char *const *labels;
	const enum snd_bebob_clock_type *types;
	int (*get)(struct snd_bebob *bebob, unsigned int *id);
};
struct snd_bebob_rate_spec {
	int (*get)(struct snd_bebob *bebob, unsigned int *rate);
	int (*set)(struct snd_bebob *bebob, unsigned int rate);
};
struct snd_bebob_meter_spec {
	unsigned int num;
	const char *const *labels;
	int (*get)(struct snd_bebob *bebob, u32 *target, unsigned int size);
};
struct snd_bebob_spec {
	const struct snd_bebob_clock_spec *clock;
	const struct snd_bebob_rate_spec *rate;
	const struct snd_bebob_meter_spec *meter;
};

enum snd_bebob_quirk {
	SND_BEBOB_QUIRK_INITIAL_DISCONTINUOUS_DBC = (1 << 0),
	SND_BEBOB_QUIRK_WRONG_DBC		  = (1 << 1),
};

struct snd_bebob {
	struct snd_card *card;
	struct fw_unit *unit;
	int card_index;

	struct mutex mutex;
	spinlock_t lock;

	const struct snd_bebob_spec *spec;
	unsigned int quirks;	// Combination of snd_bebob_quirk enumerations.

	unsigned int midi_input_ports;
	unsigned int midi_output_ports;

	struct amdtp_stream tx_stream;
	struct amdtp_stream rx_stream;
	struct cmp_connection out_conn;
	struct cmp_connection in_conn;
	unsigned int substreams_counter;

	struct snd_bebob_stream_formation
		tx_stream_formations[SND_BEBOB_STRM_FMT_ENTRIES];
	struct snd_bebob_stream_formation
		rx_stream_formations[SND_BEBOB_STRM_FMT_ENTRIES];

	int sync_input_plug;

	/* for uapi */
	int dev_lock_count;
	bool dev_lock_changed;
	wait_queue_head_t hwdep_wait;

	/* for M-Audio special devices */
	void *maudio_special_quirk;

	struct amdtp_domain domain;
};

static inline int
snd_bebob_read_block(struct fw_unit *unit, u64 addr, void *buf, int size)
{
	return snd_fw_transaction(unit, TCODE_READ_BLOCK_REQUEST,
				  BEBOB_ADDR_REG_INFO + addr,
				  buf, size, 0);
}

static inline int
snd_bebob_read_quad(struct fw_unit *unit, u64 addr, u32 *buf)
{
	return snd_fw_transaction(unit, TCODE_READ_QUADLET_REQUEST,
				  BEBOB_ADDR_REG_INFO + addr,

Annotation

Implementation Notes