int mt8365_afe_set_clk_rate(struct mtk_base_afe *afe, struct clk *clk, unsignedint rate)
{ int ret;
if (clk) {
ret = clk_set_rate(clk, rate); if (ret) {
dev_err(afe->dev, "Failed to set rate\n"); return ret;
}
} return 0;
}
int mt8365_afe_set_clk_parent(struct mtk_base_afe *afe, struct clk *clk, struct clk *parent)
{ int ret;
if (clk && parent) {
ret = clk_set_parent(clk, parent); if (ret) {
dev_err(afe->dev, "Failed to set parent\n"); return ret;
}
} return 0;
}
staticunsignedint get_top_cg_reg(unsignedint cg_type)
{ switch (cg_type) { case MT8365_TOP_CG_AFE: case MT8365_TOP_CG_I2S_IN: case MT8365_TOP_CG_22M: case MT8365_TOP_CG_24M: case MT8365_TOP_CG_INTDIR_CK: case MT8365_TOP_CG_APLL2_TUNER: case MT8365_TOP_CG_APLL_TUNER: case MT8365_TOP_CG_SPDIF: case MT8365_TOP_CG_TDM_OUT: case MT8365_TOP_CG_TDM_IN: case MT8365_TOP_CG_ADC: case MT8365_TOP_CG_DAC: case MT8365_TOP_CG_DAC_PREDIS: case MT8365_TOP_CG_TML: return AUDIO_TOP_CON0; case MT8365_TOP_CG_I2S1_BCLK: case MT8365_TOP_CG_I2S2_BCLK: case MT8365_TOP_CG_I2S3_BCLK: case MT8365_TOP_CG_I2S4_BCLK: case MT8365_TOP_CG_DMIC0_ADC: case MT8365_TOP_CG_DMIC1_ADC: case MT8365_TOP_CG_DMIC2_ADC: case MT8365_TOP_CG_DMIC3_ADC: case MT8365_TOP_CG_CONNSYS_I2S_ASRC: case MT8365_TOP_CG_GENERAL1_ASRC: case MT8365_TOP_CG_GENERAL2_ASRC: case MT8365_TOP_CG_TDM_ASRC: return AUDIO_TOP_CON1; default: return 0;
}
}
staticunsignedint get_top_cg_mask(unsignedint cg_type)
{ switch (cg_type) { case MT8365_TOP_CG_AFE: return AUD_TCON0_PDN_AFE; case MT8365_TOP_CG_I2S_IN: return AUD_TCON0_PDN_I2S_IN; case MT8365_TOP_CG_22M: return AUD_TCON0_PDN_22M; case MT8365_TOP_CG_24M: return AUD_TCON0_PDN_24M; case MT8365_TOP_CG_INTDIR_CK: return AUD_TCON0_PDN_INTDIR; case MT8365_TOP_CG_APLL2_TUNER: return AUD_TCON0_PDN_APLL2_TUNER; case MT8365_TOP_CG_APLL_TUNER: return AUD_TCON0_PDN_APLL_TUNER; case MT8365_TOP_CG_SPDIF: return AUD_TCON0_PDN_SPDIF; case MT8365_TOP_CG_TDM_OUT: return AUD_TCON0_PDN_TDM_OUT; case MT8365_TOP_CG_TDM_IN: return AUD_TCON0_PDN_TDM_IN; case MT8365_TOP_CG_ADC: return AUD_TCON0_PDN_ADC; case MT8365_TOP_CG_DAC: return AUD_TCON0_PDN_DAC; case MT8365_TOP_CG_DAC_PREDIS: return AUD_TCON0_PDN_DAC_PREDIS; case MT8365_TOP_CG_TML: return AUD_TCON0_PDN_TML; case MT8365_TOP_CG_I2S1_BCLK: return AUD_TCON1_PDN_I2S1_BCLK; case MT8365_TOP_CG_I2S2_BCLK: return AUD_TCON1_PDN_I2S2_BCLK; case MT8365_TOP_CG_I2S3_BCLK: return AUD_TCON1_PDN_I2S3_BCLK; case MT8365_TOP_CG_I2S4_BCLK: return AUD_TCON1_PDN_I2S4_BCLK; case MT8365_TOP_CG_DMIC0_ADC: return AUD_TCON1_PDN_DMIC0_ADC; case MT8365_TOP_CG_DMIC1_ADC: return AUD_TCON1_PDN_DMIC1_ADC; case MT8365_TOP_CG_DMIC2_ADC: return AUD_TCON1_PDN_DMIC2_ADC; case MT8365_TOP_CG_DMIC3_ADC: return AUD_TCON1_PDN_DMIC3_ADC; case MT8365_TOP_CG_CONNSYS_I2S_ASRC: return AUD_TCON1_PDN_CONNSYS_I2S_ASRC; case MT8365_TOP_CG_GENERAL1_ASRC: return AUD_TCON1_PDN_GENERAL1_ASRC; case MT8365_TOP_CG_GENERAL2_ASRC: return AUD_TCON1_PDN_GENERAL2_ASRC; case MT8365_TOP_CG_TDM_ASRC: return AUD_TCON1_PDN_TDM_ASRC; default: return 0;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.