Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: yegorslists@googlemail.com
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, Yegor Yefremov <yegorslists@googlemail.com>,
	vaibhav.bedia@ti.com, zonque@gmail.com
Subject: [PATCH v5 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings
Date: Thu,  7 Mar 2013 14:38:03 +0100	[thread overview]
Message-ID: <1362663483-5886-2-git-send-email-yegorslists@googlemail.com> (raw)
In-Reply-To: <1362663483-5886-1-git-send-email-yegorslists@googlemail.com>

From: Yegor Yefremov <yegorslists@googlemail.com>

Channel size settings will be made at the end of
davinci_mcasp_hw_params() routine and thus overwrite frame
format settings made for DIT mode. This patch fixes this issue
by taking op_mode into account. Tested with official PSP 3.2
kernel and sii9022a HDMI transmitter.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Daniel Mack <zonque@gmail.com>
---
v5: add Daniel's Tested-by
v4: change subjuct to include "ALSA: ASoC: "
v3: don't set mask in davinci_hw_dit_param()
v2: fix checkpatch.pl warnings

 sound/soc/davinci/davinci-mcasp.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 90a9b99..dcd56f2 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -643,16 +643,20 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
 	/* mapping of the XSSZ bit-field as described in the datasheet */
 	fmt = (word_length >> 1) - 1;
 
-	mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
-					RXSSZ(fmt), RXSSZ(0x0F));
-	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));
-	mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, RXROT(rotate),
-							RXROT(7));
+	if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) {
+		mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
+				RXSSZ(fmt), RXSSZ(0x0F));
+		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));
+		mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
+				RXROT(rotate), RXROT(7));
+		mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG,
+				mask);
+	}
+
 	mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, mask);
-	mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, mask);
 
 	return 0;
 }
@@ -772,9 +776,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream)
 /* S/PDIF */
 static void davinci_hw_dit_param(struct davinci_audio_dev *dev)
 {
-	/* TXMASK for 24 bits */
-	mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0x00FFFFFF);
-
 	/* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0
 	   and LSB first */
 	mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
-- 
1.7.7

  reply	other threads:[~2013-03-07 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 13:38 [PATCH v5 1/2] ALSA: ASoC: davinci-mcasp: don't configure AFSX direction in DIT mode yegorslists
2013-03-07 13:38 ` yegorslists [this message]
2013-04-04 10:50   ` [PATCH v5 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings Yegor Yefremov
2013-04-04 10:49 ` [PATCH v5 1/2] ALSA: ASoC: davinci-mcasp: don't configure AFSX direction in DIT mode Yegor Yefremov
2013-04-04 10:58   ` Mark Brown
2013-04-04 12:21     ` Yegor Yefremov
2013-04-04 14:04       ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362663483-5886-2-git-send-email-yegorslists@googlemail.com \
    --to=yegorslists@googlemail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=vaibhav.bedia@ti.com \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox