From cc0ec8435faed1c362bc3c2bea18fb40b064b7ae Mon Sep 17 00:00:00 2001 From: Walter Yang Date: Fri, 26 Aug 2016 20:34:09 +0800 Subject: [PATCH] ASoC: msm: Create the codec entry for wcd934x codec Create codec entry for wcd934x codec so that userspace can retrieve the codec info. CRs-Fixed: 1063367 Change-Id: Ie846b5edf1d8aaecce5140986dad8da69d608d5a Signed-off-by: Walter Yang --- sound/soc/msm/msmcobalt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/msm/msmcobalt.c b/sound/soc/msm/msmcobalt.c index 523cd1ce4140..e9e991aaa845 100644 --- a/sound/soc/msm/msmcobalt.c +++ b/sound/soc/msm/msmcobalt.c @@ -1866,6 +1866,17 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) tavil_set_spkr_gain_offset(rtd->codec, RX_GAIN_OFFSET_M1P5_DB); } + card = rtd->card->snd_card; + entry = snd_register_module_info(card->module, "codecs", + card->proc_root); + if (!entry) { + pr_debug("%s: Cannot create codecs module entry\n", + __func__); + pdata->codec_root = NULL; + goto done; + } + pdata->codec_root = entry; + tavil_codec_info_create_codec_entry(pdata->codec_root, codec); } else { if (rtd_aux && rtd_aux->component) if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) || @@ -1886,6 +1897,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) pdata->codec_root = entry; tasha_codec_info_create_codec_entry(pdata->codec_root, codec); } +done: codec_reg_done = true; return 0;