diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-01-16 12:15:22 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-09 09:56:19 -0400 |
commit | f5b1db634280ecaf3147ee996f26aad0ed4828c4 (patch) | |
tree | ce7ba0940e5dd3f106276d9119f7e7e3a3b0c7e6 /include/sound | |
parent | fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc (diff) |
ALSA: add snd_ctl_add_slave_uncached()
Added snd_ctl_add_slave_uncached() function to add a slave element
with volatile controls. The values of normal slave elements are
supposed to be cachable, i.e. they are changed only via the put
callbacks. OTOH, when a slave element is volatile and its values may
be changed by other reason (e.g. hardware status change), the values
will get inconsistent.
The new function allows the slave elements with volatile changes.
When the slave is tied with this call, the native get callback is
issued at each time so that the values are always updated.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/control.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/sound/control.h b/include/sound/control.h index 4721b4bba053..4cf8f7aaa13f 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -171,6 +171,22 @@ int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, | |||
171 | */ | 171 | */ |
172 | struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, | 172 | struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, |
173 | const unsigned int *tlv); | 173 | const unsigned int *tlv); |
174 | int snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave); | 174 | int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, |
175 | 175 | unsigned int flags); | |
176 | /* optional flags for slave */ | ||
177 | #define SND_CTL_SLAVE_NEED_UPDATE (1 << 0) | ||
178 | |||
179 | static inline int | ||
180 | snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) | ||
181 | { | ||
182 | return _snd_ctl_add_slave(master, slave, 0); | ||
183 | } | ||
184 | |||
185 | static inline int | ||
186 | snd_ctl_add_slave_uncached(struct snd_kcontrol *master, | ||
187 | struct snd_kcontrol *slave) | ||
188 | { | ||
189 | return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE); | ||
190 | } | ||
191 | |||
176 | #endif /* __SOUND_CONTROL_H */ | 192 | #endif /* __SOUND_CONTROL_H */ |