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>
This commit is contained in:
Phil Elwell
2019-10-22 08:47:29 +01:00
committed by popcornmix
parent d73223274f
commit 0c068099e2

View File

@@ -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_enable_clock(unsigned int samplerate)
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 {