Skip to content

Commit

Permalink
ASoC: qdsp6: q6routing: Add support to all SLIMBus Mixers
Browse files Browse the repository at this point in the history
This patch adds support to SLIMBus related mixers to control mux between
ASM stream and AFE port.

Signed-off-by: Srinivas Kandagatla <[email protected]>
Reviewed-and-tested-by: Rohit kumar <[email protected]>
Reviewed-by: Banajit Goswami <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Srinivas-Kandagatla authored and broonie committed May 21, 2018
1 parent e3a3367 commit 794fe03
Showing 1 changed file with 261 additions and 0 deletions.
261 changes: 261 additions & 0 deletions sound/soc/qcom/qdsp6/q6routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,180 @@ static const struct snd_kcontrol_new hdmi_mixer_controls[] = {
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_0_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_1_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_1_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_2_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_2_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_3_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_3_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_4_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_4_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_4_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_4_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_5_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_5_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_kcontrol_new slimbus_6_rx_mixer_controls[] = {
SOC_SINGLE_EXT("MultiMedia1", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia2", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia3", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia4", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia5", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia6", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia7", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_SINGLE_EXT("MultiMedia8", SLIMBUS_6_RX,
MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
};

static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
/* Frontend AIF */
SND_SOC_DAPM_AIF_IN("MM_DL1", "MultiMedia1 Playback", 0, 0, 0, 0),
Expand All @@ -264,6 +438,28 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
SND_SOC_DAPM_MIXER("HDMI Mixer", SND_SOC_NOPM, 0, 0,
hdmi_mixer_controls,
ARRAY_SIZE(hdmi_mixer_controls)),

SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_rx_mixer_controls,
ARRAY_SIZE(slimbus_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_1_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_1_rx_mixer_controls,
ARRAY_SIZE(slimbus_1_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_2_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_2_rx_mixer_controls,
ARRAY_SIZE(slimbus_2_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_3_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_3_rx_mixer_controls,
ARRAY_SIZE(slimbus_3_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_4_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_4_rx_mixer_controls,
ARRAY_SIZE(slimbus_4_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_5_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_5_rx_mixer_controls,
ARRAY_SIZE(slimbus_5_rx_mixer_controls)),
SND_SOC_DAPM_MIXER("SLIMBUS_6_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
slimbus_6_rx_mixer_controls,
ARRAY_SIZE(slimbus_6_rx_mixer_controls)),
};

static const struct snd_soc_dapm_route intercon[] = {
Expand All @@ -276,6 +472,71 @@ static const struct snd_soc_dapm_route intercon[] = {
{"HDMI Mixer", "MultiMedia7", "MM_DL7"},
{"HDMI Mixer", "MultiMedia8", "MM_DL8"},
{"HDMI_RX", NULL, "HDMI Mixer"},

{"SLIMBUS_0_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_0_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_0_RX", NULL, "SLIMBUS_0_RX Audio Mixer"},

{"SLIMBUS_1_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_1_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_1_RX", NULL, "SLIMBUS_1_RX Audio Mixer"},

{"SLIMBUS_2_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_2_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_2_RX", NULL, "SLIMBUS_2_RX Audio Mixer"},

{"SLIMBUS_3_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_3_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_3_RX", NULL, "SLIMBUS_3_RX Audio Mixer"},

{"SLIMBUS_4_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_4_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_4_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_4_RX", NULL, "SLIMBUS_4_RX Audio Mixer"},

{"SLIMBUS_5_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_5_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_5_RX", NULL, "SLIMBUS_5_RX Audio Mixer"},

{"SLIMBUS_6_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
{"SLIMBUS_6_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
{"SLIMBUS_6_RX", NULL, "SLIMBUS_6_RX Audio Mixer"},
};

static int routing_hw_params(struct snd_pcm_substream *substream,
Expand Down

0 comments on commit 794fe03

Please sign in to comment.