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

Commit 376e9cd7 authored by Rohit Kumar's avatar Rohit Kumar
Browse files

ASoC: msm: access aux_devs with component list



Update sdm660 machine driver to access aux_devs with component
linked list. Also update the api to create subdirectory to
snd_info_create_subdir().These changes are in accordance with
the upstream changes in ASoC between Linux-4.4 and Linux-4.9 versions.

Change-Id: Ibf1e7dba4c0c6268ef1b1e552e0382bbda8a9f89
Signed-off-by: default avatarRohit Kumar <rohitkr@codeaurora.org>
parent ee8d341b
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -1495,7 +1495,7 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
			snd_soc_codec_get_dapm(codec);
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	struct snd_soc_pcm_runtime *rtd_aux = rtd->card->rtd_aux;
	struct snd_soc_component *aux_comp;
	struct snd_card *card;
	struct snd_info_entry *entry;
	struct msm_asoc_mach_data *pdata =
@@ -1678,14 +1678,21 @@ 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 (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) ||
			    !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) {
		if (rtd->card->num_aux_devs &&
		    !list_empty(&rtd->card->aux_comp_list)) {
			aux_comp = list_first_entry(&rtd->card->aux_comp_list,
				struct snd_soc_component, list_aux);
			if (!strcmp(aux_comp->name, WSA8810_NAME_1) ||
			    !strcmp(aux_comp->name, WSA8810_NAME_2)) {
				tavil_set_spkr_mode(rtd->codec, SPKR_MODE_1);
				tavil_set_spkr_gain_offset(rtd->codec,
							RX_GAIN_OFFSET_M1P5_DB);
			}
		}
		card = rtd->card->snd_card;
		entry = snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
@@ -1698,13 +1705,17 @@ 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 (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) ||
			    !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) {
		if (rtd->card->num_aux_devs &&
		    !list_empty(&rtd->card->aux_comp_list)) {
			aux_comp = list_first_entry(&rtd->card->aux_comp_list,
				struct snd_soc_component, list_aux);
			if (!strcmp(aux_comp->name, WSA8810_NAME_1) ||
			    !strcmp(aux_comp->name, WSA8810_NAME_2)) {
				tasha_set_spkr_mode(rtd->codec, SPKR_MODE_1);
				tasha_set_spkr_gain_offset(rtd->codec,
							RX_GAIN_OFFSET_M1P5_DB);
			}
		}
		card = rtd->card->snd_card;
		entry = snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
+12 −6
Original line number Diff line number Diff line
@@ -1303,7 +1303,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)

	card = rtd->card->snd_card;
	if (!codec_root)
		codec_root = snd_register_module_info(card->module, "codecs",
		codec_root = snd_info_create_subdir(card->module, "codecs",
						      card->proc_root);
	if (!codec_root) {
		pr_debug("%s: Cannot create codecs module entry\n",
@@ -1323,7 +1323,7 @@ static int msm_sdw_audrx_init(struct snd_soc_pcm_runtime *rtd)
	struct snd_soc_dapm_context *dapm =
			snd_soc_codec_get_dapm(codec);
	struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(rtd->card);
	struct snd_soc_pcm_runtime *rtd_aux = rtd->card->rtd_aux;
	struct snd_soc_component *aux_comp;
	struct snd_card *card;

	snd_soc_add_codec_controls(codec, msm_sdw_controls,
@@ -1342,16 +1342,22 @@ static int msm_sdw_audrx_init(struct snd_soc_pcm_runtime *rtd)
	 * Send speaker configuration only for WSA8810.
	 * Default configuration is for WSA8815.
	 */
	if (rtd_aux && rtd_aux->component)
		if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) ||
		    !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) {
	pr_debug("%s: Number of aux devices: %d\n",
		 __func__, rtd->card->num_aux_devs);
	if (rtd->card->num_aux_devs &&
		!list_empty(&rtd->card->aux_comp_list)) {
		aux_comp = list_first_entry(&rtd->card->aux_comp_list,
					struct snd_soc_component, list_aux);
		if (!strcmp(aux_comp->name, WSA8810_NAME_1) ||
			!strcmp(aux_comp->name, WSA8810_NAME_2)) {
			msm_sdw_set_spkr_mode(rtd->codec, SPKR_MODE_1);
			msm_sdw_set_spkr_gain_offset(rtd->codec,
						   RX_GAIN_OFFSET_M1P5_DB);
		}
	}
	card = rtd->card->snd_card;
	if (!codec_root)
		codec_root = snd_register_module_info(card->module, "codecs",
		codec_root = snd_info_create_subdir(card->module, "codecs",
						      card->proc_root);
	if (!codec_root) {
		pr_debug("%s: Cannot create codecs module entry\n",