Commit 16fc06e2 authored by allocom's avatar allocom Committed by Phil Elwell
Browse files

allo-digione: 192kHz clicking sound fix

parent 9c894183
Loading
Loading
Loading
Loading
+55 −58
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

#include "../codecs/wm8804.h"

static short int auto_shutdown_output = 0;
static short int auto_shutdown_output;
module_param(auto_shutdown_output, short,
		S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped");
@@ -75,6 +75,7 @@ static int snd_allo_digione_startup(struct snd_pcm_substream *substream)
	/* turn on digital output */
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_codec *codec = rtd->codec;

	snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00);
	return 0;
}
@@ -86,6 +87,7 @@ static void snd_allo_digione_shutdown(struct snd_pcm_substream *substream)
		/* turn off output */
		struct snd_soc_pcm_runtime *rtd = substream->private_data;
		struct snd_soc_codec *codec = rtd->codec;

		snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c);
	}
}
@@ -107,14 +109,8 @@ static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream,
	int ret;

	samplerate = params_rate(params);

	if (samplerate <= 96000) {
	mclk_freq = samplerate * 256;
	mclk_div = WM8804_MCLKDIV_256FS;
	} else {
		mclk_freq = samplerate * 128;
		mclk_div = WM8804_MCLKDIV_128FS;
	}

	sysclk = snd_allo_digione_enable_clock(samplerate);

@@ -211,6 +207,7 @@ static int snd_allo_digione_probe(struct platform_device *pdev)
	if (pdev->dev.of_node) {
		struct device_node *i2s_node;
		struct snd_soc_dai_link *dai = &snd_allo_digione_dai[0];

		i2s_node = of_parse_phandle(pdev->dev.of_node,
				"i2s-controller", 0);