[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zh9MKK20Sf9Hu8AU@archie.me>
Date: Wed, 17 Apr 2024 11:12:24 +0700
From: Bagas Sanjaya <bagasdotme@...il.com>
To: Luca Ceresoli <luca.ceresoli@...tlin.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Jonathan Corbet <corbet@....net>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Mao Zhu <zhumao001@...suo.com>, Ran Sun <sunran001@...suo.com>,
Xiang wangx <wangxiang@...rlc.com>,
Shaomin Deng <dengshaomin@...rlc.com>,
Charles Han <hanchunchao@...pur.com>,
Attreyee M <tintinm2017@...il.com>,
Linux Sound System <linux-sound@...r.kernel.org>,
Linux Documentation <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/12] ASoC: doc: dapm: describe how widgets and routes
are registered
On Tue, Apr 16, 2024 at 07:56:14AM +0200, Luca Ceresoli wrote:
> diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst
> index 3a2fde1d31bf..3aca913c99fc 100644
> --- a/Documentation/sound/soc/dapm.rst
> +++ b/Documentation/sound/soc/dapm.rst
> @@ -251,8 +251,42 @@ a virtual widget - a widget with no control bits e.g.
>
> This can be used to merge two signal paths together in software.
>
> -After all the widgets have been defined, they can then be added to the DAPM
> -subsystem individually with a call to snd_soc_dapm_new_control().
> +Registering DAPM controls
> +=========================
> +
> +In many cases the DAPM widgets implemented statically in a ``static const
> +struct snd_soc_dapm_widget`` array and the routes connecting them in a
> +``static const struct snd_soc_dapm_route`` array in a codec driver, and
> +simply declared via the ``dapm_widgets`` and ``num_dapm_widgets`` fields of
> +the ``struct snd_soc_component_driver`` so the driver registration will
> +take care of populating them::
> +
> + static const struct snd_soc_dapm_widget wm2000_dapm_widgets[] = {
> + SND_SOC_DAPM_OUTPUT("SPKN"),
> + SND_SOC_DAPM_OUTPUT("SPKP"),
> + ...
> + };
> +
> + /* Target, Path, Source */
> + static const struct snd_soc_dapm_route wm2000_audio_map[] = {
> + { "SPKN", NULL, "ANC Engine" },
> + { "SPKP", NULL, "ANC Engine" },
> + ...
> + };
> +
> + static const struct snd_soc_component_driver soc_component_dev_wm2000 = {
> + ...
> + .dapm_widgets = wm2000_dapm_widgets,
> + .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets),
> + ...
> + };
> +
> +In more complex cases the list of DAPM widgets and/or routes can be only
> +known at build time. This happens for example when a driver supports
> +different models having a different set of features. In those cases
> +separate widgets and routes arrays implementing the case-specific features
> +can be registered programmatically by calling snd_soc_dapm_new_controls()
> +and snd_soc_dapm_add_routes().
>
>
> Codec/DSP Widget Interconnections
>
LGTM, thanks!
Reviewed-by: Bagas Sanjaya <bagasdotme@...il.com>
--
An old man doll... just what I always wanted! - Clara
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists