Skip to contentSkip to conversation

ASoC: meson: axg-tdm: i2s format fixups

PATCH In review Jerome Brunet 2 participants 9 messages Jun 13, 2019

Subsystems (4)
lore
Share & tools
lore

Jerome Brunet

author maintainer
#0 lore raw

cover ASoC: meson: axg-tdm: i2s format fixups

The patchset fixes a few mistakes regarding the format on the i2s bus on the Amlogic axg tdm drivers.

Jerome Brunet (4):
ASoC: meson: axg-tdmin: right_j is not supported
ASoC: meson: axg-tdmout: right_j is not supported
ASoC: meson: axg-tdm: fix sample clock inversion
ASoC: meson: axg-tdm: consistently use SND_SOC_DAIFMT defines

 sound/soc/meson/axg-tdm-interface.c | 4 ++--
 sound/soc/meson/axg-tdm.h           | 2 +-
 sound/soc/meson/axg-tdmin.c         | 1 -
 sound/soc/meson/axg-tdmout.c        | 1 -
 4 files changed, 3 insertions(+), 5 deletions(-)
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH 1/4 ASoC: meson: axg-tdmin: right_j is not supported

Right justified format is actually not supported by the amlogic tdm input decoder.

Fixes 13a22e6a98f8 ("ASoC: meson: add tdm input driver")
---
 sound/soc/meson/axg-tdmin.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/axg-tdmin.c +0 -1
