[alsa-devel] [PATCH] ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller
Peter Ujfalusi
peter.ujfalusi at ti.com
Tue Jun 2 13:55:10 CEST 2015
On 06/02/2015 02:11 PM, Jyri Sarha wrote:
>>> - switch (mcasp->version) {
>>> + ret = -EINVAL;
>>
>> Why? What was the problem with setting the ret in the default case?
>>
>
> I would need to have that I three places now for the #else cases, when
> devicetree tries to configure pcm driver that has not been compiled.
I see now, thanks for pointing out ;)
>>> + switch (davinci_mcasp_get_dma_type(mcasp)) {
>>> + case MCASP_EDMA:
>>> #if IS_BUILTIN(CONFIG_SND_EDMA_SOC) || \
>>> (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
>>> IS_MODULE(CONFIG_SND_EDMA_SOC))
>>> - case MCASP_VERSION_1:
>>> - case MCASP_VERSION_2:
>>> - case MCASP_VERSION_3:
>>> ret = edma_pcm_platform_register(&pdev->dev);
>>> - break;
>>> +#else
>>> + dev_err(&pdev->dev, "Missing SND_EDMA_SOC\n");
>>> #endif
>>> + break;
>>> + case MCASP_SDMA:
>>> #if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
>>> (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
>>> IS_MODULE(CONFIG_SND_OMAP_SOC))
>>> - case MCASP_VERSION_4:
>>> ret = omap_pcm_platform_register(&pdev->dev);
>>> - break;
>>> +#else
>>> + dev_err(&pdev->dev, "Missing SND_SDMA_SOC\n");
>>> #endif
>>> + break;
>>> default:
>>> - dev_err(&pdev->dev, "Invalid McASP version: %d\n",
>>> - mcasp->version);
>>> - ret = -EINVAL;
>>> + dev_err(&pdev->dev, "No DMA controller found\n");
>>> break;
>>> }
--
Péter
More information about the Alsa-devel
mailing list