Skip to content

Commit 89bac79

Browse files
committed
ASoC: meson: aiu: fix duplicate debugfs directory error
Merge series from Heiner Kallweit <hkallweit1@gmail.com>: On a S905W-based system I get the following error: debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present! Turned out that multiple components having the same name triggers this error in soc_init_component_debugfs(). The proposed solution allows other drivers to adopt the same approach with minimal effort. With the patch the error is gone and that's the debugfs entries. /sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller
2 parents e927b05 + fc35880 commit 89bac79

5 files changed

Lines changed: 18 additions & 0 deletions

File tree

include/sound/soc-component.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ struct snd_soc_component_driver {
179179
struct snd_pcm_hw_params *params);
180180
bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */
181181
int be_pcm_base; /* base device ID for all BE PCMs */
182+
183+
#ifdef CONFIG_DEBUG_FS
184+
const char *debugfs_prefix;
185+
#endif
182186
};
183187

184188
struct snd_soc_component {

sound/soc/meson/aiu-acodec-ctrl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ static const struct snd_soc_component_driver aiu_acodec_ctrl_component = {
193193
.of_xlate_dai_name = aiu_acodec_of_xlate_dai_name,
194194
.endianness = 1,
195195
.non_legacy_dai_naming = 1,
196+
#ifdef CONFIG_DEBUG_FS
197+
.debugfs_prefix = "acodec",
198+
#endif
196199
};
197200

198201
int aiu_acodec_ctrl_register_component(struct device *dev)

sound/soc/meson/aiu-codec-ctrl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ static const struct snd_soc_component_driver aiu_hdmi_ctrl_component = {
140140
.of_xlate_dai_name = aiu_hdmi_of_xlate_dai_name,
141141
.endianness = 1,
142142
.non_legacy_dai_naming = 1,
143+
#ifdef CONFIG_DEBUG_FS
144+
.debugfs_prefix = "hdmi",
145+
#endif
143146
};
144147

145148
int aiu_hdmi_ctrl_register_component(struct device *dev)

sound/soc/meson/aiu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ static const struct snd_soc_component_driver aiu_cpu_component = {
103103
.pointer = aiu_fifo_pointer,
104104
.probe = aiu_cpu_component_probe,
105105
.remove = aiu_cpu_component_remove,
106+
#ifdef CONFIG_DEBUG_FS
107+
.debugfs_prefix = "cpu",
108+
#endif
106109
};
107110

108111
static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {

sound/soc/soc-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,6 +2587,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
25872587
component->dev = dev;
25882588
component->driver = driver;
25892589

2590+
#ifdef CONFIG_DEBUG_FS
2591+
if (!component->debugfs_prefix)
2592+
component->debugfs_prefix = driver->debugfs_prefix;
2593+
#endif
2594+
25902595
return 0;
25912596
}
25922597
EXPORT_SYMBOL_GPL(snd_soc_component_initialize);

0 commit comments

Comments
 (0)