All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org, clemens@ladisch.de, fulup.arfoll@iot.bzh
Subject: [RFC][PATCH 2/3] ALSA: control: queue TLV event for all of elements in an user-defined set
Date: Tue, 22 Aug 2017 08:42:21 +0900	[thread overview]
Message-ID: <20170821234222.25556-3-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20170821234222.25556-1-o-takashi@sakamocchi.jp>

In a design of user-defined element set, applications allow to change TLV
data on the set. This operation doesn't only affects to a target element,
but also to elements in the set.

This commit generates TLV event for all of elements in the set when the TLV
data is changed.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/core/control.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/core/control.c b/sound/core/control.c
index bbcf4833ad1c..b8d2fa465a9d 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1117,6 +1117,8 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
 {
 	struct user_element *ue = kctl->private_data;
 	unsigned int *container;
+	struct snd_ctl_elem_id id;
+	int i;
 	int change;
 
 	if (size > 1024 * 128)	/* sane value */
@@ -1138,7 +1140,10 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
 	ue->tlv_data = container;
 	ue->tlv_data_size = size;
 
-	snd_ctl_notify(ue->card, SNDRV_CTL_EVENT_MASK_TLV, &kctl->id);
+	for (i = 0; i < kctl->count; ++i) {
+		snd_ctl_build_ioff(&id, kctl, i);
+		snd_ctl_notify(ue->card, SNDRV_CTL_EVENT_MASK_TLV, &id);
+	}
 
 	return change;
 }
-- 
2.11.0

  parent reply	other threads:[~2017-08-21 23:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 23:42 [RFC][PATCH 0/3] ALSA: control: delegate TLV eventing to each driver Takashi Sakamoto
2017-08-21 23:42 ` [RFC][PATCH 1/3] " Takashi Sakamoto
2017-08-21 23:42 ` Takashi Sakamoto [this message]
2017-08-21 23:42 ` [RFC][PATCH 3/3] ALSA: control: disable TLV data at initial state of user-defined element set Takashi Sakamoto
2017-08-22  6:27 ` [RFC][PATCH 0/3] ALSA: control: delegate TLV eventing to each driver Takashi Iwai
2017-08-24  1:50   ` Takashi Sakamoto

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=20170821234222.25556-3-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=fulup.arfoll@iot.bzh \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.