sound/x86/intel_hdmi_audio.h

Source file repositories/reference/linux-study-clean/sound/x86/intel_hdmi_audio.h

File Facts

System
Linux kernel
Corpus path
sound/x86/intel_hdmi_audio.h
Extension
.h
Size
3444 bytes
Lines
126
Domain
Driver Families
Bucket
sound/x86
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 cea_channel_speaker_allocation {
	int ca_index;
	int speakers[8];

	/* derived values, just for convenience */
	int channels;
	int spk_mask;
};

struct channel_map_table {
	unsigned char map;              /* ALSA API channel map position */
	unsigned char cea_slot;         /* CEA slot value */
	int spk_mask;                   /* speaker position bit mask */
};

struct pcm_stream_info {
	struct snd_pcm_substream *substream;
	int substream_refcount;
};

/*
 * struct snd_intelhad - intelhad driver structure
 *
 * @card: ptr to hold card details
 * @connected: the monitor connection status
 * @stream_info: stream information
 * @eld: holds ELD info
 * @curr_buf: pointer to hold current active ring buf
 * @valid_buf_cnt: ring buffer count for stream
 * @had_spinlock: driver lock
 * @aes_bits: IEC958 status bits
 * @buff_done: id of current buffer done intr
 * @dev: platform device handle
 * @chmap: holds channel map info
 */
struct snd_intelhad {
	struct snd_intelhad_card *card_ctx;
	bool		connected;
	struct		pcm_stream_info stream_info;
	unsigned char	eld[HDMI_MAX_ELD_BYTES];
	bool dp_output;
	unsigned int	aes_bits;
	spinlock_t had_spinlock;
	struct device *dev;
	struct snd_pcm_chmap *chmap;
	int tmds_clock_speed;
	int link_rate;
	int port; /* fixed */
	int pipe; /* can change dynamically */

	/* ring buffer (BD) position index */
	unsigned int bd_head;
	/* PCM buffer position indices */
	unsigned int pcmbuf_head;	/* being processed */
	unsigned int pcmbuf_filled;	/* to be filled */

	unsigned int num_bds;		/* number of BDs */
	unsigned int period_bytes;	/* PCM period size in bytes */

	/* internal stuff */
	union aud_cfg aud_config;	/* AUD_CONFIG reg value cache */
	struct work_struct hdmi_audio_wq;
	struct mutex mutex; /* for protecting chmap and eld */
	struct snd_jack *jack;
};

struct snd_intelhad_card {
	struct snd_card	*card;
	struct device *dev;

	/* internal stuff */
	int irq;
	void __iomem *mmio_start;
	int num_pipes;
	int num_ports;
	struct snd_intelhad pcm_ctx[3]; /* one for each port */
};

#endif /* _INTEL_HDMI_AUDIO_ */

Annotation

Implementation Notes