index a790f925a4ef..cb87f17f3e95 100644
@@ -121,7 +121,6 @@ static int axg_tdmin_prepare(struct regmap *map,
 		break;
 
 	case SND_SOC_DAIFMT_LEFT_J:
-	case SND_SOC_DAIFMT_RIGHT_J:
 	case SND_SOC_DAIFMT_DSP_B:
 		break;
 
Signature · 1 line
2.20.1
maintainer
#2 lore raw

Applied "ASoC: meson: axg-tdmin: right_j is not supported" to the asoc tree

The patch

ASoC: meson: axg-tdmin: right_j is not supported

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 47c317b786b6c1efc2cb3cdb894fd323422fe5ea Mon Sep 17 00:00:00 2001

From: Jerome Brunet <[email protected]>
Date: Thu, 13 Jun 2019 13:42:30 +0200
Subject: [PATCH] ASoC: meson: axg-tdmin: right_j is not supported

Right justified format is actually not supported by the amlogic tdm input decoder.

Fixes 13a22e6a98f8 ("ASoC: meson: add tdm input driver")
---
 sound/soc/meson/axg-tdmin.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/axg-tdmin.c +0 -1
index a790f925a4ef..cb87f17f3e95 100644
@@ -121,7 +121,6 @@ static int axg_tdmin_prepare(struct regmap *map,
 		break;
 
 	case SND_SOC_DAIFMT_LEFT_J:
-	case SND_SOC_DAIFMT_RIGHT_J:
 	case SND_SOC_DAIFMT_DSP_B:
 		break;
 
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH 2/4 ASoC: meson: axg-tdmout: right_j is not supported

In reply to Jerome Brunet

Right justified format is actually not supported by the amlogic tdm output encoder.

Fixes c41c2a355b86 ("ASoC: meson: add tdm output driver")
---
 sound/soc/meson/axg-tdmout.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/axg-tdmout.c +0 -1
index 527bfc4487e0..86537fc0ecb5 100644
@@ -137,7 +137,6 @@ static int axg_tdmout_prepare(struct regmap *map,
 		break;
 
 	case SND_SOC_DAIFMT_LEFT_J:
-	case SND_SOC_DAIFMT_RIGHT_J:
 	case SND_SOC_DAIFMT_DSP_B:
 		skew += 1;
 		break;
Signature · 1 line
2.20.1
maintainer
#4 lore raw

Applied "ASoC: meson: axg-tdmout: right_j is not supported" to the asoc tree

The patch

ASoC: meson: axg-tdmout: right_j is not supported

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 7e0d7d0fbd06af0507611f85dba8daf24832abd9 Mon Sep 17 00:00:00 2001

From: Jerome Brunet <[email protected]>
Date: Thu, 13 Jun 2019 13:42:31 +0200
Subject: [PATCH] ASoC: meson: axg-tdmout: right_j is not supported

Right justified format is actually not supported by the amlogic tdm output encoder.

Fixes c41c2a355b86 ("ASoC: meson: add tdm output driver")
---
 sound/soc/meson/axg-tdmout.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/axg-tdmout.c +0 -1
index 527bfc4487e0..86537fc0ecb5 100644
@@ -137,7 +137,6 @@ static int axg_tdmout_prepare(struct regmap *map,
 		break;
 
 	case SND_SOC_DAIFMT_LEFT_J:
-	case SND_SOC_DAIFMT_RIGHT_J:
 	case SND_SOC_DAIFMT_DSP_B:
 		skew += 1;
 		break;
Signature · 1 line
2.20.1
author maintainer
#5 lore raw

PATCH 3/4 ASoC: meson: axg-tdm: fix sample clock inversion

In reply to Jerome Brunet

The content of SND_SOC_DAIFMT_FORMAT_MASK is a number, not a bitfield, so the test to check if the format is i2s is wrong. Because of this the clock setting may be wrong. For example, the sample clock gets inverted in DSP B mode, when it should not.

Fix the lrclk invert helper function

Fixes 1a11d88f499c ("ASoC: meson: add tdm formatter base driver")
---
 sound/soc/meson/axg-tdm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/axg-tdm.h +1 -1
index e578b6f40a07..5774ce0916d4 100644
@@ -40,7 +40,7 @@ struct axg_tdm_iface {
 
 static inline bool axg_tdm_lrclk_invert(unsigned int fmt)
 {
-	return (fmt & SND_SOC_DAIFMT_I2S) ^
+	return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^
 		!!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF));
 }
 
Signature · 1 line
2.20.1
maintainer
#6 lore raw

Applied "ASoC: meson: axg-tdm: fix sample clock inversion" to the asoc tree

The patch

ASoC: meson: axg-tdm: fix sample clock inversion

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From cb36ff785e868992e96e8b9e5a0c2822b680a9e2 Mon Sep 17 00:00:00 2001

From: Jerome Brunet <[email protected]>
Date: Thu, 13 Jun 2019 13:42:32 +0200
Subject: [PATCH] ASoC: meson: axg-tdm: fix sample clock inversion

The content of SND_SOC_DAIFMT_FORMAT_MASK is a number, not a bitfield, so the test to check if the format is i2s is wrong. Because of this the clock setting may be wrong. For example, the sample clock gets inverted in DSP B mode, when it should not.

Fix the lrclk invert helper function

Fixes 1a11d88f499c ("ASoC: meson: add tdm formatter base driver")
---
 sound/soc/meson/axg-tdm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/axg-tdm.h +1 -1
index e578b6f40a07..5774ce0916d4 100644
@@ -40,7 +40,7 @@ struct axg_tdm_iface {
 
 static inline bool axg_tdm_lrclk_invert(unsigned int fmt)
 {
-	return (fmt & SND_SOC_DAIFMT_I2S) ^
+	return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^
 		!!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF));
 }
 
Signature · 1 line
2.20.1
author maintainer
#7 lore raw

PATCH 4/4 ASoC: meson: axg-tdm: consistently use SND_SOC_DAIFMT defines

In reply to Jerome Brunet

There a mix of SND_SOC_DAIFMT_ and SND_SOC_DAI_FORMAT_ in axg-tdm-interface.c. Even, if this is currently the same thing, lets use the same group consistently.

---
 sound/soc/meson/axg-tdm-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/meson/axg-tdm-interface.c +2 -2
index 585ce030b79b..d51f3344be7c 100644
@@ -306,8 +306,8 @@ static int axg_tdm_iface_hw_params(struct snd_pcm_substream *substream,
 		}
 		break;
 
-	case SND_SOC_DAI_FORMAT_DSP_A:
-	case SND_SOC_DAI_FORMAT_DSP_B:
+	case SND_SOC_DAIFMT_DSP_A:
+	case SND_SOC_DAIFMT_DSP_B:
 		break;
 
 	default:
Signature · 1 line
2.20.1
maintainer
#8 lore raw

Applied "ASoC: meson: axg-tdm: consistently use SND_SOC_DAIFMT defines" to the asoc tree

The patch

ASoC: meson: axg-tdm: consistently use SND_SOC_DAIFMT defines

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 05113483fd300d7a4605a726770e7255e29f1ac7 Mon Sep 17 00:00:00 2001

From: Jerome Brunet <[email protected]>
Date: Thu, 13 Jun 2019 13:42:33 +0200
Subject: [PATCH] ASoC: meson: axg-tdm: consistently use SND_SOC_DAIFMT defines

There a mix of SND_SOC_DAIFMT_ and SND_SOC_DAI_FORMAT_ in axg-tdm-interface.c. Even, if this is currently the same thing, lets use the same group consistently.

---
 sound/soc/meson/axg-tdm-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/meson/axg-tdm-interface.c +2 -2
index 585ce030b79b..d51f3344be7c 100644
@@ -306,8 +306,8 @@ static int axg_tdm_iface_hw_params(struct snd_pcm_substream *substream,
 		}
 		break;
 
-	case SND_SOC_DAI_FORMAT_DSP_A:
-	case SND_SOC_DAI_FORMAT_DSP_B:
+	case SND_SOC_DAIFMT_DSP_A:
+	case SND_SOC_DAIFMT_DSP_B:
 		break;
 
 	default:
Signature · 1 line
2.20.1