@@ -17,7 +17,7 @@
#include <sound/jack.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget cs42l42_widgets[] = {
+static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
};
@@ -30,7 +30,7 @@ static const struct snd_soc_dapm_route cs42l42_map[] = {
{"cs42l42 HS", NULL, "Headset Mic"},
};
-static const struct snd_kcontrol_new cs42l42_controls[] = {
+static const struct snd_kcontrol_new generic_jack_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
};
@@ -70,15 +70,15 @@ int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, cs42l42_controls,
- ARRAY_SIZE(cs42l42_controls));
+ ret = snd_soc_add_card_controls(card, generic_jack_controls,
+ ARRAY_SIZE(generic_jack_controls));
if (ret) {
dev_err(card->dev, "cs42l42 control addition failed: %d\n", ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, cs42l42_widgets,
- ARRAY_SIZE(cs42l42_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
+ ARRAY_SIZE(generic_jack_widgets));
if (ret) {
dev_err(card->dev, "cs42l42 widgets addition failed: %d\n", ret);
return ret;
@@ -18,7 +18,7 @@
#include <sound/soc-dapm.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget cs42l43_hs_widgets[] = {
+static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
};
@@ -30,7 +30,7 @@ static const struct snd_soc_dapm_route cs42l43_hs_map[] = {
{ "cs42l43 ADC1_IN1_N", NULL, "Headset Mic" },
};
-static const struct snd_soc_dapm_widget cs42l43_spk_widgets[] = {
+static const struct snd_soc_dapm_widget generic_spk_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
};
@@ -41,7 +41,7 @@ static const struct snd_soc_dapm_route cs42l43_spk_map[] = {
{ "Speaker", NULL, "cs42l43 AMP2_OUT_N", },
};
-static const struct snd_soc_dapm_widget cs42l43_dmic_widgets[] = {
+static const struct snd_soc_dapm_widget generic_dmic_widgets[] = {
SND_SOC_DAPM_MIC("DMIC", NULL),
};
@@ -74,8 +74,8 @@ int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_dapm_new_controls(&card->dapm, cs42l43_hs_widgets,
- ARRAY_SIZE(cs42l43_hs_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
+ ARRAY_SIZE(generic_jack_widgets));
if (ret) {
dev_err(card->dev, "cs42l43 hs widgets addition failed: %d\n", ret);
return ret;
@@ -133,8 +133,8 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
return -ENOMEM;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, cs42l43_spk_widgets,
- ARRAY_SIZE(cs42l43_spk_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_spk_widgets,
+ ARRAY_SIZE(generic_spk_widgets));
if (ret) {
dev_err(card->dev, "cs42l43 speaker widgets addition failed: %d\n", ret);
return ret;
@@ -172,8 +172,8 @@ int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_dapm_new_controls(&card->dapm, cs42l43_dmic_widgets,
- ARRAY_SIZE(cs42l43_dmic_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_dmic_widgets,
+ ARRAY_SIZE(generic_dmic_widgets));
if (ret) {
dev_err(card->dev, "cs42l43 dmic widgets addition failed: %d\n", ret);
return ret;
@@ -14,7 +14,7 @@
#define CODEC_NAME_SIZE 8
-static const struct snd_soc_dapm_widget sof_widgets[] = {
+static const struct snd_soc_dapm_widget generic_spk_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
};
@@ -35,8 +35,8 @@ int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_dapm_new_controls(&card->dapm, sof_widgets,
- ARRAY_SIZE(sof_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_spk_widgets,
+ ARRAY_SIZE(generic_spk_widgets));
if (ret) {
dev_err(card->dev, "widgets addition failed: %d\n", ret);
return ret;
@@ -17,7 +17,7 @@
#include <sound/jack.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget rt5682_widgets[] = {
+static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
};
@@ -29,7 +29,7 @@ static const struct snd_soc_dapm_route rt5682_map[] = {
{ "rt5682 IN1P", NULL, "Headset Mic" },
};
-static const struct snd_kcontrol_new rt5682_controls[] = {
+static const struct snd_kcontrol_new generic_jack_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
};
@@ -69,15 +69,15 @@ int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, rt5682_controls,
- ARRAY_SIZE(rt5682_controls));
+ 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, rt5682_widgets,
- ARRAY_SIZE(rt5682_widgets));
+ 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;
@@ -42,7 +42,7 @@ static int rt711_add_codec_device_props(struct device *sdw_dev)
return ret;
}
-static const struct snd_soc_dapm_widget rt711_widgets[] = {
+static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
};
@@ -53,7 +53,7 @@ static const struct snd_soc_dapm_route rt711_map[] = {
{ "rt711 MIC2", NULL, "Headset Mic" },
};
-static const struct snd_kcontrol_new rt711_controls[] = {
+static const struct snd_kcontrol_new generic_jack_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
};
@@ -93,15 +93,15 @@ int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, rt711_controls,
- ARRAY_SIZE(rt711_controls));
+ ret = snd_soc_add_card_controls(card, generic_jack_controls,
+ ARRAY_SIZE(generic_jack_controls));
if (ret) {
dev_err(card->dev, "rt711 controls addition failed: %d\n", ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, rt711_widgets,
- ARRAY_SIZE(rt711_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
+ ARRAY_SIZE(generic_jack_widgets));
if (ret) {
dev_err(card->dev, "rt711 widgets addition failed: %d\n", ret);
return ret;
@@ -15,7 +15,7 @@
#include <sound/soc-dapm.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget rt712_spk_widgets[] = {
+static const struct snd_soc_dapm_widget generic_spk_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
};
@@ -30,7 +30,7 @@ static const struct snd_soc_dapm_route rt712_spk_map[] = {
{ "Speaker", NULL, "rt712 SPOR" },
};
-static const struct snd_kcontrol_new rt712_spk_controls[] = {
+static const struct snd_kcontrol_new generic_spk_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
};
@@ -45,15 +45,15 @@ int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, rt712_spk_controls,
- ARRAY_SIZE(rt712_spk_controls));
+ ret = snd_soc_add_card_controls(card, generic_spk_controls,
+ ARRAY_SIZE(generic_spk_controls));
if (ret) {
dev_err(card->dev, "rt712 spk controls addition failed: %d\n", ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, rt712_spk_widgets,
- ARRAY_SIZE(rt712_spk_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_spk_widgets,
+ ARRAY_SIZE(generic_spk_widgets));
if (ret) {
dev_err(card->dev, "rt712 spk widgets addition failed: %d\n", ret);
return ret;
@@ -15,7 +15,7 @@
#include <sound/soc-dapm.h>
#include "sof_sdw_common.h"
-static const struct snd_soc_dapm_widget rt722_spk_widgets[] = {
+static const struct snd_soc_dapm_widget generic_spk_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
};
@@ -23,7 +23,7 @@ static const struct snd_soc_dapm_route rt722_spk_map[] = {
{ "Speaker", NULL, "rt722 SPK" },
};
-static const struct snd_kcontrol_new rt722_spk_controls[] = {
+static const struct snd_kcontrol_new generic_spk_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
};
@@ -38,15 +38,15 @@ int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, rt722_spk_controls,
- ARRAY_SIZE(rt722_spk_controls));
+ ret = snd_soc_add_card_controls(card, generic_spk_controls,
+ ARRAY_SIZE(generic_spk_controls));
if (ret) {
dev_err(card->dev, "failed to add rt722 spk controls: %d\n", ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, rt722_spk_widgets,
- ARRAY_SIZE(rt722_spk_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_spk_widgets,
+ ARRAY_SIZE(generic_spk_widgets));
if (ret) {
dev_err(card->dev, "failed to add rt722 spk widgets: %d\n", ret);
return ret;
@@ -131,14 +131,14 @@ static int rt_amp_add_device_props(struct device *sdw_dev)
return ret;
}
-static const struct snd_kcontrol_new rt_amp_controls[] = {
- SOC_DAPM_PIN_SWITCH("Speaker"),
-};
-
-static const struct snd_soc_dapm_widget rt_amp_widgets[] = {
+static const struct snd_soc_dapm_widget generic_spk_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
};
+static const struct snd_kcontrol_new generic_spk_controls[] = {
+ SOC_DAPM_PIN_SWITCH("Speaker"),
+};
+
/*
* dapm routes for rt1308/rt1316/rt1318 will be registered dynamically
* according to the number of rt1308/rt1316/rt1318 used. The first two
@@ -202,15 +202,15 @@ int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
if (!card->components)
return -ENOMEM;
- ret = snd_soc_add_card_controls(card, rt_amp_controls,
- ARRAY_SIZE(rt_amp_controls));
+ ret = snd_soc_add_card_controls(card, generic_spk_controls,
+ ARRAY_SIZE(generic_spk_controls));
if (ret) {
dev_err(card->dev, "%s controls addition failed: %d\n", codec_name, ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, rt_amp_widgets,
- ARRAY_SIZE(rt_amp_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_spk_widgets,
+ ARRAY_SIZE(generic_spk_widgets));
if (ret) {
dev_err(card->dev, "%s widgets addition failed: %d\n", codec_name, ret);
return ret;
@@ -43,7 +43,7 @@ static int rt_sdca_jack_add_codec_device_props(struct device *sdw_dev)
return ret;
}
-static const struct snd_soc_dapm_widget rt_sdca_jack_widgets[] = {
+static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
};
@@ -68,7 +68,7 @@ static const struct snd_soc_dapm_route rt722_sdca_map[] = {
{ "rt722 MIC2", NULL, "Headset Mic" },
};
-static const struct snd_kcontrol_new rt_sdca_jack_controls[] = {
+static const struct snd_kcontrol_new generic_jack_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
};
@@ -129,15 +129,15 @@ int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)
}
}
- ret = snd_soc_add_card_controls(card, rt_sdca_jack_controls,
- ARRAY_SIZE(rt_sdca_jack_controls));
+ ret = snd_soc_add_card_controls(card, generic_jack_controls,
+ ARRAY_SIZE(generic_jack_controls));
if (ret) {
dev_err(card->dev, "rt sdca jack controls addition failed: %d\n", ret);
return ret;
}
- ret = snd_soc_dapm_new_controls(&card->dapm, rt_sdca_jack_widgets,
- ARRAY_SIZE(rt_sdca_jack_widgets));
+ ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
+ ARRAY_SIZE(generic_jack_widgets));
if (ret) {
dev_err(card->dev, "rt sdca jack widgets addition failed: %d\n", ret);
return ret;