diff mbox

ASoC: davinci: bug fixes for DM365 voice codec driver

Message ID 1311158730-12412-1-git-send-email-sudhakar.raj@ti.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Rajashekhara, Sudhakar July 20, 2011, 10:45 a.m. UTC
This patch fixes the following bugs found in DaVinci voice codec driver.

a. According to DM365 voice codec data sheet at [1], before starting
   recording or playback, ADC/DAC modules should follow a reset and
   enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
   the module and clearing the bit to 0 will enable the module. But the
   driver seems to be doing the reverse of it.

b. In davinci_vcif_trigger() function, a break() statement was missing
   causing the davinci_vcif_stop() function to be called as a fallback
   after calling davinci_vcif_start().

[1] http://focus.ti.com/lit/ug/sprufi9b/sprufi9b.pdf

Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
---
 sound/soc/davinci/davinci-vcif.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Comments

Sekhar Nori July 20, 2011, 11:34 a.m. UTC | #1
Hi Sudhakar,

On Wed, Jul 20, 2011 at 16:15:30, Rajashekhara, Sudhakar wrote:
> This patch fixes the following bugs found in DaVinci voice codec driver.
> 
> a. According to DM365 voice codec data sheet at [1], before starting
>    recording or playback, ADC/DAC modules should follow a reset and
>    enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
>    the module and clearing the bit to 0 will enable the module. But the
>    driver seems to be doing the reverse of it.
> 
> b. In davinci_vcif_trigger() function, a break() statement was missing
>    causing the davinci_vcif_stop() function to be called as a fallback
>    after calling davinci_vcif_start().

These should be two different patches. Also, please CC
the ALSA maintainers.

Thanks,
Sekhar
Rajashekhara, Sudhakar July 20, 2011, 12:19 p.m. UTC | #2
Hi Sekhar,

On Wed, Jul 20, 2011 at 17:04:55, Nori, Sekhar wrote:
> Hi Sudhakar,
> 
> On Wed, Jul 20, 2011 at 16:15:30, Rajashekhara, Sudhakar wrote:
> > This patch fixes the following bugs found in DaVinci voice codec driver.
> > 
> > a. According to DM365 voice codec data sheet at [1], before starting
> >    recording or playback, ADC/DAC modules should follow a reset and
> >    enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
> >    the module and clearing the bit to 0 will enable the module. But the
> >    driver seems to be doing the reverse of it.
> > 
> > b. In davinci_vcif_trigger() function, a break() statement was missing
> >    causing the davinci_vcif_stop() function to be called as a fallback
> >    after calling davinci_vcif_start().
> 
> These should be two different patches. Also, please CC the ALSA maintainers.
> 

I'll split the patches and resend them.

Regards,
Sudhakar
diff mbox

Patch

diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index 9259f1f..1f11525 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -62,9 +62,9 @@  static void davinci_vcif_start(struct snd_pcm_substream *substream)
 	w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
+		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
 	else
-		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
+		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
 
 	writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
 }
@@ -80,9 +80,9 @@  static void davinci_vcif_stop(struct snd_pcm_substream *substream)
 	/* Reset transmitter/receiver and sample rate/frame sync generators */
 	w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
+		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
 	else
-		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
+		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
 
 	writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
 }
@@ -159,6 +159,7 @@  static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		davinci_vcif_start(substream);
+		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH: