diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2024-04-16 09:14:04 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-04-16 20:00:03 +0900 |
commit | 1d2a6b3b5189b6c3e51f29e050aa9b2337b774e8 (patch) | |
tree | ef9c5a3541303d1f2c57799ce9c5fdb4648853de /sound/soc/mediatek/mt8195 | |
parent | 9d9b182876a249b393158e9f43c255aeee4ef898 (diff) | |
download | linux-stable-1d2a6b3b5189b6c3e51f29e050aa9b2337b774e8.tar.gz linux-stable-1d2a6b3b5189b6c3e51f29e050aa9b2337b774e8.tar.bz2 linux-stable-1d2a6b3b5189b6c3e51f29e050aa9b2337b774e8.zip |
ASoC: mediatek: Use common mtk_afe_pcm_platform with common probe cb
Since the mtk-afe-platform-driver generic mtk_afe_pcm_platform now has
a common .probe() callback, there is no reason to keep duplicating this
function over and over in the SoC specific AFE-PCM drivers: switch over
to register with the common bits instead.
Note that MT8186 was left out of this because it is registering some
extra sinegen controls in the AFE-PCM probe callback and needs extra
cleanups to be able to use the common bits.
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240416071410.75620-13-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek/mt8195')
-rw-r--r-- | sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c index 620d7ade1992..64af9bf363fd 100644 --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c @@ -2944,25 +2944,6 @@ skip_regmap: return 0; } -static int mt8195_afe_component_probe(struct snd_soc_component *component) -{ - struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); - int ret = 0; - - snd_soc_component_init_regmap(component, afe->regmap); - - ret = mtk_afe_add_sub_dai_control(component); - - return ret; -} - -static const struct snd_soc_component_driver mt8195_afe_component = { - .name = AFE_PCM_NAME, - .pointer = mtk_afe_pcm_pointer, - .pcm_construct = mtk_afe_pcm_new, - .probe = mt8195_afe_component_probe, -}; - static int init_memif_priv_data(struct mtk_base_afe *afe) { struct mt8195_afe_private *afe_priv = afe->platform_priv; @@ -3164,7 +3145,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) } /* register component */ - ret = devm_snd_soc_register_component(dev, &mt8195_afe_component, + ret = devm_snd_soc_register_component(dev, &mtk_afe_pcm_platform, afe->dai_drivers, afe->num_dai_drivers); if (ret) { dev_warn(dev, "err_platform\n"); |