summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorDerek Chen <chenche@codeaurora.org>2017-11-13 18:26:12 -0500
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-08 15:10:11 -0700
commite0490202589c2cf0222ae43cbce62b72774b8402 (patch)
treea74cb6c2b2e042284afae6bde3485215d68146ee /sound/soc
parent7ae0b636e93d11cca7bdf40d3b816ab6d513e763 (diff)
ASoC: msm: qdsp6v2: add lsm support for tdm ports
Add LSM routing and kcontrol support for TDM backend ports. Change-Id: Ie6d05691a3e763fe1b7f37dd86415091f7da0e6d Signed-off-by: Derek Chen <chenche@codeaurora.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c55
-rw-r--r--sound/soc/msm/qdsp6v2/q6afe.c6
2 files changed, 56 insertions, 5 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
index 4e4970b7be33..10aaafe4b470 100644
--- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
@@ -116,6 +116,7 @@ enum {
#define QUAT_MI2S_TX_TEXT "QUAT_MI2S_TX"
#define ADM_LSM_TX_TEXT "ADM_LSM_TX"
#define INT3_MI2S_TX_TEXT "INT3_MI2S_TX"
+#define QUAT_TDM_TX_0_TEXT "QUAT_TDM_TX_0"
#define LSM_FUNCTION_TEXT "LSM Function"
static const char * const lsm_port_text[] = {
@@ -123,7 +124,7 @@ static const char * const lsm_port_text[] = {
SLIMBUS_0_TX_TEXT, SLIMBUS_1_TX_TEXT, SLIMBUS_2_TX_TEXT,
SLIMBUS_3_TX_TEXT, SLIMBUS_4_TX_TEXT, SLIMBUS_5_TX_TEXT,
TERT_MI2S_TX_TEXT, QUAT_MI2S_TX_TEXT, ADM_LSM_TX_TEXT,
- INT3_MI2S_TX_TEXT
+ INT3_MI2S_TX_TEXT, QUAT_TDM_TX_0_TEXT
};
struct msm_pcm_route_bdai_pp_params {
@@ -2547,6 +2548,9 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol,
case 10:
lsm_port = AFE_PORT_ID_INT3_MI2S_TX;
break;
+ case 11:
+ lsm_port = AFE_PORT_ID_QUATERNARY_TDM_TX;
+ break;
default:
pr_err("Default lsm port");
break;
@@ -2564,7 +2568,7 @@ static int msm_routing_lsm_func_get(struct snd_kcontrol *kcontrol,
u16 port_id;
enum afe_mad_type mad_type;
- pr_debug("%s: enter\n", __func__);
+ pr_debug("%s: id.name=%s\n", __func__, kcontrol->id.name);
for (i = 0; i < ARRAY_SIZE(lsm_port_text); i++)
if (!strnstr(kcontrol->id.name, lsm_port_text[i],
strlen(lsm_port_text[i])))
@@ -2590,6 +2594,10 @@ static int msm_routing_lsm_func_get(struct snd_kcontrol *kcontrol,
strlen(lsm_port_text[10])))
port_id = AFE_PORT_ID_INT3_MI2S_TX;
+ if (strnstr(kcontrol->id.name, lsm_port_text[11],
+ strlen(lsm_port_text[11])))
+ port_id = AFE_PORT_ID_QUATERNARY_TDM_TX;
+
mad_type = afe_port_get_mad_type(port_id);
pr_debug("%s: port_id 0x%x, mad_type %d\n", __func__, port_id,
mad_type);
@@ -2623,7 +2631,7 @@ static int msm_routing_lsm_func_put(struct snd_kcontrol *kcontrol,
u16 port_id;
enum afe_mad_type mad_type;
- pr_debug("%s: enter\n", __func__);
+ pr_debug("%s: id.name=%s\n", __func__, kcontrol->id.name);
for (i = 0; i < ARRAY_SIZE(lsm_port_text); i++)
if (strnstr(kcontrol->id.name, lsm_port_text[i],
strlen(lsm_port_text[i])))
@@ -2669,6 +2677,10 @@ static int msm_routing_lsm_func_put(struct snd_kcontrol *kcontrol,
strlen(lsm_port_text[10])))
port_id = AFE_PORT_ID_INT3_MI2S_TX;
+ if (strnstr(kcontrol->id.name, lsm_port_text[11],
+ strlen(lsm_port_text[11])))
+ port_id = AFE_PORT_ID_QUATERNARY_TDM_TX;
+
pr_debug("%s: port_id 0x%x, mad_type %d\n", __func__, port_id,
mad_type);
return afe_port_set_mad_type(port_id, mad_type);
@@ -11049,6 +11061,9 @@ static const struct snd_kcontrol_new lsm1_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM1, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM1, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm2_mixer_controls[] = {
@@ -11076,6 +11091,9 @@ static const struct snd_kcontrol_new lsm2_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM2, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM2, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm3_mixer_controls[] = {
@@ -11103,6 +11121,9 @@ static const struct snd_kcontrol_new lsm3_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM3, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM3, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm4_mixer_controls[] = {
@@ -11130,6 +11151,9 @@ static const struct snd_kcontrol_new lsm4_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM4, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM4, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm5_mixer_controls[] = {
@@ -11157,6 +11181,9 @@ static const struct snd_kcontrol_new lsm5_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM5, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM5, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm6_mixer_controls[] = {
@@ -11184,6 +11211,9 @@ static const struct snd_kcontrol_new lsm6_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM6, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM6, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm7_mixer_controls[] = {
@@ -11211,6 +11241,9 @@ static const struct snd_kcontrol_new lsm7_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM7, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM7, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new lsm8_mixer_controls[] = {
@@ -11238,6 +11271,9 @@ static const struct snd_kcontrol_new lsm8_mixer_controls[] = {
SOC_SINGLE_EXT("INT3_MI2S_TX", MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_LSM8, 1, 0, msm_routing_get_listen_mixer,
msm_routing_put_listen_mixer),
+ SOC_SINGLE_EXT("QUAT_TDM_TX_0", MSM_BACKEND_DAI_QUAT_TDM_TX_0,
+ MSM_FRONTEND_DAI_LSM8, 1, 0, msm_routing_get_listen_mixer,
+ msm_routing_put_listen_mixer),
};
static const struct snd_kcontrol_new slim_fm_switch_mixer_controls =
@@ -11354,6 +11390,8 @@ static const struct snd_kcontrol_new lsm_controls[] = {
msm_routing_lsm_func_get, msm_routing_lsm_func_put),
SOC_ENUM_EXT(INT3_MI2S_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
msm_routing_lsm_func_get, msm_routing_lsm_func_put),
+ SOC_ENUM_EXT(QUAT_TDM_TX_0_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
+ msm_routing_lsm_func_get, msm_routing_lsm_func_put),
/* kcontrol of lsm_port */
SOC_ENUM_EXT("LSM1 Port", lsm_port_enum,
msm_routing_lsm_port_get,
@@ -11379,6 +11417,9 @@ static const struct snd_kcontrol_new lsm_controls[] = {
SOC_ENUM_EXT("LSM8 Port", lsm_port_enum,
msm_routing_lsm_port_get,
msm_routing_lsm_port_put),
+ SOC_ENUM_EXT("LSM9 Port", lsm_port_enum,
+ msm_routing_lsm_port_get,
+ msm_routing_lsm_port_put),
};
static const char * const aanc_slim_0_rx_text[] = {
@@ -15200,6 +15241,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM1 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
{"LSM1 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"LSM1 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
+ {"LSM1 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM1_UL_HL", NULL, "LSM1 Mixer"},
{"LSM2 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
@@ -15210,6 +15252,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM2 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
{"LSM2 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"LSM2 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
+ {"LSM2 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM2_UL_HL", NULL, "LSM2 Mixer"},
@@ -15221,6 +15264,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM3 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
{"LSM3 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"LSM3 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
+ {"LSM3 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM3_UL_HL", NULL, "LSM3 Mixer"},
@@ -15232,6 +15276,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM4 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
{"LSM4 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"LSM4 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
+ {"LSM4 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM4_UL_HL", NULL, "LSM4 Mixer"},
{"LSM5 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
@@ -15242,6 +15287,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM5 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
{"LSM5 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"LSM5 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
+ {"LSM5 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM5_UL_HL", NULL, "LSM5 Mixer"},
{"LSM6 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
@@ -15250,6 +15296,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM6 Mixer", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
{"LSM6 Mixer", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
{"LSM6 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
+ {"LSM6 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM6_UL_HL", NULL, "LSM6 Mixer"},
{"LSM7 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
@@ -15258,6 +15305,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM7 Mixer", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
{"LSM7 Mixer", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
{"LSM7 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
+ {"LSM7 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM7_UL_HL", NULL, "LSM7 Mixer"},
{"LSM8 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
@@ -15266,6 +15314,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LSM8 Mixer", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
{"LSM8 Mixer", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
{"LSM8 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
+ {"LSM8 Mixer", "QUAT_TDM_TX_0", "QUAT_TDM_TX_0"},
{"LSM8_UL_HL", NULL, "LSM8 Mixer"},
diff --git a/sound/soc/msm/qdsp6v2/q6afe.c b/sound/soc/msm/qdsp6v2/q6afe.c
index 38dc3639a682..0524ca21feba 100644
--- a/sound/soc/msm/qdsp6v2/q6afe.c
+++ b/sound/soc/msm/qdsp6v2/q6afe.c
@@ -2374,7 +2374,8 @@ int afe_port_set_mad_type(u16 port_id, enum afe_mad_type mad_type)
int i;
if (port_id == AFE_PORT_ID_TERTIARY_MI2S_TX ||
- port_id == AFE_PORT_ID_INT3_MI2S_TX) {
+ port_id == AFE_PORT_ID_INT3_MI2S_TX ||
+ port_id == AFE_PORT_ID_QUATERNARY_TDM_TX) {
mad_type = MAD_SW_AUDIO;
return 0;
}
@@ -2393,7 +2394,8 @@ enum afe_mad_type afe_port_get_mad_type(u16 port_id)
int i;
if (port_id == AFE_PORT_ID_TERTIARY_MI2S_TX ||
- port_id == AFE_PORT_ID_INT3_MI2S_TX)
+ port_id == AFE_PORT_ID_INT3_MI2S_TX ||
+ port_id == AFE_PORT_ID_QUATERNARY_TDM_TX)
return MAD_SW_AUDIO;
i = port_id - SLIMBUS_0_RX;