From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Charles Keepax <ckeepax@opensource.cirrus.com>, broonie@kernel.org
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
peter.ujfalusi@linux.intel.com, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com
Subject: Re: [PATCH v5 5/6] ASoC: SDCA: Create ALSA controls from DisCo
Date: Mon, 12 May 2025 15:53:36 +0200 [thread overview]
Message-ID: <cd574985-e434-46d9-91ff-a2782c6e8eef@linux.dev> (raw)
In-Reply-To: <20250512124240.799509-6-ckeepax@opensource.cirrus.com>
> +static bool exported_control(struct sdca_control *control)
> +{
> + /* No need to export control for something that only has one value */
> + if (control->has_fixed)
> + return false;
why is that? It'd simplify userspace if there was always a way to get a value, even if it's fixed?
> +
> + return control->layers & (SDCA_ACCESS_LAYER_USER |
> + SDCA_ACCESS_LAYER_APPLICATION);
That filter on access layer does make sense however.
> +}
> +
> /**
> * sdca_asoc_count_component - count the various component parts
> * @function: Pointer to the Function information.
> @@ -76,6 +87,8 @@ static struct sdca_control_range *selector_find_range(struct device *dev,
> * required number of DAPM widgets for the Function.
> * @num_routes: Output integer pointer, will be filled with the
> * required number of DAPM routes for the Function.
> + * @num_controls: Output integer pointer, will be filled with the
> + * required number of ALSA controls for the Function.
> *
> * This function counts various things within the SDCA Function such
> * that the calling driver can allocate appropriate space before
> @@ -84,12 +97,13 @@ static struct sdca_control_range *selector_find_range(struct device *dev,
> * Return: Returns zero on success, and a negative error code on failure.
> */
> int sdca_asoc_count_component(struct device *dev, struct sdca_function_data *function,
> - int *num_widgets, int *num_routes)
> + int *num_widgets, int *num_routes, int *num_controls)
> {
> - int i;
> + int i, j;
>
> *num_widgets = function->num_entities - 1;
> *num_routes = 0;
> + *num_controls = 0;
>
> for (i = 0; i < function->num_entities - 1; i++) {
> struct sdca_entity *entity = &function->entities[i];
> @@ -99,6 +113,7 @@ int sdca_asoc_count_component(struct device *dev, struct sdca_function_data *fun
> case SDCA_ENTITY_TYPE_OT:
> *num_routes += !!entity->iot.clock;
> *num_routes += !!entity->iot.is_dataport;
> + *num_controls += !entity->iot.is_dataport;
shouldn't the same line be added for TYPE_IT?
> break;
> case SDCA_ENTITY_TYPE_PDE:
> *num_routes += entity->pde.num_managed;
> @@ -111,6 +126,11 @@ int sdca_asoc_count_component(struct device *dev, struct sdca_function_data *fun
>
> if (entity->group)
> (*num_routes)++;
> +
> + for (j = 0; j < entity->num_controls; j++) {
> + if (exported_control(&entity->controls[j]))
> + (*num_controls)++;
> + }
> }
>
> return 0;
next prev parent reply other threads:[~2025-05-12 14:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 12:42 [PATCH v5 0/6] Add DAPM/ASoC helpers to create SDCA drivers Charles Keepax
2025-05-12 12:42 ` [PATCH v5 1/6] ASoC: SDCA: Remove regmap module macros Charles Keepax
2025-05-12 12:42 ` [PATCH v5 2/6] ASoC: SDCA: Move allocation of PDE delays array Charles Keepax
2025-05-12 12:42 ` [PATCH v5 3/6] ASoC: dapm: Add component level pin switches Charles Keepax
2025-05-12 12:42 ` [PATCH v5 4/6] ASoC: SDCA: Create DAPM widgets and routes from DisCo Charles Keepax
2025-05-12 13:46 ` Pierre-Louis Bossart
2025-05-12 17:08 ` Charles Keepax
2025-05-14 12:15 ` Pierre-Louis Bossart
2025-05-14 13:30 ` Charles Keepax
2025-05-15 14:50 ` Charles Keepax
2025-05-19 17:53 ` Pierre-Louis Bossart
2025-05-13 9:56 ` Charles Keepax
2025-05-14 12:33 ` Pierre-Louis Bossart
2025-05-14 13:33 ` Charles Keepax
2025-05-12 12:42 ` [PATCH v5 5/6] ASoC: SDCA: Create ALSA controls " Charles Keepax
2025-05-12 13:53 ` Pierre-Louis Bossart [this message]
2025-05-12 17:14 ` Charles Keepax
2025-05-13 10:24 ` Charles Keepax
2025-05-14 12:39 ` Pierre-Louis Bossart
2025-05-14 13:35 ` Charles Keepax
2025-05-14 12:19 ` Pierre-Louis Bossart
2025-05-12 12:42 ` [PATCH v5 6/6] ASoC: SDCA: Create DAI drivers " Charles Keepax
2025-05-12 14:00 ` Pierre-Louis Bossart
2025-05-12 17:16 ` Charles Keepax
2025-05-14 12:38 ` Pierre-Louis Bossart
2025-05-14 13:35 ` Charles Keepax
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=cd574985-e434-46d9-91ff-a2782c6e8eef@linux.dev \
--to=pierre-louis.bossart@linux.dev \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=yung-chuan.liao@linux.intel.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.