Skip to content

Commit d340fba

Browse files
Linux Build Service AccountMumetNgoding
authored andcommitted
"LA.UM.8.6.2.r1-08600-89xx.0" Change-Id: Ibd749e0165e1be6d4e175238bf7e8cd086a2fc2e
1 parent c2a4d96 commit d340fba

File tree

4 files changed

+104
-10
lines changed

4 files changed

+104
-10
lines changed

techpack/audio/asoc/msm-pcm-loopback-v2.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2013-2017, 2019 The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2013-2017, 2019-2020 The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -489,10 +489,21 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
489489
{
490490
int rc = 0;
491491
struct snd_pcm_volume *vol = kcontrol->private_data;
492-
struct snd_pcm_substream *substream = vol->pcm->streams[0].substream;
492+
struct snd_pcm_substream *substream = NULL;
493493
struct msm_pcm_loopback *prtd;
494494
int volume = ucontrol->value.integer.value[0];
495495

496+
if (!vol) {
497+
pr_err("%s: vol is NULL\n", __func__);
498+
return -ENODEV;
499+
}
500+
501+
if (!vol->pcm) {
502+
pr_err("%s: vol->pcm is NULL\n", __func__);
503+
return -ENODEV;
504+
}
505+
506+
substream = vol->pcm->streams[0].substream;
496507
pr_debug("%s: volume : 0x%x\n", __func__, volume);
497508
if ((!substream) || (!substream->runtime)) {
498509
pr_err("%s substream or runtime not found\n", __func__);
@@ -518,11 +529,21 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
518529
{
519530
int rc = 0;
520531
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
521-
struct snd_pcm_substream *substream =
522-
vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
532+
struct snd_pcm_substream *substream = NULL;
523533
struct msm_pcm_loopback *prtd;
524534

525535
pr_debug("%s\n", __func__);
536+
if (!vol) {
537+
pr_err("%s: vol is NULL\n", __func__);
538+
return -ENODEV;
539+
}
540+
541+
if (!vol->pcm) {
542+
pr_err("%s: vol->pcm is NULL\n", __func__);
543+
return -ENODEV;
544+
}
545+
546+
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
526547
if ((!substream) || (!substream->runtime)) {
527548
pr_err("%s substream or runtime not found\n", __func__);
528549
rc = -ENODEV;

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -667,6 +667,17 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
667667
struct msm_audio *prtd;
668668

669669
pr_debug("%s\n", __func__);
670+
if (!vol) {
671+
pr_err("%s: vol is NULL\n", __func__);
672+
return -ENODEV;
673+
}
674+
675+
if (!vol->pcm) {
676+
pr_err("%s: vol->pcm is NULL\n", __func__);
677+
return -ENODEV;
678+
}
679+
680+
substream = vol->pcm->streams[vol->stream].substream;
670681
if (!substream) {
671682
pr_err("%s substream not found\n", __func__);
672683
return -ENODEV;
@@ -698,12 +709,23 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
698709
int rc = 0;
699710
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
700711
struct msm_plat_data *pdata = NULL;
701-
struct snd_pcm_substream *substream =
702-
vol->pcm->streams[vol->stream].substream;
712+
struct snd_pcm_substream *substream = NULL;
703713
struct snd_soc_pcm_runtime *soc_prtd = NULL;
704714
struct msm_audio *prtd;
705715
int volume = ucontrol->value.integer.value[0];
706716

717+
pr_debug("%s\n", __func__);
718+
if (!vol) {
719+
pr_err("%s: vol is NULL\n", __func__);
720+
return -ENODEV;
721+
}
722+
723+
if (!vol->pcm) {
724+
pr_err("%s: vol->pcm is NULL\n", __func__);
725+
return -ENODEV;
726+
}
727+
728+
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
707729
pr_debug("%s: volume : 0x%x\n", __func__, volume);
708730
if (!substream) {
709731
pr_err("%s substream not found\n", __func__);

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -1385,6 +1385,17 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
13851385
struct msm_audio *prtd;
13861386

13871387
pr_debug("%s\n", __func__);
1388+
if (!vol) {
1389+
pr_err("%s: vol is NULL\n", __func__);
1390+
return -ENODEV;
1391+
}
1392+
1393+
if (!vol->pcm) {
1394+
pr_err("%s: vol->pcm is NULL\n", __func__);
1395+
return -ENODEV;
1396+
}
1397+
1398+
substream = vol->pcm->streams[vol->stream].substream;
13881399
if (!substream) {
13891400
pr_err("%s substream not found\n", __func__);
13901401
return -ENODEV;
@@ -1416,14 +1427,24 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
14161427
{
14171428
int rc = 0;
14181429
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
1419-
struct snd_pcm_substream *substream =
1420-
vol->pcm->streams[vol->stream].substream;
1430+
struct snd_pcm_substream *substream = NULL;
14211431
struct msm_audio *prtd;
14221432
int volume = ucontrol->value.integer.value[0];
14231433
struct msm_plat_data *pdata = NULL;
14241434
struct snd_soc_pcm_runtime *soc_prtd = NULL;
14251435

14261436
pr_debug("%s: volume : 0x%x\n", __func__, volume);
1437+
if (!vol) {
1438+
pr_err("%s: vol is NULL\n", __func__);
1439+
return -ENODEV;
1440+
}
1441+
1442+
if (!vol->pcm) {
1443+
pr_err("%s: vol->pcm is NULL\n", __func__);
1444+
return -ENODEV;
1445+
}
1446+
1447+
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
14271448
if (!substream) {
14281449
pr_err("%s: substream not found\n", __func__);
14291450
return -ENODEV;

techpack/audio/asoc/sdm660-common.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,14 @@ static unsigned int tdm_param_set_slot_mask(u16 port_id, int slot_width,
645645
case AFE_PORT_ID_PRIMARY_TDM_RX_5:
646646
case AFE_PORT_ID_PRIMARY_TDM_RX_6:
647647
case AFE_PORT_ID_PRIMARY_TDM_RX_7:
648+
case AFE_PORT_ID_SECONDARY_TDM_RX:
649+
case AFE_PORT_ID_SECONDARY_TDM_RX_1:
650+
case AFE_PORT_ID_SECONDARY_TDM_RX_2:
651+
case AFE_PORT_ID_SECONDARY_TDM_RX_3:
652+
case AFE_PORT_ID_SECONDARY_TDM_RX_4:
653+
case AFE_PORT_ID_SECONDARY_TDM_RX_5:
654+
case AFE_PORT_ID_SECONDARY_TDM_RX_6:
655+
case AFE_PORT_ID_SECONDARY_TDM_RX_7:
648656
case AFE_PORT_ID_TERTIARY_TDM_RX:
649657
case AFE_PORT_ID_TERTIARY_TDM_RX_1:
650658
case AFE_PORT_ID_TERTIARY_TDM_RX_2:
@@ -665,6 +673,14 @@ static unsigned int tdm_param_set_slot_mask(u16 port_id, int slot_width,
665673
case AFE_PORT_ID_PRIMARY_TDM_TX_5:
666674
case AFE_PORT_ID_PRIMARY_TDM_TX_6:
667675
case AFE_PORT_ID_PRIMARY_TDM_TX_7:
676+
case AFE_PORT_ID_SECONDARY_TDM_TX:
677+
case AFE_PORT_ID_SECONDARY_TDM_TX_1:
678+
case AFE_PORT_ID_SECONDARY_TDM_TX_2:
679+
case AFE_PORT_ID_SECONDARY_TDM_TX_3:
680+
case AFE_PORT_ID_SECONDARY_TDM_TX_4:
681+
case AFE_PORT_ID_SECONDARY_TDM_TX_5:
682+
case AFE_PORT_ID_SECONDARY_TDM_TX_6:
683+
case AFE_PORT_ID_SECONDARY_TDM_TX_7:
668684
case AFE_PORT_ID_TERTIARY_TDM_TX:
669685
case AFE_PORT_ID_TERTIARY_TDM_TX_1:
670686
case AFE_PORT_ID_TERTIARY_TDM_TX_2:
@@ -4999,7 +5015,21 @@ static int msm_get_tdm_mode(u32 port_id)
49995015
tdm_mode = TDM_PRI;
50005016
break;
50015017
case AFE_PORT_ID_SECONDARY_TDM_RX:
5018+
case AFE_PORT_ID_SECONDARY_TDM_RX_1:
5019+
case AFE_PORT_ID_SECONDARY_TDM_RX_2:
5020+
case AFE_PORT_ID_SECONDARY_TDM_RX_3:
5021+
case AFE_PORT_ID_SECONDARY_TDM_RX_4:
5022+
case AFE_PORT_ID_SECONDARY_TDM_RX_5:
5023+
case AFE_PORT_ID_SECONDARY_TDM_RX_6:
5024+
case AFE_PORT_ID_SECONDARY_TDM_RX_7:
50025025
case AFE_PORT_ID_SECONDARY_TDM_TX:
5026+
case AFE_PORT_ID_SECONDARY_TDM_TX_1:
5027+
case AFE_PORT_ID_SECONDARY_TDM_TX_2:
5028+
case AFE_PORT_ID_SECONDARY_TDM_TX_3:
5029+
case AFE_PORT_ID_SECONDARY_TDM_TX_4:
5030+
case AFE_PORT_ID_SECONDARY_TDM_TX_5:
5031+
case AFE_PORT_ID_SECONDARY_TDM_TX_6:
5032+
case AFE_PORT_ID_SECONDARY_TDM_TX_7:
50035033
tdm_mode = TDM_SEC;
50045034
break;
50055035
case AFE_PORT_ID_TERTIARY_TDM_RX:

0 commit comments

Comments
 (0)