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

Commit 4a03bd51 authored by Meng Wang's avatar Meng Wang Committed by Gerrit - the friendly Code Review server
Browse files

asoc: update snd info api



Update snd info API and userspace and get codec info.

Change-Id: Ic9cfc89365cf6263a9b1c02403d68e7740bebbeb
Signed-off-by: default avatarMeng Wang <mengw@codeaurora.org>
parent 11d5299f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -786,19 +786,26 @@ int bolero_info_create_codec_entry(struct snd_info_entry *codec_root,
		return 0;
	}
	card = component->card;
	priv->entry = snd_info_create_subdir(codec_root->module,
	priv->entry = snd_info_create_module_entry(codec_root->module,
					     "bolero", codec_root);
	if (!priv->entry) {
		dev_dbg(component->dev, "%s: failed to create bolero entry\n",
			__func__);
		return -ENOMEM;
	}
	priv->entry->mode = S_IFDIR | 0555;
	if (snd_info_register(priv->entry) < 0) {
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}

	version_entry = snd_info_create_card_entry(card->snd_card,
						   "version",
						   priv->entry);
	if (!version_entry) {
		dev_err(component->dev, "%s: failed to create bolero version entry\n",
			__func__);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}

@@ -809,6 +816,7 @@ int bolero_info_create_codec_entry(struct snd_info_entry *codec_root,

	if (snd_info_register(version_entry) < 0) {
		snd_info_free_entry(version_entry);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}
	priv->version_entry = version_entry;
+13 −1
Original line number Diff line number Diff line
@@ -2944,19 +2944,26 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root,
		return 0;
	}
	card = component->card;
	priv->entry = snd_info_create_subdir(codec_root->module,

	priv->entry = snd_info_create_module_entry(codec_root->module,
					     "wcd938x", codec_root);
	if (!priv->entry) {
		dev_dbg(component->dev, "%s: failed to create wcd938x entry\n",
			__func__);
		return -ENOMEM;
	}
	priv->entry->mode = S_IFDIR | 0555;
	if (snd_info_register(priv->entry) < 0) {
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}
	version_entry = snd_info_create_card_entry(card->snd_card,
						   "version",
						   priv->entry);
	if (!version_entry) {
		dev_dbg(component->dev, "%s: failed to create wcd938x version entry\n",
			__func__);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}

@@ -2967,6 +2974,7 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root,

	if (snd_info_register(version_entry) < 0) {
		snd_info_free_entry(version_entry);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}
	priv->version_entry = version_entry;
@@ -2977,6 +2985,8 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root,
	if (!variant_entry) {
		dev_dbg(component->dev, "%s: failed to create wcd938x variant entry\n",
			__func__);
		snd_info_free_entry(version_entry);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}

@@ -2987,6 +2997,8 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root,

	if (snd_info_register(variant_entry) < 0) {
		snd_info_free_entry(variant_entry);
		snd_info_free_entry(version_entry);
		snd_info_free_entry(priv->entry);
		return -ENOMEM;
	}
	priv->variant_entry = variant_entry;
+8 −1
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ int wsa881x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
	snprintf(name, sizeof(name), "%s.%x", "wsa881x",
		 (u32)wsa881x->swr_slave->addr);

	wsa881x->entry = snd_info_create_subdir(codec_root->module,
	wsa881x->entry = snd_info_create_module_entry(codec_root->module,
						(const char *)name,
						codec_root);
	if (!wsa881x->entry) {
@@ -351,6 +351,11 @@ int wsa881x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
			__func__);
		return -ENOMEM;
	}
	wsa881x->entry->mode = S_IFDIR | 0555;
	if (snd_info_register(wsa881x->entry) < 0) {
		snd_info_free_entry(wsa881x->entry);
		return -ENOMEM;
	}

	version_entry = snd_info_create_card_entry(card->snd_card,
						   "version",
@@ -358,6 +363,7 @@ int wsa881x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
	if (!version_entry) {
		dev_dbg(component->dev, "%s: failed to create wsa881x version entry\n",
			__func__);
		snd_info_free_entry(wsa881x->entry);
		return -ENOMEM;
	}

@@ -368,6 +374,7 @@ int wsa881x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,

	if (snd_info_register(version_entry) < 0) {
		snd_info_free_entry(version_entry);
		snd_info_free_entry(wsa881x->entry);
		return -ENOMEM;
	}
	wsa881x->version_entry = version_entry;
+8 −1
Original line number Diff line number Diff line
@@ -570,7 +570,7 @@ int wsa883x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
	snprintf(name, sizeof(name), "%s.%x", "wsa883x",
		 (u32)wsa883x->swr_slave->addr);

	wsa883x->entry = snd_info_create_subdir(codec_root->module,
	wsa883x->entry = snd_info_create_module_entry(codec_root->module,
						(const char *)name,
						codec_root);
	if (!wsa883x->entry) {
@@ -578,6 +578,11 @@ int wsa883x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
			__func__);
		return -ENOMEM;
	}
	wsa883x->entry->mode = S_IFDIR | 0555;
	if (snd_info_register(wsa883x->entry) < 0) {
		snd_info_free_entry(wsa883x->entry);
		return -ENOMEM;
	}

	version_entry = snd_info_create_card_entry(card->snd_card,
						   "version",
@@ -585,6 +590,7 @@ int wsa883x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
	if (!version_entry) {
		dev_dbg(component->dev, "%s: failed to create wsa883x version entry\n",
			__func__);
		snd_info_free_entry(wsa883x->entry);
		return -ENOMEM;
	}

@@ -595,6 +601,7 @@ int wsa883x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,

	if (snd_info_register(version_entry) < 0) {
		snd_info_free_entry(version_entry);
		snd_info_free_entry(wsa883x->entry);
		return -ENOMEM;
	}
	wsa883x->version_entry = version_entry;
+20 −3
Original line number Diff line number Diff line
@@ -5313,6 +5313,23 @@ static int msm_wcn_init_lito(struct snd_soc_pcm_runtime *rtd)
					   tx_ch, ARRAY_SIZE(rx_ch), rx_ch);
}

static struct snd_info_entry *msm_snd_info_create_subdir(struct module *mod,
				const char *name,
				struct snd_info_entry *parent)
{
	struct snd_info_entry *entry;

	entry = snd_info_create_module_entry(mod, name, parent);
	if (!entry)
		return NULL;
	entry->mode = S_IFDIR | 0555;
	if (snd_info_register(entry) < 0) {
		snd_info_free_entry(entry);
		return NULL;
	}
	return entry;
}

static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
{
	int ret = -EINVAL;
@@ -5407,7 +5424,7 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
	}
	card = rtd->card->snd_card;
	if (!pdata->codec_root) {
		entry = snd_info_create_subdir(card->module, "codecs",
		entry = msm_snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
		if (!entry) {
			pr_debug("%s: Cannot create codecs module entry\n",
@@ -7501,7 +7518,7 @@ static int msm_wsa881x_init(struct snd_soc_component *component)
	}
	pdata = snd_soc_card_get_drvdata(component->card);
	if (!pdata->codec_root) {
		entry = snd_info_create_subdir(card->module, "codecs",
		entry = msm_snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
		if (!entry) {
			pr_err("%s: Cannot create codecs module entry\n",
@@ -7539,7 +7556,7 @@ static int msm_aux_codec_init(struct snd_soc_component *component)

	pdata = snd_soc_card_get_drvdata(component->card);
	if (!pdata->codec_root) {
		entry = snd_info_create_subdir(card->module, "codecs",
		entry = msm_snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
		if (!entry) {
			dev_dbg(component->dev, "%s: Cannot create codecs module entry\n",