]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.181/asoc-fsl_sai-update-is_slave_mode-with-correct-value.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / asoc-fsl_sai-update-is_slave_mode-with-correct-value.patch
1 From 728937a554c82f5c7f5eef0b0dbb5c290c7fd7f6 Mon Sep 17 00:00:00 2001
2 From: Daniel Baluta <daniel.baluta@nxp.com>
3 Date: Sun, 21 Apr 2019 19:39:08 +0000
4 Subject: ASoC: fsl_sai: Update is_slave_mode with correct value
5
6 [ Upstream commit ddb351145a967ee791a0fb0156852ec2fcb746ba ]
7
8 is_slave_mode defaults to false because sai structure
9 that contains it is kzalloc'ed.
10
11 Anyhow, if we decide to set the following configuration
12 SAI slave -> SAI master, is_slave_mode will remain set on true
13 although SAI being master it should be set to false.
14
15 Fix this by updating is_slave_mode for each call of
16 fsl_sai_set_dai_fmt.
17
18 Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
19 Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
20 Signed-off-by: Mark Brown <broonie@kernel.org>
21 Signed-off-by: Sasha Levin <sashal@kernel.org>
22 ---
23 sound/soc/fsl/fsl_sai.c | 2 ++
24 1 file changed, 2 insertions(+)
25
26 diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
27 index 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 --
46 2.20.1
47