Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97f2b08f authored by Simmi Pateriya's avatar Simmi Pateriya
Browse files

ASoC: msm: create codec info entries for msm8952 on 3.18



Create wcd and wsa codec info entries for msm8952 on 3.18
platform. These info entries contain the chipset ID and
version related information.

Change-Id: Icf5678e5f57221b93d036e9b56758bac4bf97f50
Signed-off-by: default avatarSimmi Pateriya <simmip@codeaurora.org>
parent f5d3db32
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <sound/q6afe-v2.h>
#include <sound/q6core.h>
#include <sound/pcm_params.h>
#include <sound/info.h>
#include <soc/qcom/socinfo.h>
#include <linux/input.h>
#include "qdsp6v2/msm-pcm-routing-v2.h"
@@ -276,6 +277,7 @@ struct msm8952_asoc_mach_data {
	struct snd_soc_codec *codec;
	struct msm8952_codec msm8952_codec_fn;
	struct ext_intf_cfg clk_ref;
	struct snd_info_entry *codec_root;
	void __iomem *vaddr_gpio_mux_spkr_ctl;
	void __iomem *vaddr_gpio_mux_mic_ctl;
	void __iomem *vaddr_gpio_mux_pcm_ctl;
@@ -300,6 +302,8 @@ int msm895x_wsa881x_init(struct snd_soc_component *component)
	unsigned int ch_rate[WSA881X_MAX_SWR_PORTS] = {2400, 600, 300, 1200};
	unsigned int ch_mask[WSA881X_MAX_SWR_PORTS] = {0x1, 0xF, 0x3, 0x3};
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct snd_soc_card *card = codec->component.card;
	struct msm8952_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);

	if (!codec) {
		pr_err("%s codec is NULL\n", __func__);
@@ -318,6 +322,10 @@ int msm895x_wsa881x_init(struct snd_soc_component *component)
			codec->component.name);
		return -EINVAL;
	}
	pdata = snd_soc_card_get_drvdata(card);
	if (pdata && pdata->codec_root)
		wsa881x_codec_info_create_codec_entry(pdata->codec_root,
						      codec);
	return 0;
}

@@ -1780,8 +1788,10 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	struct snd_soc_card *card = codec->component.card;
	struct msm8952_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
	struct snd_card *card;
	struct snd_info_entry *entry;
	struct msm8952_asoc_mach_data *pdata =
				snd_soc_card_get_drvdata(rtd->card);

	/* Codec SLIMBUS configuration
	 * RX1, RX2, RX3, RX4, RX5, RX6, RX7, RX8, RX9, RX10, RX11, RX12, RX13
@@ -1941,6 +1951,22 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
		tomtom_event_register(msm8952_codec_event_cb, rtd->codec);

	codec_reg_done = true;

	if (!strcmp(dev_name(codec_dai->dev), "tasha_codec")) {
		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__);
			err = 0;
			goto out;
		}
		pdata->codec_root = entry;
		tasha_codec_info_create_codec_entry(pdata->codec_root,
						    codec);
	}
	return 0;
out:
	return err;