]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: Intel: avs: nau8825: Adjust clock control
authorCezary Rojewski <cezary.rojewski@intel.com>
Fri, 3 Mar 2023 13:48:54 +0000 (14:48 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 6 Mar 2023 16:11:57 +0000 (16:11 +0000)
Internal clock shall be adjusted also in cases when DAPM event other
than 'ON' is triggered.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230303134854.2277146-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/boards/nau8825.c

index b31fa931ba8b6a848406e391ee3d28ddcf4f960e..b69fc5567135d5330c7a4cc75c0bf2e037ea043d 100644 (file)
@@ -33,15 +33,15 @@ avs_nau8825_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *co
                return -EINVAL;
        }
 
-       if (!SND_SOC_DAPM_EVENT_ON(event)) {
+       if (SND_SOC_DAPM_EVENT_ON(event))
+               ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000,
+                                            SND_SOC_CLOCK_IN);
+       else
                ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
-               if (ret < 0) {
-                       dev_err(card->dev, "set sysclk err = %d\n", ret);
-                       return ret;
-               }
-       }
+       if (ret < 0)
+               dev_err(card->dev, "Set sysclk failed: %d\n", ret);
 
-       return 0;
+       return ret;
 }
 
 static const struct snd_kcontrol_new card_controls[] = {