alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	tiwai@suse.de, broonie@opensource.wolfsonmicro.com,
	liam.r.girdwood@intel.com, vinod.koul@linux.jf.intel.com
Subject: Re: [PATCH] ASoC: soc-compress: Add support for not memory mapped DSPs
Date: Sun, 27 Jan 2013 20:04:16 -0800	[thread overview]
Message-ID: <20130128040416.GJ26562@intel.com> (raw)
In-Reply-To: <1359104400-18527-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

On Fri, Jan 25, 2013 at 09:00:00AM +0000, Charles Keepax wrote:
> The ASoC compressed API did not implement the copy callback in its
> compressed ops which is required for DSPs that are not memory mapped.
> This patch adds a second set of compressed ops which does implement the
> copy callback and uses that when copy is defined in the platform
> compressed ops, ie. when the DSP is not memory mapped.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> +static struct snd_compr_ops soc_compr_nomap_ops = {
> +	.open		= soc_compr_open,
> +	.free		= soc_compr_free,
> +	.set_params	= soc_compr_set_params,
> +	.get_params	= soc_compr_get_params,
> +	.trigger	= soc_compr_trigger,
> +	.pointer	= soc_compr_pointer,
> +	.copy		= soc_compr_copy,
> +	.ack		= soc_compr_ack,
> +	.get_caps	= soc_compr_get_caps,
> +	.get_codec_caps = soc_compr_get_codec_caps
> +};
Somehow I dont like the idea of doing one more ops for this.
> +
>  /* create a new compress */
>  int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
>  {
>  	struct snd_soc_codec *codec = rtd->codec;
> +	struct snd_soc_platform *platform = rtd->platform;
>  	struct snd_soc_dai *codec_dai = rtd->codec_dai;
>  	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
>  	struct snd_compr *compr;
> @@ -335,7 +366,10 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
>  		return -ENOMEM;
>  	}
>  
> -	compr->ops = &soc_compr_ops;
> +	if (platform->driver->compr_ops && platform->driver->compr_ops->copy)
> +		compr->ops = &soc_compr_nomap_ops;
> +	else
> +		compr->ops = &soc_compr_ops;
How about:
	compr->ops = &soc_compr_ops;
	if (platform->driver->compr_ops && !platform->driver->compr_ops->copy)
		compr->ops->copy = NULL;

That way you set it to null for those who doent implement this and would called
for drivers who implement this.

--
~Vinod

  reply	other threads:[~2013-01-28  4:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25  9:00 [PATCH] ASoC: soc-compress: Add support for not memory mapped DSPs Charles Keepax
2013-01-28  4:04 ` Vinod Koul [this message]
2013-01-28  4:56   ` Mark Brown
2013-01-28  6:09     ` Vinod Koul
2013-01-28  6:44       ` Mark Brown
2013-01-28  9:34         ` Vinod Koul
2013-01-28 10:49           ` Charles Keepax
2013-01-29 18:51             ` [PATCH v2] " Charles Keepax
2013-01-31  3:02               ` Vinod Koul
2013-02-05 10:41                 ` [PATCH v3] " Charles Keepax
2013-02-05 11:54                   ` Vinod Koul
2013-02-05 13:56                   ` 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=20130128040416.GJ26562@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linux.jf.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;
as well as URLs for NNTP newsgroup(s).