| From: Alexander Sverdlin <alexander.sverdlin@gmail.com> |
| Date: Sat, 28 Apr 2018 22:51:38 +0200 |
| Subject: ASoC: cirrus: i2s: Fix LRCLK configuration |
| |
| commit 2d534113be9a2aa532a1ae127a57e83558aed358 upstream. |
| |
| The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2) |
| (refer to "EP93xx User's Guide"). |
| |
| Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got |
| SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old |
| behavior. |
| |
| Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Signed-off-by: Ben Hutchings <ben@decadent.org.uk> |
| --- |
| sound/soc/cirrus/edb93xx.c | 2 +- |
| sound/soc/cirrus/ep93xx-i2s.c | 8 ++++---- |
| sound/soc/cirrus/snappercl15.c | 2 +- |
| 3 files changed, 6 insertions(+), 6 deletions(-) |
| |
| --- a/sound/soc/cirrus/edb93xx.c |
| +++ b/sound/soc/cirrus/edb93xx.c |
| @@ -67,7 +67,7 @@ static struct snd_soc_dai_link edb93xx_d |
| .cpu_dai_name = "ep93xx-i2s", |
| .codec_name = "spi0.0", |
| .codec_dai_name = "cs4271-hifi", |
| - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | |
| + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
| SND_SOC_DAIFMT_CBS_CFS, |
| .ops = &edb93xx_ops, |
| }; |
| --- a/sound/soc/cirrus/ep93xx-i2s.c |
| +++ b/sound/soc/cirrus/ep93xx-i2s.c |
| @@ -213,24 +213,24 @@ static int ep93xx_i2s_set_dai_fmt(struct |
| switch (fmt & SND_SOC_DAIFMT_INV_MASK) { |
| case SND_SOC_DAIFMT_NB_NF: |
| /* Negative bit clock, lrclk low on left word */ |
| - clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_REL); |
| + clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_LRS); |
| break; |
| |
| case SND_SOC_DAIFMT_NB_IF: |
| /* Negative bit clock, lrclk low on right word */ |
| clk_cfg &= ~EP93XX_I2S_CLKCFG_CKP; |
| - clk_cfg |= EP93XX_I2S_CLKCFG_REL; |
| + clk_cfg |= EP93XX_I2S_CLKCFG_LRS; |
| break; |
| |
| case SND_SOC_DAIFMT_IB_NF: |
| /* Positive bit clock, lrclk low on left word */ |
| clk_cfg |= EP93XX_I2S_CLKCFG_CKP; |
| - clk_cfg &= ~EP93XX_I2S_CLKCFG_REL; |
| + clk_cfg &= ~EP93XX_I2S_CLKCFG_LRS; |
| break; |
| |
| case SND_SOC_DAIFMT_IB_IF: |
| /* Positive bit clock, lrclk low on right word */ |
| - clk_cfg |= EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_REL; |
| + clk_cfg |= EP93XX_I2S_CLKCFG_CKP | EP93XX_I2S_CLKCFG_LRS; |
| break; |
| } |
| |
| --- a/sound/soc/cirrus/snappercl15.c |
| +++ b/sound/soc/cirrus/snappercl15.c |
| @@ -72,7 +72,7 @@ static struct snd_soc_dai_link snappercl |
| .codec_dai_name = "tlv320aic23-hifi", |
| .codec_name = "tlv320aic23-codec.0-001a", |
| .platform_name = "ep93xx-i2s", |
| - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | |
| + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
| SND_SOC_DAIFMT_CBS_CFS, |
| .ops = &snappercl15_ops, |
| }; |