Skip to content

Commit 85b16f6

Browse files
committed
techpack: audio: merge branch android-msm-sunfish-4.14-android13 (android-13.0.0_r0.17)
Signed-off-by: engstk <[email protected]>
1 parent e4c8d19 commit 85b16f6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

techpack/audio/asoc/msm-pcm-q6-noirq.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
728728
return -ENODEV;
729729
}
730730

731-
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
731+
substream = vol->pcm->streams[vol->stream].substream;
732732

733733
if (!substream) {
734734
pr_err("%s substream not found\n", __func__);
@@ -777,7 +777,7 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
777777
return -ENODEV;
778778
}
779779

780-
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
780+
substream = vol->pcm->streams[vol->stream].substream;
781781
pr_debug("%s: volume : 0x%x\n", __func__, volume);
782782
if (!substream) {
783783
pr_err("%s substream not found\n", __func__);
@@ -806,17 +806,16 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
806806
return rc;
807807
}
808808

809-
static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd)
809+
static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd, int stream)
810810
{
811811
int ret = 0;
812812
struct snd_pcm *pcm = rtd->pcm;
813813
struct snd_pcm_volume *volume_info;
814814
struct snd_kcontrol *kctl;
815815

816-
dev_dbg(rtd->dev, "%s, Volume control add\n", __func__);
817-
ret = snd_pcm_add_volume_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
818-
NULL, 1, rtd->dai_link->id,
819-
&volume_info);
816+
dev_dbg(rtd->dev, "%s, volume control add\n", __func__);
817+
ret = snd_pcm_add_volume_ctls(pcm, stream,
818+
NULL, 1, rtd->dai_link->id, &volume_info);
820819
if (ret < 0) {
821820
pr_err("%s volume control failed ret %d\n", __func__, ret);
822821
return ret;
@@ -1307,12 +1306,16 @@ static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
13071306
pr_err("%s: Could not add pcm Channel Map Control\n",
13081307
__func__);
13091308

1310-
ret = msm_pcm_add_volume_control(rtd);
1309+
ret = msm_pcm_add_volume_control(rtd, SNDRV_PCM_STREAM_PLAYBACK);
13111310
if (ret) {
1312-
pr_err("%s: Could not add pcm Volume Control %d\n",
1311+
pr_err("%s: Could not add pcm playback volume Control %d\n",
1312+
__func__, ret);
1313+
}
1314+
ret = msm_pcm_add_volume_control(rtd, SNDRV_PCM_STREAM_CAPTURE);
1315+
if (ret) {
1316+
pr_err("%s: Could not add pcm capture volume Control %d\n",
13131317
__func__, ret);
13141318
}
1315-
13161319
ret = msm_pcm_add_fe_topology_control(rtd);
13171320
if (ret) {
13181321
pr_err("%s: Could not add pcm topology control %d\n",

0 commit comments

Comments
 (0)