Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
	Jaroslav Kysela <perex@perex.cz>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	<linux-sound@vger.kernel.org>, Mark Brown <broonie@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 0/5] ASoC: intel: use component_name for Component name
Date: Tue, 30 Jun 2026 21:51:28 +0200	[thread overview]
Message-ID: <2965d6d5-6cf0-4fba-97a0-7a97861fbbaa@intel.com> (raw)
In-Reply-To: <87se66dyqp.wl-kuninori.morimoto.gx@renesas.com>

On 6/29/2026 1:35 AM, Kuninori Morimoto wrote:

>> Does this mean you have a patchset or two that follow this one up?
>> Looking at this one alone, I'm not seeing why both ->driver_name and
>> ->component_name are added.
>>
>> The driver is supposed to define _behavior_ of the entity it _drives_.
>> Component's name is (typically) a static part of its description, not
>> its runtime behavior.  To keep the design nice and clean shouldn't we
>> leave driver->name and component->name alone?
> 
> It is difficult to clearly define what does "driver" means.
> But basically, I would like to capsuling DAI/Component/Card into each
> soc-dai/component/card.c. Because current ASoC is not capsuled,
> each driver can directly access to each members randomly.

What do you mean by "access each members randomly" ?

> Here, We need to separate the member which set via each driver and
> set via ASoC framework.
> The behavior and its name are set via driver, the others, like lock / link,
> and other necessary members which is needef for controlling ASoC are set
> via ASoC framework.
> 
> About component->name, in current implementation, it is set in
> snd_soc_component_initialize() (X) if default component->name was not set (A).
> But, if we capsuled the Component, people can't access to
> component->xxx because it will be capsuled.
> 
> (X)	int snd_soc_component_initialize(...)
> 	{
> 		...
> (A)		if (!component->name) {
> 			component->name = fmt_single_name(...);
> 			...
> 		}
> 		...
> 	}
> 
> And more, many drivers are basically using snd_soc_register_component()
> to register component. The component is alloced in this function (B).
> So, there is zero chance to set default component name for this
> function user. So this patch-set try to set it via driver.
> 
> 	int snd_soc_register_component(...)
> 	{
> 		...
> (B)		component = devm_kzalloc(...);
> 		if (!component)
> 			return -ENOMEM;
> 
> (X)		ret = snd_soc_component_initialize(...);
> 		...
> 	}
I hope you do not mean to privatize/drop the 
snd_soc_component_initialize() and snd_soc_component_add().  These give 
us a) flexibility and b) dd-alike API (the device-driver API).

It's easier to move between subsystems if their API patterns are 
similar.  At the same time, it's hard to predict "what comes next".  By 
splitting the registration into two steps (with all 3 functions being 
public symbols) the framework is more robust.

Moving on, does this mean we are getting dev_name()/dev_set_name() for 
the component?

	snd_soc_component_name(comp)
	snd_soc_component_set_name(comp, str)

Though the "snd_soc_" prefix we have everywhere in sound/soc/ scales 
poorly with 3+ arguments in the list.  But that's a tale for another 
patchset..


Kind regards,
Czarek

  reply	other threads:[~2026-06-30 19:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26  6:09 [PATCH 0/5] ASoC: intel: use component_name for Component name Kuninori Morimoto
2026-06-26  6:09 ` [PATCH 1/5] ASoC: soc-component: add driver_name Kuninori Morimoto
2026-06-26  6:09 ` [PATCH 2/5] ASoC: soc-component: add component_name Kuninori Morimoto
2026-06-30 13:10   ` Mark Brown
2026-06-30 23:53     ` Kuninori Morimoto
2026-06-26  6:10 ` [PATCH 3/5] ASoC: intel: avs: pcm: use component_name for Component name Kuninori Morimoto
2026-07-01 10:08   ` Cezary Rojewski
2026-07-01 23:13     ` Kuninori Morimoto
2026-06-26  6:10 ` [PATCH 4/5] ASoC: intel: avs: probes: " Kuninori Morimoto
2026-06-26  6:10 ` [PATCH 5/5] ASoC: intel: catpt: pcm: " Kuninori Morimoto
2026-06-26  8:49 ` [PATCH 0/5] ASoC: intel: " Cezary Rojewski
2026-06-28 23:35   ` Kuninori Morimoto
2026-06-30 19:51     ` Cezary Rojewski [this message]
2026-06-30 22:49       ` Kuninori Morimoto
2026-07-01  9:35         ` Cezary Rojewski
2026-07-01 22:51           ` Kuninori Morimoto
2026-07-02  5:41             ` Kuninori Morimoto
2026-07-02 19:16               ` Cezary Rojewski
2026-07-02 23:54                 ` Kuninori Morimoto
2026-07-03  8:16                   ` Cezary Rojewski

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=2965d6d5-6cf0-4fba-97a0-7a97861fbbaa@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox