Commit d462f6ed authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Mark Brown

ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver

Allow the component debugfs_prefix to be set from
snd_soc_component_driver. First use case is avoiding a duplicate
debugfs entry error in case a device has multiple components
which have the same name therefore.

Note that we don't set component->debugfs_prefix if it's set already.
That's needed because partially component->debugfs_prefix is set
before calling snd_soc_component_initialize().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/d18bff6a-1df1-5f95-0cf8-10dbaa62d7be@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0b3d5d2e
...@@ -179,6 +179,10 @@ struct snd_soc_component_driver { ...@@ -179,6 +179,10 @@ struct snd_soc_component_driver {
struct snd_pcm_hw_params *params); struct snd_pcm_hw_params *params);
bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */ 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 */ int be_pcm_base; /* base device ID for all BE PCMs */
#ifdef CONFIG_DEBUG_FS
const char *debugfs_prefix;
#endif
}; };
struct snd_soc_component { struct snd_soc_component {
......
...@@ -2587,6 +2587,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component, ...@@ -2587,6 +2587,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
component->dev = dev; component->dev = dev;
component->driver = driver; component->driver = driver;
#ifdef CONFIG_DEBUG_FS
if (!component->debugfs_prefix)
component->debugfs_prefix = driver->debugfs_prefix;
#endif
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_component_initialize); EXPORT_SYMBOL_GPL(snd_soc_component_initialize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment