Pārlūkot izejas kodu

asoc: codecs: Change WSA SPKRRECV control to bool

Update from SOC_ENUM to SOC_SINGLE to match rest of driver
implementation. Also remove remaining dev_mode enum references
in wsa884x driver.

Change-Id: I2a477c4fa8c29373ffa1e8e2eb599a0f1c61653d
Signed-off-by: Matthew Rice <[email protected]>
Matthew Rice 2 gadi atpakaļ
vecāks
revīzija
c117389d88

+ 4 - 9
asoc/codecs/lpass-cdc/lpass-cdc-wsa-macro.c

@@ -341,10 +341,6 @@ static const char * const lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_text[] = {
 	"OFF", "ON"
 };
 
-static const char *const lpass_cdc_wsa_macro_ear_spkrrecv_text[] = {
-	"OFF", "ON"
-};
-
 static const char * const lpass_cdc_wsa_macro_comp_mode_text[] = {
 	"G_21_DB", "G_19P5_DB", "G_18_DB", "G_16P5_DB", "G_15_DB",
 	"G_13P5_DB", "G_12_DB", "G_10P5_DB", "G_9_DB"
@@ -358,8 +354,7 @@ static const struct snd_kcontrol_new wsa_int1_vbat_mix_switch[] = {
 	SOC_DAPM_SINGLE("WSA RX1 VBAT Enable", SND_SOC_NOPM, 0, 1, 0)
 };
 
-static SOC_ENUM_SINGLE_EXT_DECL(lpass_cdc_wsa_macro_ear_spkrrecv_enum,
-				lpass_cdc_wsa_macro_ear_spkrrecv_text);
+
 static SOC_ENUM_SINGLE_EXT_DECL(lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_enum,
 			lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_text);
 static SOC_ENUM_SINGLE_EXT_DECL(lpass_cdc_wsa_macro_comp_mode_enum,
@@ -2558,9 +2553,6 @@ static int lpass_cdc_wsa_macro_pbr_enable_put(struct snd_kcontrol *kcontrol,
 
 
 static const struct snd_kcontrol_new lpass_cdc_wsa_macro_snd_controls[] = {
-	SOC_ENUM_EXT("WSA SPKRRECV", lpass_cdc_wsa_macro_ear_spkrrecv_enum,
-			lpass_cdc_wsa_macro_ear_spkrrecv_get,
-			lpass_cdc_wsa_macro_ear_spkrrecv_put),
 	SOC_ENUM_EXT("GSM mode Enable", lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_enum,
 		     lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_func_get,
 		     lpass_cdc_wsa_macro_vbat_bcl_gsm_mode_func_put),
@@ -2570,6 +2562,9 @@ static const struct snd_kcontrol_new lpass_cdc_wsa_macro_snd_controls[] = {
 	SOC_ENUM_EXT("WSA_RX1 comp_mode", lpass_cdc_wsa_macro_comp_mode_enum,
 		     lpass_cdc_wsa_macro_comp_mode_get,
 		     lpass_cdc_wsa_macro_comp_mode_put),
+	SOC_SINGLE_EXT("WSA SPKRRECV", SND_SOC_NOPM, 0, 1, 0,
+			lpass_cdc_wsa_macro_ear_spkrrecv_get,
+			lpass_cdc_wsa_macro_ear_spkrrecv_put),
 	SOC_SINGLE_EXT("Idle Detect", SND_SOC_NOPM, 0, 1,
 			0, lpass_cdc_wsa_macro_idle_detect_get,
 			lpass_cdc_wsa_macro_idle_detect_put),

+ 1 - 8
asoc/codecs/wsa884x/wsa884x.c

@@ -773,13 +773,6 @@ static void wsa_noise_gate_write(struct snd_soc_component *component,
 	}
 }
 
-static const char * const wsa_dev_mode_text[] = {
-	"speaker", "receiver"
-};
-
-static const struct soc_enum wsa_dev_mode_enum =
-	SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(wsa_dev_mode_text), wsa_dev_mode_text);
-
 static int wsa_dev_mode_get(struct snd_kcontrol *kcontrol,
 			   struct snd_ctl_elem_value *ucontrol)
 {
@@ -805,7 +798,7 @@ static int wsa_dev_mode_put(struct snd_kcontrol *kcontrol,
 	int wsa_dev_index;
 
 	dev_mode = ucontrol->value.integer.value[0];
-	dev_dbg(component->dev, "%s: Dev Mode current: %d, new: %d  = %ld\n",
+	dev_dbg(component->dev, "%s: Dev Mode current: %d, new: %d\n",
 		__func__, wsa884x->dev_mode, dev_mode);
 
 	/* Check if input parameter is in range */