From: Greg Kroah-Hartman Date: Mon, 22 Jan 2024 17:45:13 +0000 (-0800) Subject: 4.19-stable patches X-Git-Tag: v4.19.306~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4093a6c2a850657ce35e97b62ee701584e4de087;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: revert-asoc-atmel-remove-system-clock-tree-configuration-for-at91sam9g20ek.patch --- diff --git a/queue-4.19/revert-asoc-atmel-remove-system-clock-tree-configuration-for-at91sam9g20ek.patch b/queue-4.19/revert-asoc-atmel-remove-system-clock-tree-configuration-for-at91sam9g20ek.patch new file mode 100644 index 00000000000..02ba652cb9d --- /dev/null +++ b/queue-4.19/revert-asoc-atmel-remove-system-clock-tree-configuration-for-at91sam9g20ek.patch @@ -0,0 +1,126 @@ +From 0586f3b2e1bd332bc455b41bc5e19028c0fa2228 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Thu, 18 Jan 2024 11:14:14 +0100 +Subject: Revert "ASoC: atmel: Remove system clock tree configuration for at91sam9g20ek" + +From: Greg Kroah-Hartman + +This reverts commit 6eb9b4a36d08da0230e6a7712b17eafdfd996991 which is +commit c775cbf62ed4911e4f0f23880f01815753123690 upstream. + +It is reported to cause problems, so drop it from the 5.15.y tree for now. + +Link: https://lore.kernel.org/r/845b3053-d47b-4717-9665-79b120da133b@sirena.org.uk +Reported-by: Mark Brown +Cc: Codrin Ciubotariu +Cc: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/atmel/sam9g20_wm8731.c | 61 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +--- a/sound/soc/atmel/sam9g20_wm8731.c ++++ b/sound/soc/atmel/sam9g20_wm8731.c +@@ -59,6 +59,35 @@ + */ + #undef ENABLE_MIC_INPUT + ++static struct clk *mclk; ++ ++static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, ++ enum snd_soc_bias_level level) ++{ ++ static int mclk_on; ++ int ret = 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_ON: ++ case SND_SOC_BIAS_PREPARE: ++ if (!mclk_on) ++ ret = clk_enable(mclk); ++ if (ret == 0) ++ mclk_on = 1; ++ break; ++ ++ case SND_SOC_BIAS_OFF: ++ case SND_SOC_BIAS_STANDBY: ++ if (mclk_on) ++ clk_disable(mclk); ++ mclk_on = 0; ++ break; ++ } ++ ++ return ret; ++} ++ + static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = { + SND_SOC_DAPM_MIC("Int Mic", NULL), + SND_SOC_DAPM_SPK("Ext Spk", NULL), +@@ -117,6 +146,7 @@ static struct snd_soc_card snd_soc_at91s + .owner = THIS_MODULE, + .dai_link = &at91sam9g20ek_dai, + .num_links = 1, ++ .set_bias_level = at91sam9g20ek_set_bias_level, + + .dapm_widgets = at91sam9g20ek_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets), +@@ -129,6 +159,7 @@ static int at91sam9g20ek_audio_probe(str + { + struct device_node *np = pdev->dev.of_node; + struct device_node *codec_np, *cpu_np; ++ struct clk *pllb; + struct snd_soc_card *card = &snd_soc_at91sam9g20ek; + int ret; + +@@ -142,6 +173,31 @@ static int at91sam9g20ek_audio_probe(str + return -EINVAL; + } + ++ /* ++ * Codec MCLK is supplied by PCK0 - set it up. ++ */ ++ mclk = clk_get(NULL, "pck0"); ++ if (IS_ERR(mclk)) { ++ dev_err(&pdev->dev, "Failed to get MCLK\n"); ++ ret = PTR_ERR(mclk); ++ goto err; ++ } ++ ++ pllb = clk_get(NULL, "pllb"); ++ if (IS_ERR(pllb)) { ++ dev_err(&pdev->dev, "Failed to get PLLB\n"); ++ ret = PTR_ERR(pllb); ++ goto err_mclk; ++ } ++ ret = clk_set_parent(mclk, pllb); ++ clk_put(pllb); ++ if (ret != 0) { ++ dev_err(&pdev->dev, "Failed to set MCLK parent\n"); ++ goto err_mclk; ++ } ++ ++ clk_set_rate(mclk, MCLK_RATE); ++ + card->dev = &pdev->dev; + + /* Parse device node info */ +@@ -185,6 +241,9 @@ static int at91sam9g20ek_audio_probe(str + + return ret; + ++err_mclk: ++ clk_put(mclk); ++ mclk = NULL; + err: + atmel_ssc_put_audio(0); + return ret; +@@ -194,6 +253,8 @@ static int at91sam9g20ek_audio_remove(st + { + struct snd_soc_card *card = platform_get_drvdata(pdev); + ++ clk_disable(mclk); ++ mclk = NULL; + snd_soc_unregister_card(card); + atmel_ssc_put_audio(0); + diff --git a/queue-4.19/series b/queue-4.19/series index e7b167bbd52..0ca7732baca 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -111,3 +111,4 @@ of-fix-double-free-in-of_parse_phandle_with_args_map.patch of-unittest-fix-of_count_phandle_with_args-expected-.patch binder-fix-async-space-check-for-0-sized-buffers.patch input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch +revert-asoc-atmel-remove-system-clock-tree-configuration-for-at91sam9g20ek.patch