Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Jie Yang <yang.jie@intel.com>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	liam.r.girdwood@intel.com
Subject: Re: [PATCH v4] ASoC: soc-compress: add config item for soc-compress to make it compiled only when needed
Date: Wed, 14 Oct 2015 10:20:51 +0100	[thread overview]
Message-ID: <20151014092051.GM8805@ck-lbox> (raw)
In-Reply-To: <1444750860-19355-1-git-send-email-yang.jie@intel.com>

On Tue, Oct 13, 2015 at 11:41:00PM +0800, Jie Yang wrote:
> We don't always need soc-compress in soc, here add a config item
> SND_SOC_COMPRESS, when nobody select it, the soc-compress will
> not be compiled.
> 
> Here also change Kconfig to 'select SND_SOC_COMPRESS' for drivers
> that needed soc-compress.
> 
> Signed-off-by: Jie Yang <yang.jie@intel.com>
> ---
>  include/sound/soc-dai.h                      |  2 +-
>  include/sound/soc.h                          |  4 +++-
>  sound/soc/Kconfig                            |  5 ++++-
>  sound/soc/Makefile                           |  3 ++-
>  sound/soc/intel/Kconfig                      |  1 +
>  sound/soc/intel/atom/sst-mfld-platform-pcm.c |  2 +-
>  sound/soc/soc-compress.c                     | 12 ++++++++++--
>  sound/soc/soc-core.c                         |  4 ++--
>  8 files changed, 24 insertions(+), 9 deletions(-)
> 
> diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
> index 2df96b1..238200f 100644
> --- a/include/sound/soc-dai.h
> +++ b/include/sound/soc-dai.h
> @@ -214,7 +214,7 @@ struct snd_soc_dai_driver {
>  	int (*suspend)(struct snd_soc_dai *dai);
>  	int (*resume)(struct snd_soc_dai *dai);
>  	/* compress dai */
> -	bool compress_dai;
> +	int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);

This feels a little awkward to be using a function pointer here.
It somewhat implies I might want to customise this function but
am I every going to want to set this to something other than
snd_soc_new_compress?

> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 3b471f9..24b0960 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1370,9 +1370,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
>  		soc_dpcm_debugfs_add(rtd);
>  #endif
>  
> -	if (cpu_dai->driver->compress_dai) {
> +	if (cpu_dai->driver->compress_new) {

Would it maybe be nicer to just change this to:
if (IS_ENABLED(..)) && cpu_dai...)

Anyone else have any thoughts on that?

>  		/*create compress_device"*/
> -		ret = soc_new_compress(rtd, num);
> +		ret = cpu_dai->driver->compress_new(rtd, num);
>  		if (ret < 0) {
>  			dev_err(card->dev, "ASoC: can't create compress %s\n",
>  					 dai_link->stream_name);

Thanks,
Charles

  reply	other threads:[~2015-10-14  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 15:41 [PATCH v4] ASoC: soc-compress: add config item for soc-compress to make it compiled only when needed Jie Yang
2015-10-14  9:20 ` Charles Keepax [this message]
2015-10-14 12:57   ` Jie, Yang
2015-10-14 12:46     ` Charles Keepax
2015-10-19 14:22       ` Jie, Yang
2015-10-22 12:51       ` Mark Brown
2015-10-22 23:09 ` Applied "ASoC: compress: add config item for soc-compress to make it compiled only when needed" to the asoc tree Mark Brown

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=20151014092051.GM8805@ck-lbox \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=yang.jie@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox