]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/asoc-fsl_sai-update-is_slave_mode-with-correct-value.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / queue-4.4 / asoc-fsl_sai-update-is_slave_mode-with-correct-value.patch
CommitLineData
1143c684
SL
1From 728937a554c82f5c7f5eef0b0dbb5c290c7fd7f6 Mon Sep 17 00:00:00 2001
2From: Daniel Baluta <daniel.baluta@nxp.com>
3Date: Sun, 21 Apr 2019 19:39:08 +0000
4Subject: ASoC: fsl_sai: Update is_slave_mode with correct value
5
6[ Upstream commit ddb351145a967ee791a0fb0156852ec2fcb746ba ]
7
8is_slave_mode defaults to false because sai structure
9that contains it is kzalloc'ed.
10
11Anyhow, if we decide to set the following configuration
12SAI slave -> SAI master, is_slave_mode will remain set on true
13although SAI being master it should be set to false.
14
15Fix this by updating is_slave_mode for each call of
16fsl_sai_set_dai_fmt.
17
18Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
19Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
20Signed-off-by: Mark Brown <broonie@kernel.org>
21Signed-off-by: Sasha Levin <sashal@kernel.org>
22---
23 sound/soc/fsl/fsl_sai.c | 2 ++
24 1 file changed, 2 insertions(+)
25
26diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
27index 08b460ba06efc..61d2d955f26a6 100644
28--- a/sound/soc/fsl/fsl_sai.c
29+++ b/sound/soc/fsl/fsl_sai.c
30@@ -260,12 +260,14 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
31 case SND_SOC_DAIFMT_CBS_CFS:
32 val_cr2 |= FSL_SAI_CR2_BCD_MSTR;
33 val_cr4 |= FSL_SAI_CR4_FSD_MSTR;
34+ sai->is_slave_mode = false;
35 break;
36 case SND_SOC_DAIFMT_CBM_CFM:
37 sai->is_slave_mode = true;
38 break;
39 case SND_SOC_DAIFMT_CBS_CFM:
40 val_cr2 |= FSL_SAI_CR2_BCD_MSTR;
41+ sai->is_slave_mode = false;
42 break;
43 case SND_SOC_DAIFMT_CBM_CFS:
44 val_cr4 |= FSL_SAI_CR4_FSD_MSTR;
45--
462.20.1
47