From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Maciej Strozek <mstrozek@opensource.cirrus.com>,
Takashi Iwai <tiwai@suse.com>,
Faiz Nabi Kuchay <fkuchay@oss.qualcomm.com>,
Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>,
patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 05/11] ASoC: SDCA: add populate_function hw_op for DT function data
Date: Mon, 7 Sep 2026 13:28:42 +0200 [thread overview]
Message-ID: <8403dfc5-858f-4212-ad13-7c00b3f7ee63@linux.dev> (raw)
In-Reply-To: <20260907083727.733705-6-srinivas.kandagatla@oss.qualcomm.com>
On 9/7/26 10:37, Srinivas Kandagatla wrote:
> sdca_parse_function() walks a firmware node, but on DT there is no
> DisCo node -- sdca_lookup_functions() is a no-op and the SDCA
> function descriptors come with a NULL fwnode.
It'd be good to have a link to an example set of DT properties for SDCA.
The way the functions were organized in ACPI is based on a DT-inspired
_DSD mechanism to have nested blocks.
edit: After reaching the last patch I realized there are no such
properties. The main problem is how to deal with board-specific
initialization data, the suggestion to encode all the tables in C seems
limited to me.
> Add a populate_function hw_op that the class function driver falls
> back to when @function->desc->node is NULL: it fills the caller-owned
> sdca_function_data (entities, clusters, init_table, delays) from the
> codec's static tables, matching by function type. Leave
> @function->desc alone -- the framework owns the per-instance
> descriptor, so devices with more than one function of the same type
> keep their per-instance SoundWire address.
I wasn't able to understand that last sentence - and I don't remember
seeing a case with different functions of the same type. It's permitted
by the spec but it'd be fun to manage...
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> ---
> include/sound/sdca_class.h | 6 ++++++
> sound/soc/sdca/sdca_class_function.c | 9 ++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/include/sound/sdca_class.h b/include/sound/sdca_class.h
> index 3342937d09fd..3a1b6d65048f 100644
> --- a/include/sound/sdca_class.h
> +++ b/include/sound/sdca_class.h
> @@ -26,9 +26,15 @@ struct sdca_function_data;
> * before the class regmap is created and before the slave is
> * ATTACHED; callers needing bus I/O must sdw_slave_wait_for_init()
> * first.
> + * @populate_function: fill @function (entities, clusters, init_table, ...)
> + * from static tables in place of sdca_parse_function() on
> + * DT/non-DisCo platforms. Must leave @function->desc alone.
> + * Return 0 on success or a negative errno. May be NULL.
> */
> struct sdca_class_hw_ops {
> int (*hw_init)(struct sdw_slave *slave);
> + int (*populate_function)(struct sdw_slave *slave,
> + struct sdca_function_data *function);
> };
Erm, this populate_function() callback would not generate any hardware
access, would it? It's really different to hw_init which is supposed to
configure the codec and must run after enumeration.
I am struggling a bit with the 'hw_ops', it's really only a matter of
reading tables from platform firmware, and this could be done without
any dependency on hardware, couldn't it?
>
> struct sdca_class_drv {
> diff --git a/sound/soc/sdca/sdca_class_function.c b/sound/soc/sdca/sdca_class_function.c
> index 10a2b031b572..8bca88865a4d 100644
> --- a/sound/soc/sdca/sdca_class_function.c
> +++ b/sound/soc/sdca/sdca_class_function.c
> @@ -329,7 +329,14 @@ static int class_function_probe(struct auxiliary_device *auxdev,
> drv->core = core;
> drv->function = &sdev->function;
>
> - ret = sdca_parse_function(dev, drv->function);
> + if (drv->function->desc->node) {
> + ret = sdca_parse_function(dev, drv->function);
> + } else if (core->hw_ops && core->hw_ops->populate_function) {
> + ret = core->hw_ops->populate_function(core->sdw, drv->function);
> + } else {
> + dev_err(dev, "no firmware node and no populate_function hook\n");
> + return -ENOENT;
> + }
> if (ret)
> return ret;
>
next prev parent reply other threads:[~2026-09-07 11:32 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 8:37 [PATCH v2 00/11] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 01/11] ASoC: SDCA: allow building without ACPI Srinivas Kandagatla
2026-09-07 8:54 ` Richard Fitzgerald
2026-09-07 9:09 ` Takashi Iwai
2026-09-07 8:37 ` [PATCH v2 02/11] ASoC: SDCA: export PM helpers keyed on sdca_class_drv Srinivas Kandagatla
2026-09-07 8:50 ` sashiko-bot
2026-09-07 9:43 ` Srinivas Kandagatla
2026-09-08 16:22 ` Charles Keepax
2026-09-08 17:49 ` Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 03/11] ASoC: SDCA: expose class SoundWire probe/remove/read_prop as library Srinivas Kandagatla
2026-09-07 8:51 ` sashiko-bot
2026-09-07 11:31 ` Pierre-Louis Bossart
2026-09-07 13:29 ` Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 04/11] ASoC: SDCA: add hw_ops with hw_init hook Srinivas Kandagatla
2026-09-07 11:29 ` Pierre-Louis Bossart
2026-09-07 13:33 ` Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 05/11] ASoC: SDCA: add populate_function hw_op for DT function data Srinivas Kandagatla
2026-09-07 11:28 ` Pierre-Louis Bossart [this message]
2026-09-07 13:16 ` Charles Keepax
2026-09-08 16:25 ` Charles Keepax
2026-09-08 18:00 ` Srinivas Kandagatla
2026-09-09 8:34 ` Charles Keepax
2026-09-07 8:37 ` [PATCH v2 06/11] ASoC: SDCA: class_function: xlate sound-dai cell by entity index Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 07/11] ASoC: SDCA: register SDCA_FUNCTION_TYPE_SIMPLE_JACK in class function driver Srinivas Kandagatla
2026-09-07 11:32 ` Pierre-Louis Bossart
2026-09-07 8:37 ` [PATCH v2 08/11] ASoC: SDCA: make find_sdca_control_reset() return void Srinivas Kandagatla
2026-09-07 11:32 ` Pierre-Louis Bossart
2026-09-07 13:03 ` Charles Keepax
2026-09-07 13:16 ` Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 09/11] ASoC: SDCA: add sdca_apply_default_control_classifiers() helper Srinivas Kandagatla
2026-09-07 8:37 ` [PATCH v2 10/11] dt-bindings: sound: qcom: add Tambora WCD9378 SDCA codec Srinivas Kandagatla
2026-09-07 8:56 ` sashiko-bot
2026-09-07 8:37 ` [PATCH v2 11/11] ASoC: codecs: add Qualcomm Tambora (WCD9378) " Srinivas Kandagatla
2026-09-07 9:01 ` sashiko-bot
2026-09-07 11:32 ` Pierre-Louis Bossart
2026-09-07 13:03 ` Srinivas Kandagatla
2026-09-07 19:47 ` Pierre-Louis Bossart
2026-09-07 21:26 ` Mark Brown
2026-09-07 22:37 ` Srinivas Kandagatla
2026-09-08 8:49 ` Charles Keepax
2026-09-08 9:09 ` Srinivas Kandagatla
2026-09-08 10:37 ` Richard Fitzgerald
2026-09-08 12:31 ` Srinivas Kandagatla
2026-09-08 13:20 ` Charles Keepax
2026-09-08 13:34 ` Srinivas Kandagatla
2026-09-08 14:22 ` Pierre-Louis Bossart
2026-09-08 15:33 ` Charles Keepax
2026-09-08 15:34 ` Srinivas Kandagatla
2026-09-08 15:58 ` Uwe Kleine-König
2026-09-08 16:20 ` 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=8403dfc5-858f-4212-ad13-7c00b3f7ee63@linux.dev \
--to=pierre-louis.bossart@linux.dev \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fkuchay@oss.qualcomm.com \
--cc=jorijnvdgraaf@catcrafts.net \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mstrozek@opensource.cirrus.com \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@oss.qualcomm.com \
--cc=tiwai@suse.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.