[alsa-devel] [PATCHv1 1/8] ALSA: Add SAI SoC Digital Audio Interface driver.

Xiubo Li-B47053 B47053 at freescale.com
Mon Oct 28 01:58:42 EDT 2013


Hi Dan, Vinod,


> > +static int fsl_sai_probe(struct platform_device *pdev) {
> [...]
> > +
> > +	sai->dma_params_rx.addr = res->start + SAI_RDR;
> > +	sai->dma_params_rx.maxburst = 6;
> > +	index = of_property_match_string(np, "dma-names", "rx");
> > +	ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells", index,
> > +				&dma_args);
> > +	if (ret)
> > +		return ret;
> > +	sai->dma_params_rx.slave_id = dma_args.args[1];
> > +
> > +	sai->dma_params_tx.addr = res->start + SAI_TDR;
> > +	sai->dma_params_tx.maxburst = 6;
> > +	index = of_property_match_string(np, "dma-names", "tx");
> > +	ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells", index,
> > +				&dma_args);
> > +	if (ret)
> > +		return ret;
> > +	sai->dma_params_tx.slave_id = dma_args.args[1];
> 
> The driver should not have to manually parse the dma devicetree
> properties, this is something that should be handled by the dma engine
> driver.
> 

What do you think about the DMA slave_id ?
I have been noticed by one colleague that this should be parsed here, which
is from your opinions ?


> > +
> > +	ret = snd_soc_register_component(&pdev->dev, &fsl_component,
> > +			&fsl_sai_dai, 1);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = fsl_pcm_dma_init(pdev);
> > +	if (ret)
> > +		goto out;





More information about the linux-arm-kernel mailing list