From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jarkko Nikula <jhnikula@gmail.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [RFC] ASoC: multi-component: Add optional kcontrol prefix name for a DAI link
Date: Mon, 23 Aug 2010 16:21:45 +0100 [thread overview]
Message-ID: <20100823152145.GD14504@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20100820115144.451b474f.jhnikula@gmail.com>
On Fri, Aug 20, 2010 at 11:51:44AM +0300, Jarkko Nikula wrote:
> Jarkko Nikula <jhnikula@gmail.com> wrote:
> +int _snd_soc_dapm_new_control(struct snd_soc_codec *codec,
> + const struct snd_soc_dapm_widget *widget,
> + const char *name_prefix);
> int snd_soc_dapm_new_control(struct snd_soc_codec *codec,
> const struct snd_soc_dapm_widget *widget);
> +int _snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
> + const struct snd_soc_dapm_widget *widget,
> + int num, const char *name_prefix);
Best not in the header; these are not things individual drivers should
be worrying their pretty little heads about. If they should be used by
individual drivers then we need better names than just _.
> @@ -539,6 +543,7 @@ struct snd_soc_dai_link {
> const char *platform_name; /* for multi-platform */
> const char *cpu_dai_name;
> const char *codec_dai_name;
> + const char *kcontrol_prefix; /* kcontrol prefix for multi-codec */
>
> /* Keep DAI active over suspend */
> unsigned int ignore_suspend:1;
I don't see how a DAI link can ever be used to configure prefix names -
there's just not any real association between DAI links and controls,
and as soon as you hit mixing any that does exist gets lost. Probably a
table of CODEC to prefix mappings would be better.
> + if (codec->kcontrol_prefix && !w->prefixed) {
> + name_len += 1 + strlen(codec->kcontrol_prefix);
> + snprintf(prefix, sizeof(prefix), "%s.",
> + codec->kcontrol_prefix);
A space would probably be more idiomatic for the separator.
> +int _snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
> + const struct snd_soc_dapm_route *route, int num,
> + const char *name_prefix)
> {
> int i, ret;
>
> for (i = 0; i < num; i++) {
> - ret = snd_soc_dapm_add_route(codec, route);
> + ret = snd_soc_dapm_add_route(codec, route, name_prefix);
This one is a bit more fun. For this to work properly we need to
consider what happens with the cross-device links in the DAI maps which
means we need to able to cope with separate prefixes for the source and
the sink.
next prev parent reply other threads:[~2010-08-23 15:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 7:29 [RFC] ASoC: multi-component: Add optional kcontrol prefix name for a DAI link Jarkko Nikula
2010-08-16 10:07 ` Mark Brown
2010-08-16 10:53 ` Jarkko Nikula
2010-08-16 11:09 ` Mark Brown
2010-08-19 11:44 ` Jarkko Nikula
2010-08-19 13:54 ` Mark Brown
2010-08-19 15:20 ` Jarkko Nikula
2010-08-20 8:51 ` Jarkko Nikula
2010-08-23 14:46 ` Jarkko Nikula
2010-08-23 15:21 ` Mark Brown [this message]
2010-08-24 7:23 ` Jarkko Nikula
2010-08-24 10:10 ` Mark Brown
2010-08-25 10:59 ` Jarkko Nikula
2010-08-26 13:32 ` Mark Brown
2010-08-30 11:17 ` Jarkko Nikula
2010-09-02 14:25 ` Mark Brown
2010-09-03 7:55 ` Jarkko Nikula
2010-09-03 9:33 ` Mark Brown
2010-09-03 10:00 ` Liam Girdwood
2010-09-03 11:20 ` Jarkko Nikula
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=20100823152145.GD14504@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=jhnikula@gmail.com \
--cc=lrg@slimlogic.co.uk \
/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).