* [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
@ 2015-09-16 9:13 ` Adam Thomson
0 siblings, 0 replies; 5+ messages in thread
From: Adam Thomson @ 2015-09-16 9:13 UTC (permalink / raw)
To: Mark Brown, Nicolin Chen
Cc: Timur Tabi, Xiubo Li, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, alsa-devel, linuxppc-dev, linux-kernel,
support.opensource
Current code incorrectly treats dai format for AC97 as bit mask
whereas it's actually an integer value. This causes DAI formats
other than AC97 (e.g. DSP_B) to trigger AC97 related code,
which is incorrect and breaks functionality. This patch fixes
the code to correctly compare values to determine AC97 or not.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
Patch based on v4.3-rc1.
sound/soc/fsl/fsl_ssi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 8ec6fb2..37c5cd4 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
{
- return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
+ return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
+ SND_SOC_DAIFMT_AC97;
}
static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
@@ -947,7 +948,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
CCSR_SSI_SCR_TCH_EN);
}
- if (fmt & SND_SOC_DAIFMT_AC97)
+ if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
fsl_ssi_setup_ac97(ssi_private);
return 0;
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
@ 2015-09-16 9:13 ` Adam Thomson
0 siblings, 0 replies; 5+ messages in thread
From: Adam Thomson @ 2015-09-16 9:13 UTC (permalink / raw)
To: Mark Brown, Nicolin Chen
Cc: Timur Tabi, Xiubo Li, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, alsa-devel, linuxppc-dev, linux-kernel,
support.opensource
Current code incorrectly treats dai format for AC97 as bit mask
whereas it's actually an integer value. This causes DAI formats
other than AC97 (e.g. DSP_B) to trigger AC97 related code,
which is incorrect and breaks functionality. This patch fixes
the code to correctly compare values to determine AC97 or not.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
Patch based on v4.3-rc1.
sound/soc/fsl/fsl_ssi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 8ec6fb2..37c5cd4 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
{
- return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
+ return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
+ SND_SOC_DAIFMT_AC97;
}
static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
@@ -947,7 +948,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
CCSR_SSI_SCR_TCH_EN);
}
- if (fmt & SND_SOC_DAIFMT_AC97)
+ if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
fsl_ssi_setup_ac97(ssi_private);
return 0;
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
2015-09-16 9:13 ` Adam Thomson
(?)
@ 2015-09-16 9:32 ` arnaud.mouiche
-1 siblings, 0 replies; 5+ messages in thread
From: arnaud.mouiche @ 2015-09-16 9:32 UTC (permalink / raw)
To: alsa-devel
Hello,
Please apply.
this kind of patch is here for a long time (I have posted one similar in
the past) and is a requirement to make DSP_A/B working on freescale.
regards,
arnaud
Le 16/09/2015 11:13, Adam Thomson a écrit :
> Current code incorrectly treats dai format for AC97 as bit mask
> whereas it's actually an integer value. This causes DAI formats
> other than AC97 (e.g. DSP_B) to trigger AC97 related code,
> which is incorrect and breaks functionality. This patch fixes
> the code to correctly compare values to determine AC97 or not.
>
> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> ---
>
> Patch based on v4.3-rc1.
>
> sound/soc/fsl/fsl_ssi.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 8ec6fb2..37c5cd4 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
>
> static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
> {
> - return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
> + return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
> + SND_SOC_DAIFMT_AC97;
> }
>
> static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
> @@ -947,7 +948,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
> CCSR_SSI_SCR_TCH_EN);
> }
>
> - if (fmt & SND_SOC_DAIFMT_AC97)
> + if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
> fsl_ssi_setup_ac97(ssi_private);
>
> return 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
2015-09-16 9:13 ` Adam Thomson
@ 2015-09-19 0:37 ` undefined
-1 siblings, 0 replies; 5+ messages in thread
From: undefined @ 2015-09-19 0:37 UTC (permalink / raw)
To: Adam Thomson, Mark Brown, Nicolin Chen
Cc: Xiubo Li, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linuxppc-dev, linux-kernel, support.opensource
Adam Thomson wrote:
> Current code incorrectly treats dai format for AC97 as bit mask
> whereas it's actually an integer value. This causes DAI formats
> other than AC97 (e.g. DSP_B) to trigger AC97 related code,
> which is incorrect and breaks functionality. This patch fixes
> the code to correctly compare values to determine AC97 or not.
>
> Signed-off-by: Adam Thomson<Adam.Thomson.Opensource@diasemi.com>
Acked-by: Timur Tabi <timur@tabi.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
@ 2015-09-19 0:37 ` undefined
0 siblings, 0 replies; 5+ messages in thread
From: undefined @ 2015-09-19 0:37 UTC (permalink / raw)
To: Adam Thomson, Mark Brown, Nicolin Chen
Cc: Xiubo Li, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linuxppc-dev, linux-kernel, support.opensource
Adam Thomson wrote:
> Current code incorrectly treats dai format for AC97 as bit mask
> whereas it's actually an integer value. This causes DAI formats
> other than AC97 (e.g. DSP_B) to trigger AC97 related code,
> which is incorrect and breaks functionality. This patch fixes
> the code to correctly compare values to determine AC97 or not.
>
> Signed-off-by: Adam Thomson<Adam.Thomson.Opensource@diasemi.com>
Acked-by: Timur Tabi <timur@tabi.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-19 0:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 9:13 [RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode Adam Thomson
2015-09-16 9:13 ` Adam Thomson
2015-09-16 9:32 ` arnaud.mouiche
2015-09-19 0:37 ` undefined
2015-09-19 0:37 ` undefined
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.