alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Margarita Olaya <magi@slimlogic.co.uk>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH] alsa-lib: ucm: allow values to be read from devices
Date: Tue, 15 Mar 2011 10:45:19 -0600	[thread overview]
Message-ID: <AANLkTikd29BONAW9Zqwrb=tKN1iSVcsig+6Egi1001WD@mail.gmail.com> (raw)

This allows devices value to be read using the get_value().
Also fix a little formatting.

Signed-off-by: Margarita Olaya Cabrera <magi@slimlogic.co.uk>
---
 src/ucm/main.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/ucm/main.c b/src/ucm/main.c
index 42fd373..fb11e61 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -1063,20 +1063,27 @@ static int get_value3(const char **value,
  * \return Zero on success (value is filled), otherwise a negative error code
  */
 static int get_value(snd_use_case_mgr_t *uc_mgr,
-                     const char *identifier,
-                     const char **value,
-                     const char *modifier)
+			const char *identifier,
+			const char **value,
+			const char *item)
 {
-        struct use_case_modifier *mod;
+	struct use_case_modifier *mod;
+	struct use_case_device *dev;
 	int err;

-	if (modifier != NULL) {
-	        mod = find_modifier(uc_mgr, modifier);
+	if (item != NULL) {
+		mod = find_modifier(uc_mgr, item);
 		if (mod != NULL) {
 			err = get_value1(value, &mod->value_list, identifier);
 			if (err >= 0 || err != -ENOENT)
 				return err;
 		}
+		dev = find_device(uc_mgr->active_verb, item);
+		if (dev != NULL) {
+			err = get_value1(value, &dev->value_list, identifier);
+			if (err >=0 || err != -ENOENT)
+				return err;
+		}
 	}
 	err = get_value1(value, &uc_mgr->active_verb->value_list, identifier);
 	if (err >= 0 || err != -ENOENT)
-- 
1.7.0.4

             reply	other threads:[~2011-03-15 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 16:45 Margarita Olaya [this message]
2011-03-16 22:27 ` [PATCH] alsa-lib: ucm: allow values to be read from devices Liam Girdwood
2011-03-18 15:36   ` Margarita Olaya
2011-03-18 15:44 ` Takashi Iwai
2011-03-18 16:19   ` Margarita Olaya

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='AANLkTikd29BONAW9Zqwrb=tKN1iSVcsig+6Egi1001WD@mail.gmail.com' \
    --to=magi@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    /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;
as well as URLs for NNTP newsgroup(s).