All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Hui Wang <hui.wang@canonical.com>, tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-lib][PATCH 1/2] ucm: adding the folder of card_long_name when finding verb conf file
Date: Wed, 2 May 2018 08:43:37 +0200	[thread overview]
Message-ID: <f42b0f64-61b5-7eeb-adc9-3c5d07d68517@perex.cz> (raw)
In-Reply-To: <1525241286-16498-1-git-send-email-hui.wang@canonical.com>

Applied. Thanks.

Dne 2.5.2018 v 08:08 Hui Wang napsal(a):
> The board configuration file and verb conf file are allowed to be
> in the folder named of card_long_name, so when finding the verb conf
> file, we need to check if it is in the folder of card_long_name or
> card_name.
> 
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
>  src/ucm/parser.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ucm/parser.c b/src/ucm/parser.c
> index 2d76152..219edb9 100644
> --- a/src/ucm/parser.c
> +++ b/src/ucm/parser.c
> @@ -1056,6 +1056,7 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
>  	char filename[MAX_FILE];
>  	char *env = getenv(ALSA_CONFIG_UCM_VAR);
>  	int err;
> +	char *folder_name;
>  
>  	/* allocate verb */
>  	verb = calloc(1, sizeof(struct use_case_verb));
> @@ -1082,12 +1083,17 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
>  	}
>  
>  	/* open Verb file for reading */
> +	if (!strncmp(uc_mgr->conf_file_name, uc_mgr->card_long_name, MAX_CARD_LONG_NAME))
> +		folder_name = uc_mgr->card_long_name;
> +	else
> +		folder_name = uc_mgr->card_name;
> +
>  	if (env)
>  		snprintf(filename, sizeof(filename), "%s/%s/%s",
> -			 env, uc_mgr->card_name, file);
> +			 env, folder_name, file);
>  	else
>  		snprintf(filename, sizeof(filename), "%s/ucm/%s/%s",
> -			 snd_config_topdir(), uc_mgr->card_name, file);
> +			 snd_config_topdir(), folder_name, file);
>  	filename[sizeof(filename)-1] = '\0';
>  	
>  	err = uc_mgr_config_load(filename, &cfg);
> 


-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

      parent reply	other threads:[~2018-05-02  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  6:08 [alsa-lib][PATCH 1/2] ucm: adding the folder of card_long_name when finding verb conf file Hui Wang
2018-05-02  6:08 ` [alsa-lib][PATCH 2/2] conf/ucm: increase the input volume for LineIn Hui Wang
2018-05-02  6:44   ` Jaroslav Kysela
2018-05-02  6:43 ` Jaroslav Kysela [this message]

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=f42b0f64-61b5-7eeb-adc9-3c5d07d68517@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=hui.wang@canonical.com \
    --cc=tiwai@suse.de \
    /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.