ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz
authorNikesh Oswal <Nikesh.Oswal@cirrus.com>
Wed, 23 Dec 2015 14:18:05 +0000 (14:18 +0000)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:11:10 +0000 (13:11 +0000)
commit e73694d871867cae8471d2350ce89acb38bc2b63 upstream.

For a sample rate of 12kHz the bclk was taken from the 44.1kHz table as
we test for a multiple of 8kHz. This patch fixes this issue by testing
for multiples of 4kHz instead.

Signed-off-by: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/arizona.c

index 8a730cadc02d25c5c3273cf075d5e37315d3bd39..9a6c7c5fb3979f7aca04924e1f0298cd05b04cec 100644 (file)
@@ -1768,7 +1768,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
        int tdm_slots = arizona->tdm_slots[dai->id - 1];
        int bclk, lrclk, wl, frame, bclk_target;
 
-       if (params_rate(params) % 8000)
+       if (params_rate(params) % 4000)
                rates = &arizona_44k1_bclk_rates[0];
        else
                rates = &arizona_48k_bclk_rates[0];