]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: mediatek: mt2701: add optional HDMI audio path clocks
authorDaniel Golle <daniel@makrotopia.org>
Fri, 24 Apr 2026 02:49:18 +0000 (03:49 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 5 May 2026 01:52:05 +0000 (10:52 +0900)
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 <daniel@makrotopia.org>
Link: https://patch.msgid.link/5e24890acf597b04485145b5056ad8b161b4cbda.1776998727.git.daniel@makrotopia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
sound/soc/mediatek/mt2701/mt2701-afe-common.h

index ae620890bb3ac92ceaf955dcb6d134e87b854ec3..5a2bcf027b4fbbeeceac5d58a320cc15d0ca117f 100644 (file)
@@ -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;
 }
 
index 32bef5e2a56d946f543d86bcbdc81594b99cae52..7b15283d6351e10d3b2c9ff19427174a47a20b52 100644 (file)
@@ -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;