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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: dmaengine_pcm: Allow passing component name via config

Merge series from Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>:

At the moment we cannot instantiate two dmaengine_pcms with the same
parent device, as the components will be named the same, leading to
conflicts.

Add 'name' field to the snd_dmaengine_pcm_config, and use that (if
defined) as the component name instead of deriving the component name
from the device.

+10 -3
+2
include/sound/dmaengine_pcm.h
··· 118 118 * which do not use devicetree. 119 119 * @process: Callback used to apply processing on samples transferred from/to 120 120 * user space. 121 + * @name: Component name. If null, dev_name will be used. 121 122 * @compat_filter_fn: Will be used as the filter function when requesting a 122 123 * channel for platforms which do not use devicetree. The filter parameter 123 124 * will be the DAI's DMA data. ··· 144 143 int (*process)(struct snd_pcm_substream *substream, 145 144 int channel, unsigned long hwoff, 146 145 unsigned long bytes); 146 + const char *name; 147 147 dma_filter_fn compat_filter_fn; 148 148 struct device *dma_dev; 149 149 const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];
+5 -3
sound/soc/soc-core.c
··· 2796 2796 INIT_LIST_HEAD(&component->list); 2797 2797 mutex_init(&component->io_mutex); 2798 2798 2799 - component->name = fmt_single_name(dev, &component->id); 2800 2799 if (!component->name) { 2801 - dev_err(dev, "ASoC: Failed to allocate name\n"); 2802 - return -ENOMEM; 2800 + component->name = fmt_single_name(dev, &component->id); 2801 + if (!component->name) { 2802 + dev_err(dev, "ASoC: Failed to allocate name\n"); 2803 + return -ENOMEM; 2804 + } 2803 2805 } 2804 2806 2805 2807 component->dev = dev;
+3
sound/soc/soc-generic-dmaengine-pcm.c
··· 441 441 pcm->config = config; 442 442 pcm->flags = flags; 443 443 444 + if (config->name) 445 + pcm->component.name = config->name; 446 + 444 447 ret = dmaengine_pcm_request_chan_of(pcm, dev, config); 445 448 if (ret) 446 449 goto err_free_dma;