summaryrefslogtreecommitdiff
path: root/sound/soc/msm
diff options
context:
space:
mode:
authorBanajit Goswami <bgoswami@codeaurora.org>2016-03-01 17:05:56 -0800
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-06 12:06:25 -0700
commit935421afd31326334b1249c0d16a2ea693f36614 (patch)
tree17d4cd97e2ea6bab553e96c6969a9d45515bde1b /sound/soc/msm
parentf000cc25f99545b63690ea6f585ece4b1d3d8048 (diff)
ASoC: msm: qdsp6v2: add loopback volume control for SLIMBUS_8_TX
Add a new mixer control for volume control for SLIMBUS_8_TX AFE port loopback. Change-Id: Ifbf1778255edbe4901bd0860216ba1dd5a786047 Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Diffstat (limited to 'sound/soc/msm')
-rw-r--r--sound/soc/msm/qdsp6v2/msm-qti-pp-config.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-qti-pp-config.c b/sound/soc/msm/qdsp6v2/msm-qti-pp-config.c
index c9488e474960..d4d22d3587ba 100644
--- a/sound/soc/msm/qdsp6v2/msm-qti-pp-config.c
+++ b/sound/soc/msm/qdsp6v2/msm-qti-pp-config.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -395,6 +395,7 @@ static int msm_afe_lb_vol_ctrl;
static int msm_afe_sec_mi2s_lb_vol_ctrl;
static int msm_afe_tert_mi2s_lb_vol_ctrl;
static int msm_afe_quat_mi2s_lb_vol_ctrl;
+static int msm_afe_slimbus_8_lb_vol_ctrl;
static const DECLARE_TLV_DB_LINEAR(fm_rx_vol_gain, 0, INT_RX_VOL_MAX_STEPS);
static const DECLARE_TLV_DB_LINEAR(afe_lb_vol_gain, 0, INT_RX_VOL_MAX_STEPS);
@@ -466,6 +467,30 @@ static int msm_qti_pp_set_tert_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
return 0;
}
+static int msm_qti_pp_get_slimbus_8_lb_vol_mixer(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = msm_afe_slimbus_8_lb_vol_ctrl;
+ return 0;
+}
+
+static int msm_qti_pp_set_slimbus_8_lb_vol_mixer(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ int ret = 0;
+
+ ret = afe_loopback_gain(SLIMBUS_8_TX,
+ ucontrol->value.integer.value[0]);
+
+ if (ret)
+ pr_err("%s: failed to set LB vol for SLIMBUS_8_TX", __func__);
+ else
+ msm_afe_slimbus_8_lb_vol_ctrl =
+ ucontrol->value.integer.value[0];
+
+ return ret;
+}
+
static int msm_qti_pp_get_quat_mi2s_fm_vol_mixer(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -768,6 +793,12 @@ static const struct snd_kcontrol_new tert_mi2s_lb_vol_mixer_controls[] = {
msm_qti_pp_set_tert_mi2s_lb_vol_mixer, afe_lb_vol_gain),
};
+static const struct snd_kcontrol_new slimbus_8_lb_vol_mixer_controls[] = {
+ SOC_SINGLE_EXT_TLV("SLIMBUS_8 LOOPBACK Volume", SND_SOC_NOPM, 0,
+ INT_RX_VOL_GAIN, 0, msm_qti_pp_get_slimbus_8_lb_vol_mixer,
+ msm_qti_pp_set_slimbus_8_lb_vol_mixer, afe_lb_vol_gain),
+};
+
static const struct snd_kcontrol_new int_hfp_vol_mixer_controls[] = {
SOC_SINGLE_EXT_TLV("Internal HFP RX Volume", SND_SOC_NOPM, 0,
INT_RX_VOL_GAIN, 0, msm_qti_pp_get_hfp_vol_mixer,
@@ -959,6 +990,9 @@ void msm_qti_pp_add_controls(struct snd_soc_platform *platform)
snd_soc_add_platform_controls(platform, tert_mi2s_lb_vol_mixer_controls,
ARRAY_SIZE(tert_mi2s_lb_vol_mixer_controls));
+ snd_soc_add_platform_controls(platform, slimbus_8_lb_vol_mixer_controls,
+ ARRAY_SIZE(slimbus_8_lb_vol_mixer_controls));
+
snd_soc_add_platform_controls(platform, int_hfp_vol_mixer_controls,
ARRAY_SIZE(int_hfp_vol_mixer_controls));