Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: ti: edma-pcm: Fix for legacy dma_slave_map based channel lookup

Most of the daVinci devices does not boot with DT. In this case the DMA
channel is looked up with dma_slave_map and for that the chan_names[]
must be configured.

Both McASP and ASP/McBSP uses "tx" and "rx" as channel names, so we can
just do this when the dev->of_node is not valid.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190830103841.25128-4-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Peter Ujfalusi and committed by
Mark Brown
27b7def9 2231b2c6

+16 -1
+16 -1
sound/soc/ti/edma-pcm.c
··· 39 39 40 40 int edma_pcm_platform_register(struct device *dev) 41 41 { 42 - return devm_snd_dmaengine_pcm_register(dev, &edma_dmaengine_pcm_config, 0); 42 + struct snd_dmaengine_pcm_config *config; 43 + 44 + if (dev->of_node) 45 + return devm_snd_dmaengine_pcm_register(dev, 46 + &edma_dmaengine_pcm_config, 0); 47 + 48 + config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL); 49 + if (!config) 50 + return -ENOMEM; 51 + 52 + *config = edma_dmaengine_pcm_config; 53 + 54 + config->chan_names[0] = "tx"; 55 + config->chan_names[1] = "rx"; 56 + 57 + return devm_snd_dmaengine_pcm_register(dev, config, 0); 43 58 } 44 59 EXPORT_SYMBOL_GPL(edma_pcm_platform_register); 45 60