From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"Bard Liao" <yung-chuan.liao@linux.intel.com>,
Jaroslav Kysela <perex@perex.cz>,
"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
Kiseok Jo <kiseok.jo@irondevice.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
"Peter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Takashi Iwai <tiwai@suse.com>,
"Vijendar Mukunda" <Vijendar.Mukunda@amd.com>,
Benjamin Bara <benjamin.bara@skidata.com>,
<linux-sound@vger.kernel.org>
Subject: Re: [PATCH 1/7] ASoC: soc-component: use dapm->component instead of container_of()
Date: Thu, 17 Apr 2025 11:34:35 +0200 [thread overview]
Message-ID: <a7ab2e02-a864-4243-add2-c16b54aa7435@intel.com> (raw)
In-Reply-To: <87jz7nlcvf.wl-kuninori.morimoto.gx@renesas.com>
On 2025-04-14 4:01 AM, Kuninori Morimoto wrote:
>
> Hi Cezary, Mark
>
>> dapm->card
>> dapm->component
>> dapm->dev
>> dapm->bias_level
>> dapm->idle_bias_off
> (snip)
>> snd_soc_dapm_new_controls()
>> snd_soc_dapm_add_routes()
>> snd_soc_dapm_disable_pin_unlocked()
>> snd_soc_dapm_sync_unlocked()
>> snd_soc_dapm_mutex_lock()
>> ...
> (snip)
>> To hide dapm_context details from user driver
>> - define struct dapm_context name only in include/sound.
>> - define struct dapm_context details in soc_dapm.c
>>
>> To use dapm_context related feature in user driver
>> - use snd_soc_dapm_xxx() function in all user driver
>
> We have 2 way to get dapm_context (card vs component).
> So if soc-dapm has function for these, we can remove dapm_context from
> header (Not 100% sure for now, but maybe).
> It will be big patch-set. I'm OK to create it. But what do you think ?
>
> --- soc-dapm.c -------
>
> static __snd_soc_dapm_xxx(dapm_context, ...)
> {
> ...
> }
>
> int snd_soc_dapm_xxx_for_card(card, xxx) {
> __snd_soc_dapm_xxx(card->dapm, ...);
> }
>
> int snd_soc_dapm_xxx_for_component(component, xxx) {
> __snd_soc_dapm_xxx(component->dapm, ...);
> }
>
> --- soc-dapm.h -------
>
> #define snd_soc_dapm_xxx(x) _Generic((x, ...), \
> struct snd_soc_card * : snd_soc_dapm_xxx_for_card, \
> struct snd_soc_component * : snd_soc_dapm_xxx_for_component)(x, ...)
>
Sorry for the delay in response, Kuninori.
Now, personally I'm up even for big patchsets i.e.: it's 'just' a
_proposal_, nothing is merged by default and every good engineering
discussion I see as absolute win.
Reducing the need for users (sound drivers) to manipulate dapm_context
is a good thing. I'll tell more once I see the actual proposal. The
pseudo-code shown above, provided is used by soc-core.c alone, looks good.
Kind regards,
Czarek
next prev parent reply other threads:[~2025-04-17 9:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 2:56 [PATCH 0/7] ASoC: use snd_soc_dapm_to_component() Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 1/7] ASoC: soc-component: use dapm->component instead of container_of() Kuninori Morimoto
2025-04-09 7:59 ` Cezary Rojewski
2025-04-10 0:19 ` Kuninori Morimoto
2025-04-11 2:04 ` Kuninori Morimoto
2025-04-11 9:07 ` Cezary Rojewski
2025-04-13 23:39 ` Kuninori Morimoto
2025-04-14 2:01 ` Kuninori Morimoto
2025-04-17 9:34 ` Cezary Rojewski [this message]
2025-04-17 23:00 ` Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 2/7] ASoC: amd: use snd_soc_dapm_to_component() Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 3/7] ASoC: sma1307: " Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 4/7] ASoC: intel: " Kuninori Morimoto
2025-04-09 8:03 ` Cezary Rojewski
2025-04-10 0:20 ` Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 5/7] ASoC: mediatek: " Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 6/7] ASoC: soc-dapm: " Kuninori Morimoto
2025-04-09 2:57 ` [PATCH 7/7] ASoC: soc-topology: " 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=a7ab2e02-a864-4243-add2-c16b54aa7435@intel.com \
--to=cezary.rojewski@intel.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.bara@skidata.com \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=kiseok.jo@irondevice.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=ranjani.sridharan@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox