ASoC: mediatek: mt8173-afe-pcm: set debugfs_prefix via Component driver

We can set component->debugfs_prefix via component_driver->debugfs_prefix.
Use it.

Now it no longer need to use snd_soc_component_initialize() /
snd_soc_component_add(). use snd_soc_component_register() instead.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ecipk5vo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2026-06-02 02:55:56 +00:00 committed by Mark Brown
parent d7c18d15c6
commit 0cac8e3513
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -676,6 +676,7 @@ static const struct snd_soc_component_driver mt8173_afe_pcm_dai_component = {
.num_dapm_routes = ARRAY_SIZE(mt8173_afe_pcm_routes),
.suspend = mtk_afe_suspend,
.resume = mtk_afe_resume,
.debugfs_prefix = "pcm",
};
static const struct snd_soc_component_driver mt8173_afe_hdmi_dai_component = {
@ -684,6 +685,7 @@ static const struct snd_soc_component_driver mt8173_afe_hdmi_dai_component = {
.num_dapm_routes = ARRAY_SIZE(mt8173_afe_hdmi_routes),
.suspend = mtk_afe_suspend,
.resume = mtk_afe_resume,
.debugfs_prefix = "hdmi",
};
static const char *aud_clks[MT8173_CLK_NUM] = {
@ -1053,7 +1055,6 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
int irq_id;
struct mtk_base_afe *afe;
struct mt8173_afe_private *afe_priv;
struct snd_soc_component *comp_pcm, *comp_hdmi;
struct device *dev = &pdev->dev;
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(33));
@ -1141,45 +1142,13 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
if (ret)
goto err_pm_disable;
comp_pcm = devm_kzalloc(dev, sizeof(*comp_pcm), GFP_KERNEL);
if (!comp_pcm) {
ret = -ENOMEM;
goto err_pm_disable;
}
ret = snd_soc_component_initialize(comp_pcm,
&mt8173_afe_pcm_dai_component,
dev);
if (ret)
goto err_pm_disable;
#ifdef CONFIG_DEBUG_FS
comp_pcm->debugfs_prefix = "pcm";
#endif
ret = snd_soc_add_component(comp_pcm,
ret = snd_soc_register_component(dev, &mt8173_afe_pcm_dai_component,
mt8173_afe_pcm_dais,
ARRAY_SIZE(mt8173_afe_pcm_dais));
if (ret)
goto err_pm_disable;
comp_hdmi = devm_kzalloc(dev, sizeof(*comp_hdmi), GFP_KERNEL);
if (!comp_hdmi) {
ret = -ENOMEM;
goto err_cleanup_components;
}
ret = snd_soc_component_initialize(comp_hdmi,
&mt8173_afe_hdmi_dai_component,
dev);
if (ret)
goto err_cleanup_components;
#ifdef CONFIG_DEBUG_FS
comp_hdmi->debugfs_prefix = "hdmi";
#endif
ret = snd_soc_add_component(comp_hdmi,
ret = snd_soc_register_component(dev, &mt8173_afe_hdmi_dai_component,
mt8173_afe_hdmi_dais,
ARRAY_SIZE(mt8173_afe_hdmi_dais));
if (ret)