sound/soc/mediatek/mt8196/mt8196-afe-clk.c

Source file repositories/reference/linux-study-clean/sound/soc/mediatek/mt8196/mt8196-afe-clk.c

File Facts

System
Linux kernel
Corpus path
sound/soc/mediatek/mt8196/mt8196-afe-clk.c
Extension
.c
Size
14739 bytes
Lines
582
Domain
Driver Families
Bucket
sound/soc
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

if (ret) {
			dev_err(afe->dev, "failed to set clk rate\n");
			return ret;
		}
	}

	return 0;
}

static unsigned int get_top_cg_reg(unsigned int cg_type)
{
	switch (cg_type) {
	case MT8196_AUDIO_26M_EN_ON:
	case MT8196_AUDIO_F3P25M_EN_ON:
	case MT8196_AUDIO_APLL1_EN_ON:
	case MT8196_AUDIO_APLL2_EN_ON:
		return AUDIO_ENGEN_CON0;
	case MT8196_CG_AUDIO_HOPPING_CK:
	case MT8196_CG_AUDIO_F26M_CK:
	case MT8196_CG_APLL1_CK:
	case MT8196_CG_APLL2_CK:
	case MT8196_PDN_APLL_TUNER2:
	case MT8196_PDN_APLL_TUNER1:
		return AUDIO_TOP_CON4;
	default:
		return 0;
	}
}

static unsigned int get_top_cg_mask(unsigned int cg_type)
{
	switch (cg_type) {
	case MT8196_AUDIO_26M_EN_ON:
		return AUDIO_26M_EN_ON_MASK_SFT;
	case MT8196_AUDIO_F3P25M_EN_ON:
		return AUDIO_F3P25M_EN_ON_MASK_SFT;
	case MT8196_AUDIO_APLL1_EN_ON:
		return AUDIO_APLL1_EN_ON_MASK_SFT;
	case MT8196_AUDIO_APLL2_EN_ON:
		return AUDIO_APLL2_EN_ON_MASK_SFT;
	case MT8196_CG_AUDIO_HOPPING_CK:
		return CG_AUDIO_HOPPING_CK_MASK_SFT;
	case MT8196_CG_AUDIO_F26M_CK:
		return CG_AUDIO_F26M_CK_MASK_SFT;
	case MT8196_CG_APLL1_CK:
		return CG_APLL1_CK_MASK_SFT;
	case MT8196_CG_APLL2_CK:
		return CG_APLL2_CK_MASK_SFT;
	case MT8196_PDN_APLL_TUNER2:
		return PDN_APLL_TUNER2_MASK_SFT;
	case MT8196_PDN_APLL_TUNER1:
		return PDN_APLL_TUNER1_MASK_SFT;
	default:
		return 0;
	}
}

static unsigned int get_top_cg_on_val(unsigned int cg_type)
{
	switch (cg_type) {
	case MT8196_AUDIO_26M_EN_ON:
	case MT8196_AUDIO_F3P25M_EN_ON:
	case MT8196_AUDIO_APLL1_EN_ON:
	case MT8196_AUDIO_APLL2_EN_ON:
		return get_top_cg_mask(cg_type);
	case MT8196_CG_AUDIO_HOPPING_CK:
	case MT8196_CG_AUDIO_F26M_CK:
	case MT8196_CG_APLL1_CK:
	case MT8196_CG_APLL2_CK:
	case MT8196_PDN_APLL_TUNER2:
	case MT8196_PDN_APLL_TUNER1:
		return 0;
	default:
		return 0;
	}
}

static unsigned int get_top_cg_off_val(unsigned int cg_type)
{
	switch (cg_type) {
	case MT8196_AUDIO_26M_EN_ON:
	case MT8196_AUDIO_F3P25M_EN_ON:
	case MT8196_AUDIO_APLL1_EN_ON:
	case MT8196_AUDIO_APLL2_EN_ON:
		return 0;
	case MT8196_CG_AUDIO_HOPPING_CK:
	case MT8196_CG_AUDIO_F26M_CK:
	case MT8196_CG_APLL1_CK:
	case MT8196_CG_APLL2_CK:
	case MT8196_PDN_APLL_TUNER2:

Annotation

Implementation Notes