Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Guanqun <guanqun.lu@intel.com>
To: Takashi Iwai <tiwai@suse.de>, ALSA <alsa-devel@alsa-project.org>,
	Liam Girdwood <lrg@ti.com>
Subject: [PATCH v2] ucm: add another sequence 'msleep'
Date: Mon, 22 Aug 2011 13:35:32 +0800	[thread overview]
Message-ID: <20110822053532.7740.34323.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110822012544.5379.75207.stgit@localhost6.localdomain6>

Thus, we have two sleep statements:
    msleep <milliseconds>
    usleep <microseconds>

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 src/ucm/parser.c    |   11 +++++++++++
 src/ucm/ucm_local.h |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/ucm/parser.c b/src/ucm/parser.c
index 23b67bc..b93d832 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 0522bf5..03d3ace 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;

  reply	other threads:[~2011-08-22  5:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19  7:22 [PATCH] ucm: change msleep to usleep Lu Guanqun
2011-08-19  7:40 ` Takashi Iwai
2011-08-19  8:13   ` Lu Guanqun
2011-08-19  8:21     ` Takashi Iwai
2011-08-19 16:12   ` Liam Girdwood
2011-08-22  1:25     ` [PATCH] ucm: add another sequence 'msleep' Lu Guanqun
2011-08-22  5:35       ` Lu Guanqun [this message]
2011-08-22 10:39         ` [PATCH v2] " Liam Girdwood
2011-08-22 10:42           ` Takashi Iwai

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=20110822053532.7740.34323.stgit@localhost6.localdomain6 \
    --to=guanqun.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox