alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Mark Brown <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	Kevin Hilman <khilman@baylibre.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org
Subject: Re: [alsa-devel] [PATCH 5/9] ASoC: meson: aiu: add hdmi codec control support
Date: Fri, 14 Feb 2020 14:16:10 +0100	[thread overview]
Message-ID: <1j36bdfgx1.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20200213182157.GJ4333@sirena.org.uk>


On Thu 13 Feb 2020 at 19:21, Mark Brown <broonie@kernel.org> wrote:

> On Thu, Feb 13, 2020 at 04:51:55PM +0100, Jerome Brunet wrote:
>
>> +int aiu_add_component(struct device *dev,
>> +		      const struct snd_soc_component_driver *component_driver,
>> +		      struct snd_soc_dai_driver *dai_drv,
>> +		      int num_dai,
>> +		      const char *debugfs_prefix)
>> +{
>> +	struct snd_soc_component *component;
>> +
>> +	component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL);
>> +	if (!component)
>> +		return -ENOMEM;
>> +
>> +#ifdef CONFIG_DEBUG_FS
>> +	component->debugfs_prefix = debugfs_prefix;
>> +#endif
>
> You really shouldn't be doing this as it could conflict with something
> the machine driver wants to do however it's probably not going to be an
> issue in practice as it's not like there's going to be multiple SoCs in
> the card at once and if there were there'd doubltess be other issues.

I'm not sure I understand (and I'd prefer to :) )

As you said before, initially the there was supposed to be a 1:1 mapping
between device and component. The component name is directly derived
from the device name, and the debugfs directory is created from component name.

I would have preferred to use snd_soc_register_component() directly, but
with multiple components from the same device I got:

debugfs: Directory 'c1105400.audio-controller' with parent 'AWESOME-CARD' already present!
debugfs: Directory 'c1105400.audio-controller' with parent 'AWESOME-CARD' already present!

I copied the code above from other direct users of
snd_soc_add_component() (soc-generic-dmaengine-pcm.c and
stm32_adfsdm.c). I suppose they had the same name collision issue.

Instead of addressing the debugfs side effect, maybe  we could just make
sure that each component name is unique within ASoC ? I'd be happy submit
something if you think this can helpful.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2020-02-14 13:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 15:51 [alsa-devel] [PATCH 0/9] ASoC: meson: gx: add audio output support Jerome Brunet
2020-02-13 15:51 ` [alsa-devel] [PATCH 1/9] ASoC: core: allow a dt node to provide several components Jerome Brunet
2020-02-13 17:18   ` Mark Brown
2020-02-13 17:37     ` Jerome Brunet
2020-02-13 17:40       ` Mark Brown
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: core: allow a dt node to provide several components" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 2/9] ASoC: meson: g12a: extract codec-to-codec utils Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: g12a: extract codec-to-codec utils" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 3/9] ASoC: meson: aiu: add audio output dt-bindings Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: aiu: add audio output dt-bindings" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 4/9] ASoC: meson: aiu: add i2s and spdif support Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: aiu: add i2s and spdif support" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 5/9] ASoC: meson: aiu: add hdmi codec control support Jerome Brunet
2020-02-13 18:21   ` Mark Brown
2020-02-14 13:16     ` Jerome Brunet [this message]
2020-02-14 13:22       ` Mark Brown
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: aiu: add hdmi codec control support" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 6/9] ASoC: meson: aiu: add internal dac codec control support Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: aiu: add internal dac codec control support" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 7/9] ASoC: meson: axg: extract sound card utils Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: axg: extract sound card utils" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 8/9] ASoC: meson: gx: add sound card dt-binding documentation Jerome Brunet
2020-02-13 20:58   ` [alsa-devel] Applied "ASoC: meson: gx: add sound card dt-binding documentation" to the asoc tree Mark Brown
2020-02-13 15:51 ` [alsa-devel] [PATCH 9/9] ASoC: meson: gx: add sound card support Jerome Brunet
2020-02-13 20:57   ` [alsa-devel] Applied "ASoC: meson: gx: add sound card support" to the asoc tree Mark Brown

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=1j36bdfgx1.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).