All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2 1/8] ASoC: soc-compress: add snd_compress_ops
Date: Tue, 21 Apr 2020 12:49:25 +0000	[thread overview]
Message-ID: <20200421124925.GD44490@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <87v9luvdmh.wl-kuninori.morimoto.gx@renesas.com>

On Mon, Apr 20, 2020 at 04:07:50PM +0900, Kuninori Morimoto wrote:
> 
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Current snd_soc_component_driver has compr_ops, and each driver can
> have callback via it. But, it is mainly created for ALSA, thus, it
> doesn't have "component" as parameter.
> Thus, each callback can't know it is called for which component.
> Each callback currently is getting "component" by using
> snd_soc_rtdcom_lookup() with driver name.
> 
> 	--- ALSA SoC  ---
> 	...
> 	if (component->driver->compr_ops &&
> 	    component->driver->compr_ops->open)
> =>		return component->driver->compr_ops->open(stream);
> 	...
> 
> 	--- driver ---
> 	static int xxx_open(struct snd_compr_stream *stream)
> 	{
> 		struct snd_soc_pcm_runtime *rtd = stream->private_data;
> =>		struct snd_soc_component *component = snd_soc_rtdcom_lookup(..);
> 		...
> 	}
> 
> It works today, but, will not work in the future if we support multi
> CPU/Codec/Platform, because 1 rtd might have multiple same driver
> name component.
> 
> To solve this issue, each callback need to be called with component.
> We already have many component driver callbacks.
> This patch adds new snd_compress_ops, and call it with "component".
> 
> 	--- ALSA SoC  ---
> 	...
> 	if (component->driver->compress_ops->open)
> =>		return component->driver->compress_ops->open(
> 			component, substream);
> 			~~~~~~~~~
> 	...
> 
> 	--- driver ---
> 	static int xxx_open(struct snd_soc_component *component,
> 			    struct snd_compr_stream *stream)
> 	{
> =>		/* it don't need to use snd_soc_rtdcom_lookup() */
> 		...
> 	}
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

  reply	other threads:[~2020-04-21 12:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  7:05 [PATCH v2 0/8] ASoC: add snd_compress_ops and replace Kuninori Morimoto
2020-04-20  7:07 ` [PATCH v2 1/8] ASoC: soc-compress: add snd_compress_ops Kuninori Morimoto
2020-04-21 12:49   ` Charles Keepax [this message]
2020-04-20  7:08 ` [PATCH v2 2/8] ASoC: codec: wm_adsp: use snd_compress_ops Kuninori Morimoto
2020-04-21 12:51   ` Charles Keepax
2020-04-20  7:08 ` [PATCH v2 3/8] ASoC: uniphier: " Kuninori Morimoto
2020-04-20  7:08 ` [PATCH v2 4/8] ASoC: qcom: q6sp6: " Kuninori Morimoto
2020-04-20  7:09 ` [PATCH v2 5/8] ASoC: intel: atom: " Kuninori Morimoto
2020-04-20  7:09 ` [PATCH v2 6/8] ASoC: sof: " Kuninori Morimoto
2020-04-20  7:10 ` [PATCH v2 7/8] ASoC: sprd: " Kuninori Morimoto
2020-04-20  7:10 ` [PATCH v2 8/8] ASoC: soc-compress: remove snd_compr_ops Kuninori Morimoto
2020-04-21 12:51   ` Charles Keepax
2020-04-20 21:43 ` [PATCH v2 0/8] ASoC: add snd_compress_ops and replace Ranjani Sridharan
2020-04-21 18:22 ` 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=20200421124925.GD44490@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.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 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.