aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0231-ASoC-hifiberry_dacplus-transmit-S24_LE-with-64-BCLK-.patch
blob: 8c2bdbc7c791ca246d0297dfbc1372ac428a8e6d (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
From 05a5419c9e0ec993bc8dafd60e9fbe6c04e9e8c0 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Thu, 22 Feb 2018 13:09:30 +0100
Subject: [PATCH 231/454] ASoC: hifiberry_dacplus: transmit S24_LE with 64 BCLK
 cycles

Signed-off-by: Matthias Reichl <hias@horus.com>
---
 sound/soc/bcm/hifiberry_dacplus.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/sound/soc/bcm/hifiberry_dacplus.c
+++ b/sound/soc/bcm/hifiberry_dacplus.c
@@ -221,16 +221,27 @@ static int snd_rpi_hifiberry_dacplus_hw_
 {
 	int ret = 0;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	int channels = params_channels(params);
+	int width = 32;
 
 	if (snd_rpi_hifiberry_is_dacpro) {
 		struct snd_soc_codec *codec = rtd->codec;
 
+		width = snd_pcm_format_physical_width(params_format(params));
+
 		snd_rpi_hifiberry_dacplus_set_sclk(codec,
 			params_rate(params));
 
 		ret = snd_rpi_hifiberry_dacplus_update_rate_den(
 			substream, params);
 	}
+
+	ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x03, 0x03,
+		channels, width);
+	if (ret)
+		return ret;
+	ret = snd_soc_dai_set_tdm_slot(rtd->codec_dai, 0x03, 0x03,
+		channels, width);
 	return ret;
 }