Unverified Commit 89bac792 authored by Mark Brown's avatar Mark Brown
Browse files

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
parents e927b05f fc35880d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -179,6 +179,10 @@ struct snd_soc_component_driver {
				  struct snd_pcm_hw_params *params);
	bool use_dai_pcm_id;	/* use DAI link PCM ID as PCM device number */
	int be_pcm_base;	/* base device ID for all BE PCMs */

#ifdef CONFIG_DEBUG_FS
	const char *debugfs_prefix;
#endif
};

struct snd_soc_component {
+3 −0
Original line number Diff line number Diff line
@@ -193,6 +193,9 @@ static const struct snd_soc_component_driver aiu_acodec_ctrl_component = {
	.of_xlate_dai_name	= aiu_acodec_of_xlate_dai_name,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
#ifdef CONFIG_DEBUG_FS
	.debugfs_prefix		= "acodec",
#endif
};

int aiu_acodec_ctrl_register_component(struct device *dev)
+3 −0
Original line number Diff line number Diff line
@@ -140,6 +140,9 @@ static const struct snd_soc_component_driver aiu_hdmi_ctrl_component = {
	.of_xlate_dai_name	= aiu_hdmi_of_xlate_dai_name,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
#ifdef CONFIG_DEBUG_FS
	.debugfs_prefix		= "hdmi",
#endif
};

int aiu_hdmi_ctrl_register_component(struct device *dev)
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ static const struct snd_soc_component_driver aiu_cpu_component = {
	.pointer		= aiu_fifo_pointer,
	.probe			= aiu_cpu_component_probe,
	.remove			= aiu_cpu_component_remove,
#ifdef CONFIG_DEBUG_FS
	.debugfs_prefix		= "cpu",
#endif
};

static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {
+5 −0
Original line number Diff line number Diff line
@@ -2587,6 +2587,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
	component->dev		= dev;
	component->driver	= driver;

#ifdef CONFIG_DEBUG_FS
	if (!component->debugfs_prefix)
		component->debugfs_prefix = driver->debugfs_prefix;
#endif

	return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_component_initialize);