Skip to contentSkip to conversation

ASoC: DaVinci: McASP driver enhacements

PATCH In review Chaithrika U S 2 participants 2 messages Aug 11, 2009 – Aug 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ASoC: DaVinci: McASP driver enhacements

On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral has FIFO support. This FIFO provides additional data buffering. It also provides tolerance to variation in host/DMA controller response times.
The read and write FIFO sizes are 256 bytes each. If FIFO is enabled, the DMA events from McASP are sent to the FIFO which in turn sends DMA requests to the host CPU according to the thresholds programmed.
More details of the FIFO operation can be found at
http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=
sprufm1&fileType=pdf

This patch adds support for FIFO configuration. The platform data has a version field which differentiates the McASP on different SoCs.

---
In this version of the patch, the davinci-i2s driver changes have been done to account acnt member introduced in the dma_params structure. Also, the DAI format addition has been removed from this patch.

Applies to ALSA GIT tree on branch topic/asoc at
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=shortlog;
h=topic/asoc

 sound/soc/davinci/davinci-i2s.c   |    1 +
 sound/soc/davinci/davinci-mcasp.c |  105 ++++++++++++++++++++++++++++++++++---
 sound/soc/davinci/davinci-mcasp.h |    5 ++
 sound/soc/davinci/davinci-pcm.c   |    4 +-
 sound/soc/davinci/davinci-pcm.h   |    1 +
 5 files changed, 107 insertions(+), 9 deletions(-)
sound/soc/davinci/davinci-i2s.c +1 -0
index 2a56fb7..12a6c54 100644
@@ -406,6 +406,7 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
+	dma_params->acnt  = dma_params->data_type;
 	rcr |= DAVINCI_MCBSP_RCR_RFRLEN1(1);
 	xcr |= DAVINCI_MCBSP_XCR_XFRLEN1(1);
 
sound/soc/davinci/davinci-mcasp.c +97 -8

205 lines not on this page · raw message

sound/soc/davinci/davinci-mcasp.h +5 -0
index 36b7104..554354c 100644
@@ -50,6 +50,11 @@ struct davinci_audio_dev {
 	u8	op_mode;
 	u8	num_serializer;
 	u8	*serial_dir;
+	u8	version;
+
+	/* McASP FIFO related */
+	u8	txnumevt;
+	u8	rxnumevt;
 };
 
 #endif	/* DAVINCI_MCASP_H */
sound/soc/davinci/davinci-pcm.c +3 -1
index ab43a53..091dacb 100644
@@ -67,6 +67,7 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
 	dma_addr_t src, dst;
 	unsigned short src_bidx, dst_bidx;
 	unsigned int data_type;
+	unsigned short acnt;
 	unsigned int count;
 
 	period_size = snd_pcm_lib_period_bytes(substream);
@@ -91,11 +92,12 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
 		dst_bidx = data_type;
 	}
 
+	acnt = prtd->params->acnt;
 	edma_set_src(lch, src, INCR, W8BIT);
 	edma_set_dest(lch, dst, INCR, W8BIT);
 	edma_set_src_index(lch, src_bidx, 0);
 	edma_set_dest_index(lch, dst_bidx, 0);
-	edma_set_transfer_params(lch, data_type, count, 1, 0, ASYNC);
+	edma_set_transfer_params(lch, acnt, count, 1, 0, ASYNC);
 
 	prtd->period++;
 	if (unlikely(prtd->period >= runtime->periods))
sound/soc/davinci/davinci-pcm.h +1 -0
index eb4287f..63d9625 100644
@@ -19,6 +19,7 @@
 struct davinci_pcm_dma_params {
 	char *name;			/* stream identifier */
 	int channel;			/* sync dma channel ID */
+	unsigned short acnt;
 	dma_addr_t dma_addr;		/* device physical address for DMA */
 	enum dma_event_q eventq_no;	/* event queue number */
 	unsigned char data_type;	/* xfer data type */
Signature · 1 line
1.5.6
#1 lore raw
Quoted 2 lines · Chaithrika U S

On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral has FIFO support. This FIFO provides additional data buffering. It also provides

All three look good - applied, thanks.