|
|
Re: [alsa-devel] [PATCH 2/4] ASoC: mmp: add audio dma support |
On Fri, May 25, 2012 at 01:23:36PM +0530, Vinod Koul wrote:Note also...
> On Fri, 2012-05-25 at 15:11 +0800, Zhangfei Gao wrote:
> > mmp-pcm handle audio dma based on dmaengine
> > Support mmp and pxa910
> Looks like this is *not* using soc-dmaengine library, why?
This should be done at probe time, so we know the struct device, so
> > + prtd->dma_chan = dma_request_channel(mask, filter, prtd);
> > + if (!prtd->dma_chan)
> > + return -EINVAL;
that...
... this uses the right device, and...
> > +static int mmp_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
> > +{
> > + struct snd_pcm_substream *substream = pcm->streams[stream].substream;
> > + struct snd_dma_buffer *buf = &substream->dma_buffer;
> > + size_t size = mmp_pcm_hardware[stream].buffer_bytes_max;
> > + struct gen_pool *gpool;
> > +
> > + buf->dev.type = SNDRV_DMA_TYPE_DEV;
> > + buf->dev.dev = pcm->card->dev;
... we don't need crap like this.
> > +static u64 mmp_pcm_dmamask = DMA_BIT_MASK(64);
> > +
> > +int mmp_pcm_new(struct snd_soc_pcm_runtime *rtd)
> > +{
> > + struct snd_card *card = rtd->card->snd_card;
> > + struct snd_pcm *pcm = rtd->pcm;
> > + int ret = 0;
> > +
> > + if (!card->dev->dma_mask)
> > + card->dev->dma_mask = &mmp_pcm_dmamask;
> > +
> > + if (!card->dev->coherent_dma_mask)
> > + card->dev->coherent_dma_mask = DMA_BIT_MASK(64);
Because then we'll be allocating buffers against the _right_ struct device
which is the DMA engine struct device.
--
To unsubscribe from this list: send the line "unsubscribe alsa-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
[Linux ARM (vger)] [Linux ARM MSM] [Linux Omap] [Linux Arm] [Linux Tegra] [Fedora ARM] [eCos] [Linux Fastboot] [Gcc Help] [Git] [DCCP] [IETF Announce] [Security] [PDAs] [Linux] [Linux MIPS] [Yosemite Campsites] [Photos]
![]() |