All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Marinushkin <k.marinushkin@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Pan Xiuli <xiuli.pan@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Kirill Marinushkin <k.marinushkin@gmail.com>
Subject: [PATCH alsa-lib v4 4/4] ASoC: topology: Add alias conf parameter names for hw_configs
Date: Mon, 16 Apr 2018 20:26:41 +0200	[thread overview]
Message-ID: <20180416182641.30312-5-k.marinushkin@gmail.com> (raw)
In-Reply-To: <20180416182641.30312-1-k.marinushkin@gmail.com>

Currently, some parameter names in conf differ from field names in struct.
These look like typos.

This commit suggests to add aliases for such parameters, so that the names
in conf are similar to names in struct. This solution is backwards
compatible.

If the difference between conf names and struct names is done on purpose -
this commit can be dropped.

Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Pan Xiuli <xiuli.pan@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: alsa-devel@alsa-project.org
---
 src/topology/pcm.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 2ce1651b..8ebfafd8 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -1126,7 +1126,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "format") == 0) {
+		if (strcmp(id, "format") == 0 ||
+		    strcmp(id, "fmt") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1137,7 +1138,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "bclk") == 0) {
+		if (strcmp(id, "bclk") == 0 ||
+		    strcmp(id, "bclk_master") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1157,7 +1159,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "bclk_freq") == 0) {
+		if (strcmp(id, "bclk_freq") == 0 ||
+		    strcmp(id, "bclk_rate") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1165,7 +1168,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "bclk_invert") == 0) {
+		if (strcmp(id, "bclk_invert") == 0 ||
+		    strcmp(id, "invert_bclk") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1174,7 +1178,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "fsync") == 0) {
+		if (strcmp(id, "fsync") == 0 ||
+		    strcmp(id, "fsync_master") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1194,7 +1199,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "fsync_invert") == 0) {
+		if (strcmp(id, "fsync_invert") == 0 ||
+		    strcmp(id, "invert_fsync") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1203,7 +1209,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "fsync_freq") == 0) {
+		if (strcmp(id, "fsync_freq") == 0 ||
+		    strcmp(id, "fsync_rate") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1211,7 +1218,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "mclk_freq") == 0) {
+		if (strcmp(id, "mclk_freq") == 0 ||
+		    strcmp(id, "mclk_rate") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1219,7 +1227,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "mclk") == 0) {
+		if (strcmp(id, "mclk") == 0 ||
+		    strcmp(id, "mclk_direction") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
@@ -1239,7 +1248,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "pm_gate_clocks") == 0) {
+		if (strcmp(id, "pm_gate_clocks") == 0 ||
+		    strcmp(id, "clock_gated") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
 
-- 
2.13.6

  parent reply	other threads:[~2018-04-16 18:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 18:26 [PATCH alsa-lib v4 0/4] alsa-lib: ASoC: topology: Improve hw_configs Kirill Marinushkin
2018-04-16 18:26 ` [PATCH alsa-lib v4 1/4] ASoC: topology: Fix bclk and fsync inversion in set_link_hw_format() Kirill Marinushkin
2018-04-16 18:26 ` [PATCH alsa-lib v4 2/4] ASoC: topology: Add missing clock gating parameter when parsing hw_configs Kirill Marinushkin
2018-04-16 18:26   ` Kirill Marinushkin
2018-04-16 18:26 ` [PATCH alsa-lib v4 3/4] ASoC: topology: Add definitions for mclk_direction values Kirill Marinushkin
2018-04-16 18:26 ` Kirill Marinushkin [this message]
2018-04-20  7:29 ` [PATCH alsa-lib v4 0/4] alsa-lib: ASoC: topology: Improve hw_configs Takashi Iwai
2018-04-20 11:45   ` Mark Brown
2018-04-20 17:29   ` Kirill Marinushkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180416182641.30312-5-k.marinushkin@gmail.com \
    --to=k.marinushkin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=xiuli.pan@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.