Skip to contentSkip to conversation

ALSA ASOC Adds DSP DAI format support for platform driver

RFC PATCH In review Arun KS 3 participants 10 messages Sep 29, 2008 – Sep 30, 2008

Subsystems (2)
lore
Share & tools
lore

Arun KS

author
#0 lore raw

RFC PATCH 3/5 ALSA ASOC Adds DSP DAI format support for platform driver

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +0 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct

snd_soc_dai *cpu_dai,
regs->rcr2 |= RDATDLY(1);
regs->xcr2 |= XDATDLY(1);
break;
+ case SND_SOC_DAIFMT_DSP_A:
+ /* 0-bit data delay */
+ regs->rcr2 |= RDATDLY(0);
+ regs->xcr2 |= XDATDLY(0);
+ break;
+
default:
/* Unsupported data format */
return -EINVAL;

Signature · 1 line
1.5.3.4
#2 lore raw
In reply to Arun KS
Quoted 13 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +0 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 10 lines
sound/soc/omap/omap-mcbsp.c +6 -0
 		regs->rcr2	|= RDATDLY(1);
 		regs->xcr2	|= XDATDLY(1);
 		break;
+	case SND_SOC_DAIFMT_DSP_A:
+		/* 0-bit data delay */
+		regs->rcr2	|= RDATDLY(0);
+		regs->xcr2	|= XDATDLY(0);
+		break;
+
 	default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

Jarkko

#3 lore raw
In reply to Arun KS
Quoted 13 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +0 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 10 lines
sound/soc/omap/omap-mcbsp.c +6 -0
 		regs->rcr2	|= RDATDLY(1);
 		regs->xcr2	|= XDATDLY(1);
 		break;
+	case SND_SOC_DAIFMT_DSP_A:
+		/* 0-bit data delay */
+		regs->rcr2	|= RDATDLY(0);
+		regs->xcr2	|= XDATDLY(0);
+		break;
+
 	default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

Jarkko

author
#4 lore raw

Thanks all for the comments.
I will incorporate and send the patches again.

Quoted 37 lines · Jarkko Nikula
Quoted 13 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +0 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 10 lines
sound/soc/omap/omap-mcbsp.c +6 -0
              regs->rcr2      |= RDATDLY(1);
              regs->xcr2      |= XDATDLY(1);
              break;
+     case SND_SOC_DAIFMT_DSP_A:
+             /* 0-bit data delay */
+             regs->rcr2      |= RDATDLY(0);
+             regs->xcr2      |= XDATDLY(0);
+             break;
+
      default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

Jarkko
--
To unsubscribe from this list: send the line "unsubscribe alsa-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#5 lore raw
In reply to Jarkko Nikula

Thanks all for the comments.
I will incorporate and send the patches again.

Quoted 37 lines · Jarkko Nikula
Quoted 13 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +0 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 10 lines
sound/soc/omap/omap-mcbsp.c +6 -0
              regs->rcr2      |= RDATDLY(1);
              regs->xcr2      |= XDATDLY(1);
              break;
+     case SND_SOC_DAIFMT_DSP_A:
+             /* 0-bit data delay */
+             regs->rcr2      |= RDATDLY(0);
+             regs->xcr2      |= XDATDLY(0);
+             break;
+
      default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

Jarkko
--
To unsubscribe from this list: send the line "unsubscribe alsa-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#6 lore raw
In reply to Jarkko Nikula
Quoted 21 lines · Jarkko Nikula
Quoted 18 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +2 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,
              regs->rcr2      |= RDATDLY(1);
              regs->xcr2      |= XDATDLY(1);
              break;
+     case SND_SOC_DAIFMT_DSP_A:
+             /* 0-bit data delay */
Quoted 9 lines

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 5 lines
sound/soc/omap/omap-mcbsp.c +4 -0
+             regs->rcr2      |= RDATDLY(0);
+             regs->xcr2      |= XDATDLY(0);
+             break;
+
      default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

In DSP Mode, Frame sync is followed by two data words. I tested this patch and its working. Am i missing something ?

Quoted 7 lines

Jarkko
--
To unsubscribe from this list: send the line "unsubscribe alsa-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#7 lore raw
In reply to Jarkko Nikula
Quoted 21 lines · Jarkko Nikula
Quoted 18 lines · On Mon, 29 Sep 2008 15:20:12 +0530 "ext Arun KS" <[email protected]>…

Enables DSP DAI format for mcbsp in omap platform driver

---
 sound/soc/omap/omap-mcbsp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/omap/omap-mcbsp.c +2 -0
index 3a4cc4b..1c024aa 100644
@@ -292,6 +292,12 @@ static int omap_mcbsp_dai_set_dai_fmt(struct
 snd_soc_dai *cpu_dai,
              regs->rcr2      |= RDATDLY(1);
              regs->xcr2      |= XDATDLY(1);
              break;
+     case SND_SOC_DAIFMT_DSP_A:
+             /* 0-bit data delay */
Quoted 9 lines

sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_fmt(struct · line 302

Quoted 5 lines
sound/soc/omap/omap-mcbsp.c +4 -0
+             regs->rcr2      |= RDATDLY(0);
+             regs->xcr2      |= XDATDLY(0);
+             break;
+
      default:

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

In DSP Mode, Frame sync is followed by two data words. I tested this patch and its working. Am i missing something ?

Quoted 7 lines

Jarkko
--
To unsubscribe from this list: send the line "unsubscribe alsa-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 7 lines · On Tue, 30 Sep 2008 12:11:45 +0530 "ext Arun KS" <[email protected]>…
Quoted 3 lines

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

In DSP Mode, Frame sync is followed by two data words. I tested this patch and its working. Am i missing something ?

I meant length of FS/LRC[IN | OUT] signal itself. E.g. see figures 3-7 and 3-8 in AIC23 data manual:

http://www.ti.com/lit/gpn/tlv320aic23

Now omap-mcbsp.c sets this FS length to 16 BCLK periods in omap_mcbsp_dai_hw_params. Currently code is pretty much tailored for 16-bit stereo I2S so probably some McBSP configuration bits are better set in another function than currently :-)

Jarkko

#9 lore raw
In reply to Arun KS
Quoted 7 lines · On Tue, 30 Sep 2008 12:11:45 +0530 "ext Arun KS" <[email protected]>…
Quoted 3 lines

I think this is not enough. The word clock length equals to one BCLK cycle in DSP mode. Not n channel bit BCLK cycles like in I2S.

In DSP Mode, Frame sync is followed by two data words. I tested this patch and its working. Am i missing something ?

I meant length of FS/LRC[IN | OUT] signal itself. E.g. see figures 3-7 and 3-8 in AIC23 data manual:

http://www.ti.com/lit/gpn/tlv320aic23

Now omap-mcbsp.c sets this FS length to 16 BCLK periods in omap_mcbsp_dai_hw_params. Currently code is pretty much tailored for 16-bit stereo I2S so probably some McBSP configuration bits are better set in another function than currently :-)

Jarkko