Skip to content

Commit e922b00

Browse files
committed
[ALSA] Move vmaster code to sound core
Move the codes for virtual master controls to sound core part so that not only hda-intel drivers can use it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 4235a31 commit e922b00

6 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎include/sound/control.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,11 @@ int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
169169
int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
170170
struct snd_ctl_elem_info *uinfo);
171171

172+
/*
173+
* virtual master control
174+
*/
175+
struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
176+
const unsigned int *tlv);
177+
int snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave);
178+
172179
#endif /* __SOUND_CONTROL_H */

‎sound/core/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,7 @@ config SND_PCM_XRUN_DEBUG
181181
It is usually not required, but if you have trouble with
182182
sound clicking when system is loaded, it may help to determine
183183
the process or driver which causes the scheduling gaps.
184+
185+
config SND_VMASTER
186+
bool
187+
depends on SND

‎sound/core/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
snd-y := sound.o init.o memory.o info.o control.o misc.o device.o
77
snd-$(CONFIG_ISA_DMA_API) += isadma.o
88
snd-$(CONFIG_SND_OSSEMUL) += sound_oss.o info_oss.o
9+
snd-$(CONFIG_SND_VMASTER) += vmaster.o
910

1011
snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
1112
pcm_memory.o
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ int snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave)
253253
return 0;
254254
}
255255

256+
EXPORT_SYMBOL(snd_ctl_add_slave);
257+
256258
/*
257259
* ctl callbacks for master controls
258260
*/
@@ -362,3 +364,5 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
362364
}
363365
return kctl;
364366
}
367+
368+
EXPORT_SYMBOL(snd_ctl_make_virtual_master);

‎sound/pci/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ config SND_HDA_INTEL
517517
tristate "Intel HD Audio"
518518
depends on SND
519519
select SND_PCM
520+
select SND_VMASTER
520521
help
521522
Say Y here to include support for Intel "High Definition
522523
Audio" (Azalia) motherboard devices.

‎sound/pci/hda/hda_local.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,4 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
418418
hda_nid_t nid);
419419
#endif /* CONFIG_SND_HDA_POWER_SAVE */
420420

421-
/*
422-
* virtual master control
423-
*/
424-
struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
425-
const unsigned int *tlv);
426-
int snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave);
427-
428421
#endif /* __SOUND_HDA_LOCAL_H */

0 commit comments

Comments
 (0)