aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0230-ASoC-allo-boss-dac-transmit-S24_LE-with-64-BCLK-cycl.patch
blob: 4197d4a1d24c6ee3d0e3b0b3717fd0d948e14200 (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
From 1d5b2b562fd800069f4090142e201d696ad1122a Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Thu, 22 Feb 2018 13:07:53 +0100
Subject: [PATCH 230/454] ASoC: allo-boss-dac: transmit S24_LE with 64 BCLK
 cycles

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

--- a/sound/soc/bcm/allo-boss-dac.c
+++ b/sound/soc/bcm/allo-boss-dac.c
@@ -273,6 +273,8 @@ static int snd_allo_boss_hw_params(
 {
 	int ret = 0;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	int channels = params_channels(params);
+	int width = snd_pcm_format_physical_width(params_format(params));
 
 	if (snd_soc_allo_boss_master) {
 		struct snd_soc_codec *codec = rtd->codec;
@@ -282,7 +284,16 @@ static int snd_allo_boss_hw_params(
 
 		ret = snd_allo_boss_update_rate_den(
 			substream, params);
+		if (ret)
+			return ret;
 	}
+
+	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;
 }