From: Daniel Golle Date: Fri, 24 Apr 2026 02:49:18 +0000 (+0100) Subject: ASoC: mediatek: mt2701: add optional HDMI audio path clocks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06efb5f1b777c880d2f9f102a0e169a56e974cb0;p=thirdparty%2Flinux.git ASoC: mediatek: mt2701: add optional HDMI audio path clocks The HDMI audio output path on MT2701/MT7623N is rooted in HADDS2PLL and gated by the audio_hdmi, audio_spdf and audio_apll power gates. Acquire these four clocks from device tree using devm_clk_get_optional so that existing platforms which do not wire up HDMI audio keep probing unchanged. Actual clock enable/prepare is deferred to the upcoming HDMI DAI startup path. Signed-off-by: Daniel Golle Link: https://patch.msgid.link/5e24890acf597b04485145b5056ad8b161b4cbda.1776998727.git.daniel@makrotopia.org Signed-off-by: Mark Brown --- diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c index ae620890bb3ac..5a2bcf027b4fb 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c @@ -95,6 +95,28 @@ int mt2701_init_clock(struct mtk_base_afe *afe) afe_priv->mrgif_ck = NULL; } + /* + * Optional HDMI audio clocks. Platforms that do not wire up the + * HDMI output (e.g. MT2701 devkits using only the I2S BE DAIs) + * may omit these; in that case the HDMI BE DAI simply cannot be + * enabled, but the rest of the AFE still probes. + */ + afe_priv->hadds2pll_ck = devm_clk_get_optional(afe->dev, "hadds2pll_294m"); + if (IS_ERR(afe_priv->hadds2pll_ck)) + return PTR_ERR(afe_priv->hadds2pll_ck); + + afe_priv->audio_hdmi_ck = devm_clk_get_optional(afe->dev, "audio_hdmi_pd"); + if (IS_ERR(afe_priv->audio_hdmi_ck)) + return PTR_ERR(afe_priv->audio_hdmi_ck); + + afe_priv->audio_spdf_ck = devm_clk_get_optional(afe->dev, "audio_spdf_pd"); + if (IS_ERR(afe_priv->audio_spdf_ck)) + return PTR_ERR(afe_priv->audio_spdf_ck); + + afe_priv->audio_apll_ck = devm_clk_get_optional(afe->dev, "audio_apll_pd"); + if (IS_ERR(afe_priv->audio_apll_ck)) + return PTR_ERR(afe_priv->audio_apll_ck); + return 0; } diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-common.h b/sound/soc/mediatek/mt2701/mt2701-afe-common.h index 32bef5e2a56d9..7b15283d6351e 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-common.h +++ b/sound/soc/mediatek/mt2701/mt2701-afe-common.h @@ -90,6 +90,10 @@ struct mt2701_afe_private { struct mt2701_i2s_path *i2s_path; struct clk *base_ck[MT2701_BASE_CLK_NUM]; struct clk *mrgif_ck; + struct clk *hadds2pll_ck; + struct clk *audio_hdmi_ck; + struct clk *audio_spdf_ck; + struct clk *audio_apll_ck; bool mrg_enable[MTK_STREAM_NUM]; const struct mt2701_soc_variants *soc;