summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/sof_sdw_rt5682.c
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2024-05-09 11:34:16 -0500
committerMark Brown <broonie@kernel.org>2024-05-10 07:11:49 +0100
commit2e3bc94796776e2695054183e7324d1a6ac27837 (patch)
treee0a2373361a1d986277ed454aaee8c88e3646d21 /sound/soc/intel/boards/sof_sdw_rt5682.c
parent70d470f05f0b5bb8dea67915cac6ed6308120a89 (diff)
downloadlinux-2e3bc94796776e2695054183e7324d1a6ac27837.tar.gz
linux-2e3bc94796776e2695054183e7324d1a6ac27837.tar.bz2
linux-2e3bc94796776e2695054183e7324d1a6ac27837.zip
ASoC: Intel: sof_sdw: use .controls/.widgets to add controls/widgets
sof_sdw_rtd_init() will add the controls and widgets if we set them in the codec_info. Move the additions from .rtd_init callback to sof_sdw_rtd_init(). Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20240509163418.67746-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw_rt5682.c')
-rw-r--r--sound/soc/intel/boards/sof_sdw_rt5682.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c
index 9fbe36322a83..1741226fe052 100644
--- a/sound/soc/intel/boards/sof_sdw_rt5682.c
+++ b/sound/soc/intel/boards/sof_sdw_rt5682.c
@@ -17,11 +17,6 @@
#include <sound/jack.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
- SND_SOC_DAPM_HP("Headphone", NULL),
- SND_SOC_DAPM_MIC("Headset Mic", NULL),
-};
-
static const struct snd_soc_dapm_route rt5682_map[] = {
/*Headphones*/
{ "Headphone", NULL, "rt5682 HPOL" },
@@ -29,11 +24,6 @@ static const struct snd_soc_dapm_route rt5682_map[] = {
{ "rt5682 IN1P", NULL, "Headset Mic" },
};
-static const struct snd_kcontrol_new generic_jack_controls[] = {
- SOC_DAPM_PIN_SWITCH("Headphone"),
- SOC_DAPM_PIN_SWITCH("Headset Mic"),
-};
-
static struct snd_soc_jack_pin rt5682_jack_pins[] = {
{
.pin = "Headphone",
@@ -69,20 +59,6 @@ int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, generic_jack_controls,
- ARRAY_SIZE(generic_jack_controls));
- if (ret) {
- dev_err(card->dev, "rt5682 control addition failed: %d\n", ret);
- return ret;
- }
-
- ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
- ARRAY_SIZE(generic_jack_widgets));
- if (ret) {
- dev_err(card->dev, "rt5682 widgets addition failed: %d\n", ret);
- return ret;
- }
-
ret = snd_soc_dapm_add_routes(&card->dapm, rt5682_map,
ARRAY_SIZE(rt5682_map));