brcm2708: add kernel 4.14 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.14 / 950-0214-ASoC-hifiberry_dacplus-fix-S24_LE-format.patch
1 From d94d483e5f0798294aa1eb738c203acc4a7f415e Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Fri, 2 Feb 2018 20:30:42 +0100
4 Subject: [PATCH 214/454] ASoC: hifiberry_dacplus: fix S24_LE format
5
6 Remove set_bclk_ratio call so 24-bit data is transmitted in
7 24 bclk cycles.
8
9 Signed-off-by: Matthias Reichl <hias@horus.com>
10 ---
11 sound/soc/bcm/hifiberry_dacplus.c | 20 +++-----------------
12 1 file changed, 3 insertions(+), 17 deletions(-)
13
14 --- a/sound/soc/bcm/hifiberry_dacplus.c
15 +++ b/sound/soc/bcm/hifiberry_dacplus.c
16 @@ -216,20 +216,11 @@ static int snd_rpi_hifiberry_dacplus_upd
17 return 0;
18 }
19
20 -static int snd_rpi_hifiberry_dacplus_set_bclk_ratio_pro(
21 - struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params)
22 -{
23 - int bratio = snd_pcm_format_physical_width(params_format(params))
24 - * params_channels(params);
25 - return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio);
26 -}
27 -
28 static int snd_rpi_hifiberry_dacplus_hw_params(
29 struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
30 {
31 - int ret;
32 + int ret = 0;
33 struct snd_soc_pcm_runtime *rtd = substream->private_data;
34 - struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
35
36 if (snd_rpi_hifiberry_is_dacpro) {
37 struct snd_soc_codec *codec = rtd->codec;
38 @@ -237,13 +228,8 @@ static int snd_rpi_hifiberry_dacplus_hw_
39 snd_rpi_hifiberry_dacplus_set_sclk(codec,
40 params_rate(params));
41
42 - ret = snd_rpi_hifiberry_dacplus_set_bclk_ratio_pro(cpu_dai,
43 - params);
44 - if (!ret)
45 - ret = snd_rpi_hifiberry_dacplus_update_rate_den(
46 - substream, params);
47 - } else {
48 - ret = snd_soc_dai_set_bclk_ratio(cpu_dai, 64);
49 + ret = snd_rpi_hifiberry_dacplus_update_rate_den(
50 + substream, params);
51 }
52 return ret;
53 }