alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 6/8] ASoC: sof: use snd_compress_ops
Date: Thu, 16 Apr 2020 22:39:20 -0700	[thread overview]
Message-ID: <9401d09f060ea3143c4304fd2944dafe738f1643.camel@linux.intel.com> (raw)
In-Reply-To: <873692puof.wl-kuninori.morimoto.gx@renesas.com>

On Fri, 2020-04-17 at 14:06 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> We can use snd_compress_ops.
> Let's switch to use it.
> 
> Upstream code doesn't have sof_compressed_ops.
> This patch assume it is implemented at out-of-tree.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  sound/soc/sof/compress.c | 34 +++++++++++++++++++++-------------
>  sound/soc/sof/compress.h | 34 +++++++++++++++++++++-------------
>  sound/soc/sof/pcm.c      |  4 ++--
>  sound/soc/sof/sof-priv.h |  2 +-
>  4 files changed, 45 insertions(+), 29 deletions(-)
> 
> diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c
> index 7354dc6a49cf..52a1d7ed97a5 100644
> --- a/sound/soc/sof/compress.c
> +++ b/sound/soc/sof/compress.c
> @@ -13,13 +13,14 @@
>  #include "ops.h"
>  #include "probe.h"
>  
> -struct snd_compr_ops sof_probe_compressed_ops = {
> +struct snd_compress_ops sof_probe_compressed_ops = {
>  	.copy		= sof_probe_compr_copy,
>  };
>  EXPORT_SYMBOL(sof_probe_compressed_ops);
Morimoto-san,

This change is correct based on your new snd_compress_ops. And the only
change we need is for the copy op in sof_probe_compressed_ops.

>  
> -int sof_probe_compr_open(struct snd_compr_stream *cstream,
> -		struct snd_soc_dai *dai)
> +int sof_probe_compr_open(struct snd_soc_component *component,
> +			 struct snd_compr_stream *cstream,
> +			 struct snd_soc_dai *dai)

But this one seems incorrect? This op (and the ones below except for
copy) is actually the startup op in struct snd_soc_cdai_ops. 
>  {
>  	struct snd_sof_dev *sdev =
>  				snd_soc_component_get_drvdata(dai-
> >component);
> @@ -36,8 +37,9 @@ int sof_probe_compr_open(struct snd_compr_stream
> *cstream,
>  }
>  EXPORT_SYMBOL(sof_probe_compr_open);
>  
> -int sof_probe_compr_free(struct snd_compr_stream *cstream,
> -		struct snd_soc_dai *dai)
> +int sof_probe_compr_free(struct snd_soc_component
> *componsnd_soc_cdai_opsent,
> +			 struct snd_compr_stream *cstream,
> +		 struct snd_soc_dai *dai)
ditto
> > 
>  {
>  	struct snd_sof_dev *sdev =
>  				snd_soc_component_get_drvdata(dai-
> >component);
> @@ -68,8 +70,10 @@ int sof_probe_compr_free(struct snd_compr_stream
> *cstream,
>  }
>  EXPORT_SYMBOL(sof_probe_compr_free);
>  
> -int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
> -		struct snd_compr_params *params, struct snd_soc_dai
> *dai)
> +int sof_probe_compr_set_params(struct snd_soc_component *component,
> +			       struct snd_compr_stream *cstream,
> +			       struct snd_compr_params *params,
> +			       struct snd_soc_dai *dai)
ditto
> >  {
>  	struct snd_compr_runtime *rtd = cstream->runtime;
>  	struct snd_sof_dev *sdev =
> @@ -97,8 +101,9 @@ int sof_probe_compr_set_params(struct
> snd_compr_stream *cstream,
>  }
>  EXPORT_SYMBOL(sof_probe_compr_set_params);
>  
> -int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int
> cmd,
> -		struct snd_soc_dai *dai)
> +int sof_probe_compr_trigger(struct snd_soc_component *component,
> +			    struct snd_compr_stream *cstream, int cmd,
> +			    struct snd_soc_dai *dai)
ditto
>  {
>  	struct snd_sof_dev *sdev =
>  				snd_soc_component_get_drvdata(dai-
> >component);
> @@ -107,8 +112,10 @@ int sof_probe_compr_trigger(struct
> snd_compr_stream *cstream, int cmd,
>  }
>  EXPORT_SYMBOL(sof_probe_compr_trigger);
>  
> -int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
> -		struct snd_compr_tstamp *tstamp, struct snd_soc_dai
> *dai)
> +int sof_probe_compr_pointer(struct snd_soc_component *component,
> +			    struct snd_compr_stream *cstream,
> +			    struct snd_compr_tstamp *tstamp,
> +			    struct snd_soc_dai *dai)
ditto
>  {
>  	struct snd_sof_dev *sdev =
>  				snd_soc_component_get_drvdata(dai-
> >component);
> @@ -117,8 +124,9 @@ int sof_probe_compr_pointer(struct
> snd_compr_stream *cstream,
>  }
>  EXPORT_SYMBOL(sof_probe_compr_pointer);
>  
> -int sof_probe_compr_copy(struct snd_compr_stream *cstream,
> -		char __user *buf, size_t count)
> +int sof_probe_compr_copy(struct snd_soc_component *component,
> +			 struct snd_compr_stream *cstream,
> +			 char __user *buf, size_t count)
This one is correct.

>  {
>  	struct snd_compr_runtime *rtd = cstream->runtime;
>  	unsigned int offset, n;
> diff --git a/sound/soc/sof/compress.h b/sound/soc/sof/compress.h
> index 800f163603e1..afc7ab9bc3c9 100644
> --- a/sound/soc/sof/compress.h
> +++ b/sound/soc/sof/compress.h
> @@ -13,19 +13,27 @@
>  
>  #include <sound/compress_driver.h>
>  
> -extern struct snd_compr_ops sof_probe_compressed_ops;
> +extern struct snd_compress_ops sof_probe_compressed_ops;
>  
> -int sof_probe_compr_open(struct snd_compr_stream *cstream,
> -		struct snd_soc_dai *dai);
> -int sof_probe_compr_free(struct snd_compr_stream *cstream,
> -		struct snd_soc_dai *dai);
> -int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
> -		struct snd_compr_params *params, struct snd_soc_dai
> *dai);
> -int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int
> cmd,
> -		struct snd_soc_dai *dai);
> -int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
> -		struct snd_compr_tstamp *tstamp, struct snd_soc_dai
> *dai);
> -int sof_probe_compr_copy(struct snd_compr_stream *cstream,
> -		char __user *buf, size_t count);
> +int sof_probe_compr_open(struct snd_soc_component *component,
> +			 struct snd_compr_stream *cstream,
> +			 struct snd_soc_dai *dai);
> +int sof_probe_compr_free(struct snd_soc_component *component,
> +			 struct snd_compr_stream *cstream,
> +			 struct snd_soc_dai *dai);
> +int sof_probe_compr_set_params(struct snd_soc_component *component,
> +			       struct snd_compr_stream *cstream,
> +			       struct snd_compr_params *params,
> +			       struct snd_soc_dai *dai);
> +int sof_probe_compr_trigger(struct snd_soc_component *component,
> +			    struct snd_compr_stream *cstream, int cmd,
> +			    struct snd_soc_dai *dai);
> +int sof_probe_compr_pointer(struct snd_soc_component *component,
> +			    struct snd_compr_stream *cstream,
> +			    struct snd_compr_tstamp *tstamp,
> +			    struct snd_soc_dai *dai);
All of the above are part of struct snd_soc_cdai_ops.

Thanks,
Ranjani


  reply	other threads:[~2020-04-17  5:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17  5:05 [PATCH 0/8] ASoC: add snd_compress_ops and replace Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 1/8] ASoC: soc-compress: add snd_compress_ops Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 2/8] ASoC: codec: wm_adsp: use snd_compress_ops Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 3/8] ASoC: uniphier: " Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 4/8] ASoC: qcom: q6sp6: " Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 5/8] ASoC: intel: atom: " Kuninori Morimoto
2020-04-17  5:06 ` [PATCH 6/8] ASoC: sof: " Kuninori Morimoto
2020-04-17  5:39   ` Ranjani Sridharan [this message]
2020-04-20  6:56     ` Kuninori Morimoto
2020-04-17  5:07 ` [PATCH 7/8] ASoC: sprd: " Kuninori Morimoto
2020-04-17  5:07 ` [PATCH 8/8] ASoC: soc-compress: remove snd_compr_ops Kuninori Morimoto

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=9401d09f060ea3143c4304fd2944dafe738f1643.camel@linux.intel.com \
    --to=ranjani.sridharan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.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).