Re: [PATCH 7/7] ASoC: Samsung: Update DMA interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 04, 2011 at 09:18:35PM +0900, Kukjin Kim wrote:

> +static void audio_buffdone(void *data)
> +{
> +	struct snd_pcm_substream *substream = data;
> +	struct runtime_data *prtd;
> +	struct dma_chan *chan;
> +
> +	prtd = substream->runtime->private_data;
> +
> +	chan = prtd->params->chan;
> +	prtd->params->desc =
> +		chan->device->device_prep_dma_cyclic(
> +		chan, prtd->dma_pos, prtd->dma_period, prtd->dma_period,
> +		substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
> +		DMA_TO_DEVICE : DMA_FROM_DEVICE);
> +	if (!prtd->params->desc)
> +		dev_err(&chan->dev->device, "cannot prepare cyclic dma\n");
> +
> +	prtd->params->desc->callback = audio_buffdone;
> +	prtd->params->desc->callback_param = substream;
> +	dmaengine_submit(prtd->params->desc);
> +
> +	prtd->dma_pos += prtd->dma_period;
> +	if (prtd->dma_pos >= prtd->dma_end)
> +		prtd->dma_pos = prtd->dma_start;
> +
> +	if (substream)
> +		snd_pcm_period_elapsed(substream);
> +}

Two questions here:

- It looks like a lot of this code can be shared between all the drivers
  using the dmaengine API.  Is there any reason not to factor it out?
- Should this not be adding a new driver for dmaengine based Samsung
  CPUs?  The ifdefs are very big.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux