sound/soc/ti/j721e-evm.c

Source file repositories/reference/linux-study-clean/sound/soc/ti/j721e-evm.c

File Facts

System
Linux kernel
Corpus path
sound/soc/ti/j721e-evm.c
Extension
.c
Size
26654 bytes
Lines
922
Domain
Driver Families
Bucket
sound/soc
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 j721e_audio_match_data {
	enum j721e_board_type board_type;
	int num_links;
	unsigned int pll_rates[2];
};

static unsigned int ratios_for_pcm3168a[] = {
	256,
	512,
	768,
};

struct j721e_audio_clocks {
	struct clk *target;
	struct clk *parent[2];
};

struct j721e_audio_domain {
	struct j721e_audio_clocks codec;
	struct j721e_audio_clocks mcasp;
	int parent_clk_id;

	int active;
	unsigned int active_link;
	unsigned int rate;
};

struct j721e_priv {
	struct device *dev;
	struct snd_soc_card card;
	struct snd_soc_codec_conf codec_conf[J721E_CODEC_CONF_COUNT];
	struct snd_interval rate_range;
	const struct j721e_audio_match_data *match_data;
	u32 pll_rates[2];
	unsigned int hsdiv_rates[2];

	struct j721e_audio_domain audio_domains[J721E_AUDIO_DOMAIN_LAST];

	struct mutex mutex;
	struct snd_soc_dai_link dai_links[];
};

static const struct snd_soc_dapm_widget j721e_cpb_dapm_widgets[] = {
	SND_SOC_DAPM_HP("CPB Stereo HP 1", NULL),
	SND_SOC_DAPM_HP("CPB Stereo HP 2", NULL),
	SND_SOC_DAPM_HP("CPB Stereo HP 3", NULL),
	SND_SOC_DAPM_LINE("CPB Line Out", NULL),
	SND_SOC_DAPM_MIC("CPB Stereo Mic 1", NULL),
	SND_SOC_DAPM_MIC("CPB Stereo Mic 2", NULL),
	SND_SOC_DAPM_LINE("CPB Line In", NULL),
};

static const struct snd_soc_dapm_route j721e_cpb_dapm_routes[] = {
	{"CPB Stereo HP 1", NULL, "codec-1 AOUT1L"},
	{"CPB Stereo HP 1", NULL, "codec-1 AOUT1R"},
	{"CPB Stereo HP 2", NULL, "codec-1 AOUT2L"},
	{"CPB Stereo HP 2", NULL, "codec-1 AOUT2R"},
	{"CPB Stereo HP 3", NULL, "codec-1 AOUT3L"},
	{"CPB Stereo HP 3", NULL, "codec-1 AOUT3R"},
	{"CPB Line Out", NULL, "codec-1 AOUT4L"},
	{"CPB Line Out", NULL, "codec-1 AOUT4R"},

	{"codec-1 AIN1L", NULL, "CPB Stereo Mic 1"},
	{"codec-1 AIN1R", NULL, "CPB Stereo Mic 1"},
	{"codec-1 AIN2L", NULL, "CPB Stereo Mic 2"},
	{"codec-1 AIN2R", NULL, "CPB Stereo Mic 2"},
	{"codec-1 AIN3L", NULL, "CPB Line In"},
	{"codec-1 AIN3R", NULL, "CPB Line In"},
};

static const struct snd_soc_dapm_widget j721e_ivi_codec_a_dapm_widgets[] = {
	SND_SOC_DAPM_LINE("IVI A Line Out 1", NULL),
	SND_SOC_DAPM_LINE("IVI A Line Out 2", NULL),
	SND_SOC_DAPM_LINE("IVI A Line Out 3", NULL),
	SND_SOC_DAPM_LINE("IVI A Line Out 4", NULL),
	SND_SOC_DAPM_MIC("IVI A Stereo Mic 1", NULL),
	SND_SOC_DAPM_MIC("IVI A Stereo Mic 2", NULL),
	SND_SOC_DAPM_LINE("IVI A Line In", NULL),
};

static const struct snd_soc_dapm_route j721e_codec_a_dapm_routes[] = {
	{"IVI A Line Out 1", NULL, "codec-a AOUT1L"},
	{"IVI A Line Out 1", NULL, "codec-a AOUT1R"},
	{"IVI A Line Out 2", NULL, "codec-a AOUT2L"},
	{"IVI A Line Out 2", NULL, "codec-a AOUT2R"},
	{"IVI A Line Out 3", NULL, "codec-a AOUT3L"},
	{"IVI A Line Out 3", NULL, "codec-a AOUT3R"},
	{"IVI A Line Out 4", NULL, "codec-a AOUT4L"},
	{"IVI A Line Out 4", NULL, "codec-a AOUT4R"},

Annotation

Implementation Notes