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: Wed, 1 Jul 2026 11:35:52 +0200 [thread overview]
Message-ID: <dfb5efcd-6c9a-462d-85f7-e8fff3ded624@intel.com> (raw)
In-Reply-To: <87o6grd4ol.wl-kuninori.morimoto.gx@renesas.com>
On 7/1/2026 12:49 AM, Kuninori Morimoto wrote:
>>> 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" ?
>
> We can access each members without restriction, like below.
> Because of this, there was a driver which is using the member a
> way other than intended.
>
> component->aaa = aaa;
> component->bbb = bbb;
> component->ccc = ccc;
I see your point but that's very close to over-defensive programming.
If a developer wants to break their driver/configuration, we can't stop
them anyway, no matter how tight the API is.
Why over-defend?
>>> 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).
>
> Yes, my plan is makes them local function.
>
> We have snd_soc_register_{dai/component/card}(), but only component
> has such style. The biggest reason is regsiter_component() allocs
> component inside, but initialize() assues component already had some
> member (->name, ->debugfs_prefix).
>
> So, if user want to set own driver name, he need to
> - alloc component
> - call initialize()
> - call add()
> This flexibility is simply needed to set the name.
> But, I don't think it is strange that the *component_driver gives its
> name.
>
> And more, if component capsuling has done, you can't directly alloc
> component.
Meaning with this you break a) flexibility b) alignment with dd API.
The flexibility is needed only for the name, _currently_.
It's not _only_ the soc-component which has such style, device-driver
does too.
>> 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)
>
> ?
> You can set name via component_driver->name;
Asking about the getter part too. How, after privatizing component
_and_ component->name, one accesses the component's name? Let's say
from snd_soc_dai_hw_params() context.
next prev parent reply other threads:[~2026-07-01 9:36 UTC|newest]
Thread overview: 21+ 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
2026-06-30 22:49 ` Kuninori Morimoto
2026-07-01 9:35 ` Cezary Rojewski [this message]
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
2026-07-06 0:06 ` Kuninori Morimoto
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=dfb5efcd-6c9a-462d-85f7-e8fff3ded624@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 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.