]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: pcm3168a: ignore 0 Hz settings
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 24 Aug 2020 23:39:24 +0000 (08:39 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:23 +0000 (17:36 +0200)
[ Upstream commit 7ad26d6671db758c959d7e1d100b138a38483612 ]

Some sound card try to set 0 Hz as reset, but it is impossible.
This patch ignores it to avoid error return.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6yjy5sy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/pcm3168a.c

index 9711fab296ebc44a5aa469fd498a0cae952007b3..045c6f8b26befb97be995abbb65ddab5ce158960 100644 (file)
@@ -306,6 +306,13 @@ static int pcm3168a_set_dai_sysclk(struct snd_soc_dai *dai,
        struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(dai->component);
        int ret;
 
+       /*
+        * Some sound card sets 0 Hz as reset,
+        * but it is impossible to set. Ignore it here
+        */
+       if (freq == 0)
+               return 0;
+
        if (freq > PCM3168A_MAX_SYSCLK)
                return -EINVAL;