Skip to content

Commit

Permalink
ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Adam Thomson authored and Mark Brown committed Sep 19, 2015
1 parent 6ff33f3 commit 5b64c17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/soc/fsl/fsl_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5b64c17

Please sign in to comment.