From patchwork Mon Apr 16 18:26:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10343683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1624C60216 for ; Mon, 16 Apr 2018 18:26:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0734127FB3 for ; Mon, 16 Apr 2018 18:26:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F02712886F; Mon, 16 Apr 2018 18:26:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38F8227FB3 for ; Mon, 16 Apr 2018 18:26:55 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1D3C32675F4; Mon, 16 Apr 2018 20:26:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 05370267621; Mon, 16 Apr 2018 20:26:39 +0200 (CEST) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by alsa0.perex.cz (Postfix) with ESMTP id 0026C267611 for ; Mon, 16 Apr 2018 20:26:36 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id l49so28665365wrl.4 for ; Mon, 16 Apr 2018 11:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ndZlcNQ8xHYXAYJaLzXbCalzPXfJoQ1/AgsLq+AwqEQ=; b=srFVHCT1WqY+ENFcGaS5TvLKtoOzJiCU43uilr3OY8dO3NMQ3bUeQC6m752Pl+UGNY k2UtfBaicGFLtfIC7GS35CkJQVMpUenqKDHLfe06amQt14/S2Ueb5yFKbgxG0bWFQ7/u eoCuUfNpAeBpt4D+B5MU2Vbj7JbIEnN8UHgvLM7xei3Ju3uNbn+cJ2WTTl54wjFxI3ox UoJHpGhsZ2vt21kDfIKRvlCk7BAyUuenyqDWP9vtjXP8wqVSfcSZJHsDsS9q4duKkaXk jD5ZKJ73qusq+IeQ9A90W9PbC5s8i0cAeO+lC3TaJwZq0eO3BtKfJ1bkb9LuhZ+DV5N2 nclA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ndZlcNQ8xHYXAYJaLzXbCalzPXfJoQ1/AgsLq+AwqEQ=; b=ej81llSAFPr5G5gV3pcuupxBlkPZfuDTbQyhqPe+TgTxiXZdmq149t6+rM9MK4aFHz 3PnaHO8d2lnLhOHTCjsVAVLAnyZYjQzYbaJ9coqaQ4IGz1ETIsMWxfGZB9ZPbwfcdXYY uRYSCyY4n4IhdjDV0n7VcCzTwdulybmVfrjsPQxnTajE1R3jGDNJb2ewefTzoE+tWBAA H/LQE6NO4tiry3LHxECb4Rs2PR1o9jvyTNqdr6+Own31Di1FwmuSRJYNq0gUCxJCK0uV R4yWtU0mUcdPZZcuZISN1yFjMjVUjR9962TD35QC35K+Xox+YipqaqOgxmOwgiCb2Xxz WD+Q== X-Gm-Message-State: ALQs6tBVfxY/Epi7ELvSgNjblk3kok4KLluArmrYgX18VpvW8csDeks6 ufZxTwX81z8zaRyuRsoaJYQ= X-Google-Smtp-Source: AIpwx48ttrfDMME/4JK2fhKeeJq9VEVBzqhoxJRnxNqwUNTpp0ZhSljAGeeOxijK53zMUedg2uBaXA== X-Received: by 10.28.232.202 with SMTP id f71mr12186039wmi.136.1523903196641; Mon, 16 Apr 2018 11:26:36 -0700 (PDT) Received: from gentoo0.localdomain (x4e33bf85.dyn.telefonica.de. [78.51.191.133]) by smtp.gmail.com with ESMTPSA id f84sm10819060wmh.44.2018.04.16.11.26.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 11:26:36 -0700 (PDT) From: Kirill Marinushkin To: Takashi Iwai Date: Mon, 16 Apr 2018 20:26:41 +0200 Message-Id: <20180416182641.30312-5-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180416182641.30312-1-k.marinushkin@gmail.com> References: <20180416182641.30312-1-k.marinushkin@gmail.com> Cc: alsa-devel@alsa-project.org, Pan Xiuli , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Kirill Marinushkin Subject: [alsa-devel] [PATCH alsa-lib v4 4/4] ASoC: topology: Add alias conf parameter names for hw_configs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Pierre-Louis Bossart Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Mark Brown Cc: Pan Xiuli Cc: Liam Girdwood 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;