[alsa-devel] [PATCH v2] ASoC: dapm - Add API call to query the widgets of valid DAPM paths.
Mark Brown
broonie at opensource.wolfsonmicro.com
Wed Jul 20 22:15:25 CEST 2011
On Wed, Jul 20, 2011 at 12:23:15PM +0100, Liam Girdwood wrote:
> + dev_dbg(widget->dapm->dev," %c : %s -> %s -> %s\n",
> + path->sink && path->connect ? '*' : ' ',
> + widget->name, path->name, path->sink->name);
We should fix the debugfs stuff to include unconnected paths too, only
showing currently active paths was a mistake. Might be worth dialing
down to vdbg too, we look at DAPM a *lot* during scenario changes and
on big systems it can obscure what's going on.
> +/**
> + * snd_soc_dapm_get_connected_widgets - query audio path and it's widgets.
> + * @dapm: the dapm context.
> + * @stream_name: stream name.
> + * @list: list of active widgets for this stream.
> + * @stream: stream direction.
> + *
> + * Queries DAPM graph as to whether an valid audio stream path exists for
> + * the initial widget specified by name. This takes into account
s/initial widget/stream/
> + /* get stream root widget AIF from stream string and direction */
> + list_for_each_entry(w, &dapm->card->widgets, list) {
> +
> + if (w->id != type)
> + continue;
> +
> + if (strstr(w->sname, stream_name))
> + goto found;
> + }
> + dev_err(dapm->dev, "root widget for %s not found\n", stream_name);
Hrm, this will only check the widgets connected to the first widget it
sees for an AIF. For streams with multiple widgets connected (eg, left
and right channel) it's only going to see things on the first widget it
comes across which probably isn't what we were expecting. Unless we
change to match the comment and query by widget name in which case we're
already requiring uniqueness.
More information about the Alsa-devel
mailing list