1 From c4a696183e90f0c3b3b857b6b876660707a60add Mon Sep 17 00:00:00 2001
2 From: Matt Flax <flatmax@flatmax.org>
3 Date: Sun, 20 Nov 2016 19:15:24 +1100
4 Subject: [PATCH] [Audioinjector] Fix bit offsets for equal volume and add 8
7 Applying to the audioinjector sound card only. This patch offsets channel
8 2 correctly from the LR clock. This ensures that channel 2 doesn't loose
9 any bits during capture. It also results in both channels 1 and 2 having
10 the same volume. This commit also adds 8 kHz operation.
12 Signed-off-by: Matt Flax <flatmax@flatmax.org>
14 sound/soc/bcm/audioinjector-pi-soundcard.c | 16 +++++++++-------
15 1 file changed, 9 insertions(+), 7 deletions(-)
17 --- a/sound/soc/bcm/audioinjector-pi-soundcard.c
18 +++ b/sound/soc/bcm/audioinjector-pi-soundcard.c
20 #include "../codecs/wm8731.h"
22 static const unsigned int bcm2835_rates_12000000[] = {
23 - 32000, 44100, 48000, 96000, 88200,
24 + 8000, 16000, 32000, 44100, 48000, 96000, 88200,
27 static struct snd_pcm_hw_constraint_list bcm2835_constraints_12000000 = {
28 @@ -55,19 +55,21 @@ static int snd_audioinjector_pi_soundcar
30 switch (params_rate(params)){
32 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 1508);
33 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 1);
35 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 750);
37 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 378);
38 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 375);
40 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 274);
41 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 272);
43 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 252);
44 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 250);
46 return snd_soc_dai_set_bclk_ratio(cpu_dai, 136);
48 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 126);
49 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 125);
51 - return snd_soc_dai_set_bclk_ratio(cpu_dai, 126);
52 + return snd_soc_dai_set_bclk_ratio(cpu_dai, 125);