Skip to contentSkip to conversation

ALSA: ASoC: davinci-mcasp: don't configure AFSX direction in DIT mode

PATCH Superseded [email protected] 2 participants 6 messages Mar 4, 2013

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 ALSA: ASoC: davinci-mcasp: don't configure AFSX direction in DIT mode

From: Yegor Yefremov <[email protected]>

AFSX won't be used in DIT mode. The related pins are AHCLKX and the data pins.

---
v4: change subjuct to include "ALSA: ASoC: "

 sound/soc/davinci/davinci-mcasp.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
sound/soc/davinci/davinci-mcasp.c +0 -3
index 9321e5c..90a9b99 100644
@@ -772,9 +772,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)
 {
-	/* Set the PDIR for Serialiser as output */
-	mcasp_set_bits(dev->base + DAVINCI_MCASP_PDIR_REG, AFSX);
-
 	/* TXMASK for 24 bits */
 	mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0x00FFFFFF);
 
Signature · 1 line
1.7.7
#1 lore raw

PATCH v4 2/2 ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings

From: Yegor Yefremov <[email protected]>

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.

---
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(-)
sound/soc/davinci/davinci-mcasp.c +13 -12
index 90a9b99..dcd56f2 100644
@@ -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,
Signature · 1 line
1.7.7
Tested-by on v4 2/2
#2 lore raw

Re: [PATCH v4 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings

Quoted 9 lines · On 04.03.2013 11:34, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

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.

For both, wrt a survived regression test :)

Thanks,
Daniel

Quoted 53 lines

---
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(-)
sound/soc/davinci/davinci-mcasp.c +13 -12
index 90a9b99..dcd56f2 100644
@@ -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,
#3 lore raw

Re: [PATCH v4 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings

Quoted 9 lines · Daniel Mack
Quoted 8 lines · On 04.03.2013 11:34, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

For both, wrt a survived regression test :)

Thanks.

How do you make the test? Is it "doesn't break compilation" test? Or do you have S/PDIF capable device?

Yegor

#4 lore raw

Re: [PATCH v4 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings

Quoted 12 lines · Yegor Yefremov
Quoted 11 lines · Daniel Mack
Quoted 9 lines · On 04.03.2013 11:34, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

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.

Quoted 8 lines
Quoted 3 lines

For both, wrt a survived regression test :)

Thanks.

How do you make the test? Is it "doesn't break compilation" test? Or do you have S/PDIF capable device?

No, I'm running the driver in IIS mode, with a codec attached to the I2S lines. All I can do for now is test that your patches do not break my environment. I can not test DIT.

Daniel

#5 lore raw

Re: [PATCH v4 2/2] ALSA: ASoC: davinci-mcasp: don't overwrite DIT settings

Quoted 17 lines · Daniel Mack
Quoted 16 lines · Yegor Yefremov
Quoted 14 lines · Daniel Mack
Quoted 9 lines · On 04.03.2013 11:34, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

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.

For both, wrt a survived regression test :)

Quoted 8 lines
Quoted 4 lines

Thanks.

How do you make the test? Is it "doesn't break compilation" test? Or do you have S/PDIF capable device?

No, I'm running the driver in IIS mode, with a codec attached to the I2S lines. All I can do for now is test that your patches do not break my environment. I can not test DIT.

O.K. I see. That is actually, what I wonted to know, if it doesn't break i2s.

Yegor