aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0742-rpi-wm8804-soundcard-Fixed-MCLKDIV-for-Allo-Digione.patch
blob: 952e26664ce8680bdb75049d4577d3dfbe966fa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 09ad53f0267e4b5433c27c77b3945d584ac0a6ba Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 22 Oct 2019 08:47:29 +0100
Subject: [PATCH] rpi-wm8804-soundcard: Fixed MCLKDIV for Allo Digione

The Allo Digione board wants a fixed MCLKDIV of 256.

See: https://github.com/raspberrypi/linux/issues/3296

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 sound/soc/bcm/rpi-wm8804-soundcard.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/sound/soc/bcm/rpi-wm8804-soundcard.c
+++ b/sound/soc/bcm/rpi-wm8804-soundcard.c
@@ -66,6 +66,11 @@ static struct gpio_desc *snd_clk44gpio;
 static struct gpio_desc *snd_clk48gpio;
 static int wm8804_samplerate = 0;
 
+/* Forward declarations */
+static struct snd_soc_dai_link snd_allo_digione_dai[];
+static struct snd_soc_card snd_rpi_wm8804;
+
+
 #define CLK_44EN_RATE 22579200UL
 #define CLK_48EN_RATE 24576000UL
 
@@ -90,11 +95,10 @@ static unsigned int snd_rpi_wm8804_enabl
 static void snd_rpi_wm8804_clk_cfg(unsigned int samplerate,
 		struct wm8804_clk_cfg *clk_cfg)
 {
-	clk_cfg->mclk_freq = 0;
-	clk_cfg->mclk_div = 1;
 	clk_cfg->sysclk_freq = 27000000;
 
-	if (samplerate <= 96000) {
+	if (samplerate <= 96000 ||
+	    snd_rpi_wm8804.dai_link == snd_allo_digione_dai) {
 		clk_cfg->mclk_freq = samplerate * 256;
 		clk_cfg->mclk_div = WM8804_MCLKDIV_256FS;
 	} else {