Browse Source

asoc: add support to set ADM channels for SLIM_9_TX port

In split A2DP sink ADM channels is set to mono based
on BE config. Add support to set ADM channels based
on decoder config received from BT IPC library.

Change-Id: I3925b805593871d420f4cfd3ce4b87adb0e03272
Signed-off-by: Surendar Karka <[email protected]>
Surendar Karka 5 years ago
parent
commit
25e77dd111
1 changed files with 8 additions and 2 deletions
  1. 8 2
      asoc/msm-pcm-routing-v2.c

+ 8 - 2
asoc/msm-pcm-routing-v2.c

@@ -3138,7 +3138,7 @@ static int msm_routing_lsm_func_put(struct snd_kcontrol *kcontrol,
 
 static const char *const adm_override_chs_text[] = {"Zero", "One", "Two"};
 
-static SOC_ENUM_SINGLE_EXT_DECL(slim_7_rx_adm_override_chs,
+static SOC_ENUM_SINGLE_EXT_DECL(adm_override_chs,
 				adm_override_chs_text);
 
 static int msm_routing_adm_get_backend_idx(struct snd_kcontrol *kcontrol)
@@ -3147,6 +3147,8 @@ static int msm_routing_adm_get_backend_idx(struct snd_kcontrol *kcontrol)
 
 	if (strnstr(kcontrol->id.name, "SLIM7_RX", sizeof("SLIM7_RX"))) {
 		backend_id = MSM_BACKEND_DAI_SLIMBUS_7_RX;
+	} else if (strnstr(kcontrol->id.name, "SLIM9_TX", sizeof("SLIM9_TX"))) {
+		backend_id = MSM_BACKEND_DAI_SLIMBUS_9_TX;
 	} else {
 		pr_err("%s: unsupported backend id: %s",
 			__func__, kcontrol->id.name);
@@ -3155,6 +3157,7 @@ static int msm_routing_adm_get_backend_idx(struct snd_kcontrol *kcontrol)
 
 	return backend_id;
 }
+
 static int msm_routing_adm_channel_config_get(
 					struct snd_kcontrol *kcontrol,
 					struct snd_ctl_elem_value *ucontrol)
@@ -3193,7 +3196,10 @@ static int msm_routing_adm_channel_config_put(
 }
 
 static const struct snd_kcontrol_new adm_channel_config_controls[] = {
-	SOC_ENUM_EXT("SLIM7_RX ADM Channels", slim_7_rx_adm_override_chs,
+	SOC_ENUM_EXT("SLIM7_RX ADM Channels", adm_override_chs,
+			msm_routing_adm_channel_config_get,
+			msm_routing_adm_channel_config_put),
+	SOC_ENUM_EXT("SLIM9_TX ADM Channels", adm_override_chs,
 			msm_routing_adm_channel_config_get,
 			msm_routing_adm_channel_config_put),
 };