summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@intel.com>2011-08-22 13:35:32 +0800
committerTakashi Iwai <tiwai@suse.de>2011-08-22 12:42:09 +0200
commit26e80c2e32bd3a088b56a6ea4e30d5b8ccce9112 (patch)
treeef211bb295df9e15d3c4fb68c66fc8fb7f9235c3
parenta97aa7f065ed4a7fc1879921a58c40954dc34316 (diff)
downloadalsa-lib-26e80c2e32bd3a088b56a6ea4e30d5b8ccce9112.tar.gz
ucm: add another sequence 'msleep'
Thus, we have two sleep statements: msleep <milliseconds> usleep <microseconds> Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/ucm/parser.c11
-rw-r--r--src/ucm/ucm_local.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ucm/parser.c b/src/ucm/parser.c
index 23b67bcc..b93d8325 100644
--- a/src/ucm/parser.c
+++ b/src/ucm/parser.c
@@ -316,6 +316,17 @@ static int parse_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED,
continue;
}
+ if (strcmp(cmd, "msleep") == 0) {
+ curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP;
+ err = snd_config_get_integer(n, &curr->data.sleep);
+ if (err < 0) {
+ uc_error("error: msleep requires integer!");
+ return err;
+ }
+ curr->data.sleep *= 1000L;
+ continue;
+ }
+
if (strcmp(cmd, "exec") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_EXEC;
err = parse_string(n, &curr->data.exec);
diff --git a/src/ucm/ucm_local.h b/src/ucm/ucm_local.h
index 0522bf55..03d3ace1 100644
--- a/src/ucm/ucm_local.h
+++ b/src/ucm/ucm_local.h
@@ -57,7 +57,7 @@ struct sequence_element {
struct list_head list;
unsigned int type;
union {
- long sleep; /* Sleep time in msecs if sleep element, else 0 */
+ long sleep; /* Sleep time in microseconds if sleep element, else 0 */
char *cdev;
char *cset;
char *exec;