All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org,
	lgirdwood@gmail.com, krzk@kernel.org
Subject: Re: [alsa-devel] [PATCH 1/3] ASoC: Drop SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag
Date: Tue, 25 Oct 2016 14:22:51 +0200	[thread overview]
Message-ID: <4abcead6-1f2a-e604-97f6-96e6f26ff9f0@metafoo.de> (raw)
In-Reply-To: <1477392991-10604-1-git-send-email-s.nawrocki@samsung.com>

On 10/25/2016 12:56 PM, Sylwester Nawrocki wrote:
> Since commit 194c7dea00c68c1b1f8ff26304fa937a006f66dd
> "ASoC: dmaengine: add custom DMA config to snd_dmaengine_pcm_config"
> custom DMA channels can be also specified in chan_names[] field of
> struct snd_dmaengine_pcm_config.  This patch drops chan_name field
> of struct snd_dmaengine_dai_dma_data and makes soc-generic-dmaengine-pcm
> module using config->chan_names instead.  Remaining users of struct
> snd_dmaengine_dai_dma_data::chan_name are updated to not require
> that field.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Nice patch. One nice-to-have change request, can you split this into two
patches, one which removes the last users and one patch which removes
support for it from the framework?

Having the new DMA map framework should also allow us to eventually remove
the channel request in dmaengine_pcm_new() once all users of filter
functions have gone.

[...]
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index 6cef397..f2d372d 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -263,7 +263,6 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  	struct dmaengine_pcm *pcm = soc_platform_to_pcm(rtd->platform);
>  	const struct snd_dmaengine_pcm_config *config = pcm->config;
>  	struct device *dev = rtd->platform->dev;
> -	struct snd_dmaengine_dai_dma_data *dma_data;
>  	struct snd_pcm_substream *substream;
>  	size_t prealloc_buffer_size;
>  	size_t max_buffer_size;
> @@ -284,12 +283,9 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  		if (!substream)
>  			continue;
>  
> -		dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
> -
> -		if (!pcm->chan[i] &&
> -		    (pcm->flags & SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME))
> +		if (!pcm->chan[i] && config->chan_names[i])
>  			pcm->chan[i] = dma_request_slave_channel(dev,
> -				dma_data->chan_name);
> +				config->chan_names[i]);

I think this can be removed altogether. The only reason why we did the
delayed request is because the name would have not been available when
initially trying to request the channel when the PCM device is registered.

>  
>  		if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) {
>  			pcm->chan[i] = dmaengine_pcm_compat_request_channel(rtd,
> @@ -359,9 +355,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
>  	const char *name;
>  	struct dma_chan *chan;
>  
> -	if ((pcm->flags & (SND_DMAENGINE_PCM_FLAG_NO_DT |
> -			   SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME)) ||
> -	    !dev->of_node)
> +	if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !dev->of_node)
>  		return 0;
>  
>  	if (config && config->dma_dev) {
> 

  parent reply	other threads:[~2016-10-25 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 10:56 [PATCH 1/3] ASoC: Drop SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag Sylwester Nawrocki
2016-10-25 10:56 ` [PATCH 2/3] ASoC: samsung: s3c24xx-i2s: Don't use platform_data for DMA parameters Sylwester Nawrocki
2016-10-25 19:26   ` Applied "ASoC: samsung: s3c24xx-i2s: Don't use platform_data for DMA parameters" to the asoc tree Mark Brown
2016-10-25 10:56 ` [PATCH 3/3] ASoC: samsung: s3c24xx-i2s: Debug/error trace cleanup Sylwester Nawrocki
2016-10-25 19:26   ` Applied "ASoC: samsung: s3c24xx-i2s: Debug/error trace cleanup" to the asoc tree Mark Brown
2016-10-25 12:22 ` Lars-Peter Clausen [this message]
2016-10-25 13:39   ` [alsa-devel] [PATCH 1/3] ASoC: Drop SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4abcead6-1f2a-e604-97f6-96e6f26ff9f0@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.