All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: davinci: fix sample rotation
@ 2013-05-16 13:25 Daniel Mack
  2013-05-21 18:22 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Mack @ 2013-05-16 13:25 UTC (permalink / raw)
  To: alsa-devel
  Cc: Michal Bachraty, stable, Daniel Mack, broonie, vaibhav.bedia,
	marek.belisko, [3.9 only]

McASP serial audio engine needs different rotation values on TX and RX
channels. Commit dde109fb462 ("ASoC: McASP: Fix data rotation for
playback. Enables 24bit audio playback") changed the calculation to fix
the playback format, but broke the capture stream by doing it for both
TXFMT and RXFMT.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Michal Bachraty <michal.bachraty@streamunlimited.com>
Cc: stable@vger.kernel.org [3.9 only]
---
 sound/soc/davinci/davinci-mcasp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 63633e9..8d805ec 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -628,7 +628,8 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
 				       int word_length)
 {
 	u32 fmt;
-	u32 rotate = (word_length / 4) & 0x7;
+	u32 tx_rotate = (word_length / 4) & 0x7;
+	u32 rx_rotate = (32 - word_length) / 4;
 	u32 mask = (1ULL << word_length) - 1;
 
 	/*
@@ -651,9 +652,9 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
 				TXSSZ(fmt), TXSSZ(0x0F));
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
-				TXROT(rotate), TXROT(7));
+				TXROT(tx_rotate), TXROT(7));
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
-				RXROT(rotate), RXROT(7));
+				RXROT(rx_rotate), RXROT(7));
 		mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG,
 				mask);
 	}
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: davinci: fix sample rotation
  2013-05-16 13:25 [PATCH] ASoC: davinci: fix sample rotation Daniel Mack
@ 2013-05-21 18:22 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-05-21 18:22 UTC (permalink / raw)
  To: Daniel Mack
  Cc: marek.belisko, stable, alsa-devel, Michal Bachraty, vaibhav.bedia


[-- Attachment #1.1: Type: text/plain, Size: 386 bytes --]

On Thu, May 16, 2013 at 03:25:01PM +0200, Daniel Mack wrote:
> McASP serial audio engine needs different rotation values on TX and RX
> channels. Commit dde109fb462 ("ASoC: McASP: Fix data rotation for
> playback. Enables 24bit audio playback") changed the calculation to fix
> the playback format, but broke the capture stream by doing it for both
> TXFMT and RXFMT.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-21 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-16 13:25 [PATCH] ASoC: davinci: fix sample rotation Daniel Mack
2013-05-21 18:22 ` Mark Brown

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.