Skip to content

Commit 1391200

Browse files
ranj063kv2019i
authored andcommitted
plugin: alsaplug: Modify the signature of plug_parse_conf()
In preparation for parsing just the topology file from the command line for kcontrols, modify the signature of plug_parse_conf() to add an argument to specify it. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 119af89 commit 1391200

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

tools/plugin/alsaplug/pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(sof)
10121012
pcm->capture = 1;
10131013

10141014
/* parse the ALSA configuration file for sof plugin */
1015-
err = plug_parse_conf(plug, name, root, conf);
1015+
err = plug_parse_conf(plug, name, root, conf, false);
10161016
if (err < 0) {
10171017
SNDERR("failed to parse config: %s", strerror(err));
10181018
goto parse_conf_err;

tools/plugin/alsaplug/plugin.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static int parse_slave_configs(snd_sof_plug_t *plug, snd_config_t *n)
297297
* Parse the client cmdline. Format is
298298
* tplg:pcm:card:dev:config[dai_pipe:card:dev:config]...]
299299
*/
300-
static int parse_client_cmdline(snd_sof_plug_t *plug, char *cmdline)
300+
static int parse_client_cmdline(snd_sof_plug_t *plug, char *cmdline, bool just_tplg)
301301
{
302302
struct plug_cmdline_item *cmd_item;
303303
char *tplg, *next, *card, *dev, *config, *pcm;
@@ -328,6 +328,9 @@ static int parse_client_cmdline(snd_sof_plug_t *plug, char *cmdline)
328328
if (!plug->tplg_file)
329329
return -ENOMEM;
330330

331+
if (just_tplg)
332+
return 0;
333+
331334
/* get PCM ID */
332335
pcm = strtok_r(next, ":", &next);
333336
if (!pcm) {
@@ -393,7 +396,7 @@ static int parse_client_cmdline(snd_sof_plug_t *plug, char *cmdline)
393396
* TODO: contruct sof pipe cmd line.
394397
*/
395398
int plug_parse_conf(snd_sof_plug_t *plug, const char *name, snd_config_t *root,
396-
snd_config_t *conf)
399+
snd_config_t *conf, bool just_tplg)
397400
{
398401
snd_config_iterator_t i, next;
399402
const char *tplg = NULL;
@@ -443,7 +446,7 @@ int plug_parse_conf(snd_sof_plug_t *plug, const char *name, snd_config_t *root,
443446
}
444447

445448
/* parse the client command line */
446-
if (parse_client_cmdline(plug, (char *)tplg)) {
449+
if (parse_client_cmdline(plug, (char *)tplg, just_tplg)) {
447450
SNDERR("invalid sof cmd line");
448451
return -EINVAL;
449452
}

tools/plugin/alsaplug/plugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int sofplug_load_hook(snd_config_t *root, snd_config_t *config,
5757
snd_config_t **dst, snd_config_t *private_data);
5858

5959
int plug_parse_conf(snd_sof_plug_t *plug, const char *name,
60-
snd_config_t *root, snd_config_t *conf);
60+
snd_config_t *root, snd_config_t *conf, bool just_tplg);
6161
int plug_parse_topology(snd_sof_plug_t *plug);
6262
int plug_set_up_pipelines(snd_sof_plug_t *plug, int dir);
6363
int plug_free_pipelines(snd_sof_plug_t *plug, struct tplg_pipeline_list *pipeline_list, int dir);

0 commit comments

Comments
 (0)