ucm: add _fboot / FixedBootSequence

Actually, the BootSequence is executed only when the driver controls
(identifiers or value types) are changed. It may be handy to have
also a sequence which is executed at _each_ boot without any condition.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-03-05 18:50:02 +01:00
parent 266618088a
commit 9c194a0ba7
5 changed files with 59 additions and 1 deletions

View file

@ -1739,6 +1739,26 @@ __error:
return err;
}
/*
* parse controls which should be run only at initial boot (forcefully)
*/
static int parse_controls_fixedboot(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
{
int err;
if (!list_empty(&uc_mgr->fixedboot_list)) {
uc_error("FixedBoot list is not empty");
return -EINVAL;
}
err = parse_sequence(uc_mgr, &uc_mgr->fixedboot_list, cfg);
if (err < 0) {
uc_error("Unable to parse FixedBootSequence");
return err;
}
return 0;
}
/*
* parse controls which should be run only at initial boot
*/
@ -1891,6 +1911,14 @@ static int parse_master_file(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
continue;
}
/* find default control values section (force boot sequence only) */
if (strcmp(id, "FixedBootSequence") == 0) {
err = parse_controls_fixedboot(uc_mgr, n);
if (err < 0)
return err;
continue;
}
/* find default control values section (first boot only) */
if (strcmp(id, "BootSequence") == 0) {
err = parse_controls_boot(uc_mgr, n);