Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e224f32 authored by Troy Kisky's avatar Troy Kisky Committed by Mark Brown
Browse files

ASoC: DaVinci: pcm, fix underrun by using sram



Fix underruns by using dma to copy 1st to sram
in a ping/pong buffer style and then copying from
the sram to the ASP. This also has the advantage
of tolerating very long interrupt latency on dma
completion.

Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 1587ea31
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ struct snd_platform_data {
	 * when compared to previous behavior.
	 */
	unsigned enable_channel_combine:1;
	unsigned sram_size_playback;
	unsigned sram_size_capture;

	/* McASP specific fields */
	int tdm_slots;
+6 −1
Original line number Diff line number Diff line
@@ -545,8 +545,13 @@ static int davinci_i2s_probe(struct platform_device *pdev)
		ret = -ENOMEM;
		goto err_release_region;
	}
	if (pdata)
	if (pdata) {
		dev->enable_channel_combine = pdata->enable_channel_combine;
		dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].sram_size =
			pdata->sram_size_playback;
		dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].sram_size =
			pdata->sram_size_capture;
	}
	dev->clk = clk_get(&pdev->dev, NULL);
	if (IS_ERR(dev->clk)) {
		ret = -ENODEV;
+472 −43

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ struct davinci_pcm_dma_params {
	int channel;			/* sync dma channel ID */
	unsigned short acnt;
	dma_addr_t dma_addr;		/* device physical address for DMA */
	unsigned sram_size;
	enum dma_event_q eventq_no;	/* event queue number */
	unsigned char data_type;	/* xfer data type */
	unsigned char convert_mono_stereo;