alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Takashi Iwai <tiwai@suse.de>,
	patches@opensource.wolfsonmicro.com, lrg@ti.com,
	lrg@slimlogic.co.uk
Subject: Re: [PATCH 1/2 v2] ALSA: Add snd_ctl_update() to dynamically update a control
Date: Tue, 15 Mar 2011 15:17:58 +0100	[thread overview]
Message-ID: <4D7F7516.7050009@ladisch.de> (raw)
In-Reply-To: <1300192269-20435-1-git-send-email-dp@opensource.wolfsonmicro.com>

Dimitris Papastamos wrote:
> Add a function to dynamically update a given control.  If the
> control does not already exist, a third parameter is used to determine
> whether to actually add that control.  This is useful in cases where
> downloadable firmware at runtime can add or update existing controls.

> + * Updates the control instance created via snd_ctl_new() or
> + * snd_ctl_new1() of the given card.

This description was copied from snd_ctl_add(), and the "created ..."
part isn't really useful here.

It should be mentioned that the old control is destroyed, because some
drivers store volatile state in the control's private_data/_value, or
keep a pointer to the control('s ID) to be able to call snd_ctl_notify()
for it later.

> + * Returns zero if successful, or a negative error code on failure.
> + *

superfluous empty line

> +int snd_ctl_update(struct snd_card *card, struct snd_kcontrol *kcontrol,
> +		   int add_on_update)

add_on_update should be bool

> +	up_write(&card->controls_rwsem);
> +	ret = snd_ctl_add(card, kcontrol);

Doing this outside the semaphore doesn't look good.

I wonder whether snd_ctl_add() is the right function to use, because it
will assign a different numid event if the control didn't change.

> A separate patch needs to be made to make ALSA Mixer cope with this.

What happens?


Regards,
Clemens

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 12:31 [PATCH 1/2 v2] ALSA: Add snd_ctl_update() to dynamically update a control Dimitris Papastamos
2011-03-15 12:31 ` [PATCH 2/2 v2] ASoC: soc-core: Add helper function to handle dynamic update of controls Dimitris Papastamos
2011-03-15 14:17 ` Clemens Ladisch [this message]
2011-03-15 14:25   ` [PATCH 1/2 v2] ALSA: Add snd_ctl_update() to dynamically update a control Takashi Iwai
2011-03-16  0:56     ` Raymond Yau
2011-03-16  7:01       ` Takashi Iwai
2011-03-15 16:27   ` Dimitris Papastamos
2011-03-16  8:05     ` Raymond Yau

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=4D7F7516.7050009@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=lrg@ti.com \
    --cc=patches@opensource.wolfsonmicro.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;
as well as URLs for NNTP newsgroup(s).