diff options
| author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-10-01 00:19:45 +0530 |
|---|---|---|
| committer | Sudheer Papothi <spapothi@codeaurora.org> | 2016-10-01 00:19:45 +0530 |
| commit | f02d95e87b72213d0a6fd9fdb7b25d60f2bf4a70 (patch) | |
| tree | 7a6e35c2c3f5ed431fc66dbf0c6aeca16c62557d | |
| parent | 626caf4e54864d90e8d104277f9a1446e487c7e1 (diff) | |
ASoC: msmcobalt: Check for number of aux codecs
Add a check for number of aux codecs before applying the
aux codec gain settings from machine driver to avoid
setting the gains if there are no aux codecs connected.
Change-Id: I86e6c4a15e6eed8e4650c6eb072f07f49890aecc
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
| -rw-r--r-- | sound/soc/msm/msmcobalt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/msm/msmcobalt.c b/sound/soc/msm/msmcobalt.c index 17e78b25c6ca..93352ee68bf7 100644 --- a/sound/soc/msm/msmcobalt.c +++ b/sound/soc/msm/msmcobalt.c @@ -2531,8 +2531,10 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) * Send speaker configuration only for WSA8810. * Defalut configuration is for WSA8815. */ + pr_debug("%s: Number of aux devices: %d\n", + __func__, rtd->card->num_aux_devs); if (!strcmp(dev_name(codec_dai->dev), "tavil_codec")) { - if (rtd_aux && rtd_aux->component) + if (rtd->card->num_aux_devs && rtd_aux && rtd_aux->component) if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) || !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) { tavil_set_spkr_mode(rtd->codec, SPKR_MODE_1); @@ -2551,7 +2553,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) pdata->codec_root = entry; tavil_codec_info_create_codec_entry(pdata->codec_root, codec); } else { - if (rtd_aux && rtd_aux->component) + if (rtd->card->num_aux_devs && rtd_aux && rtd_aux->component) if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) || !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) { tasha_set_spkr_mode(rtd->codec, SPKR_MODE_1); |
