diff --git a/sound/soc/msm/Kconfig b/sound/soc/msm/Kconfig index 5accfee68407..15b29cca231f 100644 --- a/sound/soc/msm/Kconfig +++ b/sound/soc/msm/Kconfig @@ -251,6 +251,7 @@ config SND_SOC_MSM8X16 select SND_SOC_MSM8X16_WCD select SND_DYNAMIC_MINORS select QTI_PP + select DTS_SRS_TM help To add support for SoC audio on MSM8X16. This will enable sound soc drivers which diff --git a/sound/soc/msm/qdsp6v2/msm-dts-srs-tm-config.c b/sound/soc/msm/qdsp6v2/msm-dts-srs-tm-config.c index f919181485d9..b70229dd2e31 100644 --- a/sound/soc/msm/qdsp6v2/msm-dts-srs-tm-config.c +++ b/sound/soc/msm/qdsp6v2/msm-dts-srs-tm-config.c @@ -173,7 +173,18 @@ static int msm_dts_srs_trumedia_control_i2s_set(struct snd_kcontrol *kcontrol, msm_pcm_routing_release_lock(); return ret; } +static int msm_dts_srs_trumedia_control_mi2s_set(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + int ret, port_id; + pr_debug("SRS control MI2S called"); + msm_pcm_routing_acquire_lock(); + port_id = AFE_PORT_ID_PRIMARY_MI2S_RX; + ret = msm_dts_srs_trumedia_control_set_(port_id, kcontrol, ucontrol); + msm_pcm_routing_release_lock(); + return ret; +} static int msm_dts_srs_trumedia_control_hdmi_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -246,7 +257,27 @@ static const struct snd_kcontrol_new lpa_srs_trumedia_controls_i2s[] = { }) } }; - +static const struct snd_kcontrol_new lpa_srs_trumedia_controls_mi2s[] = { + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "SRS TruMedia MI2S", + .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | + SNDRV_CTL_ELEM_ACCESS_READWRITE, + .info = snd_soc_info_volsw, + .get = msm_dts_srs_trumedia_control_get, + .put = msm_dts_srs_trumedia_control_mi2s_set, + .private_value = ((unsigned long)&(struct soc_mixer_control) + { + .reg = SND_SOC_NOPM, + .rreg = SND_SOC_NOPM, + .shift = 0, + .rshift = 0, + .max = 0xFFFFFFFF, + .platform_max = 0xFFFFFFFF, + .invert = 0 + }) + } +}; void msm_dts_srs_tm_add_controls(struct snd_soc_platform *platform) { snd_soc_add_platform_controls(platform, @@ -260,6 +291,9 @@ void msm_dts_srs_tm_add_controls(struct snd_soc_platform *platform) snd_soc_add_platform_controls(platform, lpa_srs_trumedia_controls_i2s, ARRAY_SIZE(lpa_srs_trumedia_controls_i2s)); + snd_soc_add_platform_controls(platform, + lpa_srs_trumedia_controls_mi2s, + ARRAY_SIZE(lpa_srs_trumedia_controls_mi2s)); } void msm_dts_srs_tm_deinit(int port_id)