summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2022-08-14 18:16:59 -0700
committerLucas Wei <lucaswei@google.com>2022-08-15 10:34:31 +0800
commit591d8c85197f4bc534cbc1837ab3b7782ae57d65 (patch)
treebb3bffd60d2a8eb8881249dbfe942a53f0d1d866
parent4494723b50bfeb304235c4fab28ad0d93eb5d2b2 (diff)
parentc105c834a907657a5a9d027733a5a01a032476d7 (diff)
downloadmsm-extra-android-msm-sunfish-4.14-t-qpr2-beta-3.2.tar.gz
Bug: 238572661 SBMerger: 442815275 Change-Id: I134a9c4df76f0f13688a87062c6377ed2ddd295d Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> Signed-off-by: Lucas Wei <lucaswei@google.com>
-rw-r--r--asoc/msm-pcm-q6-noirq.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/asoc/msm-pcm-q6-noirq.c b/asoc/msm-pcm-q6-noirq.c
index 7ef99e72..a09aa3fa 100644
--- a/asoc/msm-pcm-q6-noirq.c
+++ b/asoc/msm-pcm-q6-noirq.c
@@ -728,7 +728,7 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
return -ENODEV;
}
- substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream = vol->pcm->streams[vol->stream].substream;
if (!substream) {
pr_err("%s substream not found\n", __func__);
@@ -777,7 +777,7 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
return -ENODEV;
}
- substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream = vol->pcm->streams[vol->stream].substream;
pr_debug("%s: volume : 0x%x\n", __func__, volume);
if (!substream) {
pr_err("%s substream not found\n", __func__);
@@ -806,17 +806,16 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
return rc;
}
-static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd)
+static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd, int stream)
{
int ret = 0;
struct snd_pcm *pcm = rtd->pcm;
struct snd_pcm_volume *volume_info;
struct snd_kcontrol *kctl;
- dev_dbg(rtd->dev, "%s, Volume control add\n", __func__);
- ret = snd_pcm_add_volume_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
- NULL, 1, rtd->dai_link->id,
- &volume_info);
+ dev_dbg(rtd->dev, "%s, volume control add\n", __func__);
+ ret = snd_pcm_add_volume_ctls(pcm, stream,
+ NULL, 1, rtd->dai_link->id, &volume_info);
if (ret < 0) {
pr_err("%s volume control failed ret %d\n", __func__, ret);
return ret;
@@ -1307,12 +1306,16 @@ static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
pr_err("%s: Could not add pcm Channel Map Control\n",
__func__);
- ret = msm_pcm_add_volume_control(rtd);
+ ret = msm_pcm_add_volume_control(rtd, SNDRV_PCM_STREAM_PLAYBACK);
if (ret) {
- pr_err("%s: Could not add pcm Volume Control %d\n",
+ pr_err("%s: Could not add pcm playback volume Control %d\n",
+ __func__, ret);
+ }
+ ret = msm_pcm_add_volume_control(rtd, SNDRV_PCM_STREAM_CAPTURE);
+ if (ret) {
+ pr_err("%s: Could not add pcm capture volume Control %d\n",
__func__, ret);
}
-
ret = msm_pcm_add_fe_topology_control(rtd);
if (ret) {
pr_err("%s: Could not add pcm topology control %d\n",