From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Mark Brown <broonie@kernel.org>, Lars-Peter <lars@metafoo.de>,
Simon <horms@verge.net.au>
Subject: Re: [PATCH 5/6] ASoC: add Component level struct snd_compr_ops
Date: Mon, 19 Dec 2016 11:12:35 +0000 [thread overview]
Message-ID: <20161219111235.GO1867@localhost.localdomain> (raw)
In-Reply-To: <8737hk74l7.wl%kuninori.morimoto.gx@renesas.com>
On Mon, Dec 19, 2016 at 07:38:18AM +0000, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> In current ALSA SoC, Platform has struct snd_compr_ops feature,
> but it should be supported on Component level. This patch adds it.
>
> If component level has it, many snd_pcm_ops can be called,
> but, 1st ops function only will be used now. It should/will be
> fixed in the future.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> include/sound/soc.h | 4 +
> sound/soc/soc-compress.c | 246 ++++++++++++++++++++++++++++++++---------------
> sound/soc/soc-core.c | 2 +
> 3 files changed, 175 insertions(+), 77 deletions(-)
>
> diff --git a/include/sound/soc.h b/include/sound/soc.h
> index 5db4a90..225e9b6 100644
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> @@ -777,6 +777,8 @@ struct snd_soc_component_driver {
> const struct snd_soc_dapm_route *dapm_routes;
> unsigned int num_dapm_routes;
>
> + const struct snd_compr_ops *compr_ops;
> +
> int (*probe)(struct snd_soc_component *);
> void (*remove)(struct snd_soc_component *);
> int (*suspend)(struct snd_soc_component *);
> @@ -855,6 +857,8 @@ struct snd_soc_component {
> unsigned int num_dapm_routes;
> struct snd_soc_codec *codec;
>
> + const struct snd_compr_ops *compr_ops;
> +
> int (*probe)(struct snd_soc_component *);
> void (*remove)(struct snd_soc_component *);
> int (*suspend)(struct snd_soc_component *);
> diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
> index bfd71b8..0362dd7 100644
> --- a/sound/soc/soc-compress.c
> +++ b/sound/soc/soc-compress.c
> @@ -29,7 +29,7 @@
> static int soc_compr_open(struct snd_compr_stream *cstream)
> {
> struct snd_soc_pcm_runtime *rtd = cstream->private_data;
> - struct snd_soc_platform *platform = rtd->platform;
> + struct snd_soc_component *component;
> struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> int ret = 0;
>
> @@ -44,14 +44,22 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
> }
> }
>
> - if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
> - ret = platform->driver->compr_ops->open(cstream);
> - if (ret < 0) {
> - pr_err("compress asoc: can't open platform %s\n",
> - platform->component.name);
> - goto plat_err;
> + ret = 0;
> + for_each_component(component, rtd->card) {
> + const struct snd_compr_ops *compr_ops = component->compr_ops;
> +
> + if (compr_ops && compr_ops->open) {
> + int _ret = compr_ops->open(cstream);
> +
> + if (_ret < 0) {
> + pr_err("compress asoc: can't open component %s\n",
> + component->name);
> + ret |= _ret;
> + }
Apologies if I am missing something but this really doesn't look
like equivalent code? The old code calls the ops for the platform
associated with the stream, the new code looks like it will call
the ops for every single component in the system that has
compressed ops, which would definitely cause issue. Am I missing
something here?
Thanks,
Charles
next prev parent reply other threads:[~2016-12-19 11:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 7:33 [PATCH 0/6] ASoC: platform cleanup Kuninori Morimoto
2016-12-19 7:36 ` [PATCH 1/6] ASoC: remove .delay from snd_soc_platform_driver Kuninori Morimoto
2017-01-09 20:01 ` Applied "ASoC: remove .delay from snd_soc_platform_driver" to the asoc tree Mark Brown
2016-12-19 7:37 ` [PATCH 2/6] ASoC: remove .bespoke_trigger from snd_soc_platform_driver Kuninori Morimoto
2017-01-09 20:01 ` Applied "ASoC: remove .bespoke_trigger from snd_soc_platform_driver" to the asoc tree Mark Brown
2016-12-19 7:37 ` [PATCH 3/6] ASoC: remove snd_soc_platform_trigger() Kuninori Morimoto
2017-01-09 20:01 ` Applied "ASoC: remove snd_soc_platform_trigger()" to the asoc tree Mark Brown
2016-12-19 7:37 ` [PATCH 4/6] ASoC: add for_each_component{_safe} Kuninori Morimoto
2017-01-09 20:01 ` Applied "ASoC: add for_each_component{_safe}" to the asoc tree Mark Brown
2017-01-10 12:13 ` Mark Brown
2017-01-11 6:46 ` Kuninori Morimoto
2016-12-19 7:38 ` [PATCH 5/6] ASoC: add Component level struct snd_compr_ops Kuninori Morimoto
2016-12-19 11:12 ` Charles Keepax [this message]
2016-12-20 1:59 ` Kuninori Morimoto
2016-12-20 10:02 ` Charles Keepax
2016-12-21 0:42 ` Kuninori Morimoto
2016-12-21 9:29 ` Charles Keepax
2016-12-21 23:45 ` Kuninori Morimoto
2016-12-19 7:38 ` [PATCH 6/6] ASoC: add Component level struct snd_pcm_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=20161219111235.GO1867@localhost.localdomain \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lars@metafoo.de \
/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).