diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2017-08-23 21:46:15 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-08-24 03:15:14 -0400 |
commit | da4288287b68fe6902629f4e5306aba2a554bc4b (patch) | |
tree | 8f6e149b30f411ea5828cf4773c2b6b0aedfaeb8 /sound/core | |
parent | fb8027ebfd4b8a3050edba66805bc360ed9b3f11 (diff) |
ALSA: control: queue TLV event for a set of user-defined element
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/control.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index d6a8502da828..6ddffe85126f 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, | |||
1117 | { | 1117 | { |
1118 | struct user_element *ue = kctl->private_data; | 1118 | struct user_element *ue = kctl->private_data; |
1119 | unsigned int *container; | 1119 | unsigned int *container; |
1120 | struct snd_ctl_elem_id id; | ||
1121 | int i; | ||
1120 | int change; | 1122 | int change; |
1121 | 1123 | ||
1122 | if (size > 1024 * 128) /* sane value */ | 1124 | if (size > 1024 * 128) /* sane value */ |
@@ -1138,7 +1140,10 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, | |||
1138 | ue->tlv_data = container; | 1140 | ue->tlv_data = container; |
1139 | ue->tlv_data_size = size; | 1141 | ue->tlv_data_size = size; |
1140 | 1142 | ||
1141 | snd_ctl_notify(ue->card, SNDRV_CTL_EVENT_MASK_TLV, &kctl->id); | 1143 | for (i = 0; i < kctl->count; ++i) { |
1144 | snd_ctl_build_ioff(&id, kctl, i); | ||
1145 | snd_ctl_notify(ue->card, SNDRV_CTL_EVENT_MASK_TLV, &id); | ||
1146 | } | ||
1142 | 1147 | ||
1143 | return change; | 1148 | return change; |
1144 | } | 1149 | } |