summaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-06-09 08:06:46 -0400
committerTakashi Iwai <tiwai@suse.de>2017-06-09 16:09:45 -0400
commit3d774d5ef066971aee1839150bf47d100d8e43d3 (patch)
treebd345c2cb848ad3b47ea1f5734d86974f10f64f7 /sound/drivers/opl3
parenteb3b705aaed9cab7efef8c905eda919b5fd902b9 (diff)
ALSA: seq: Allow the tristate build of OSS emulation
Currently OSS sequencer emulation is tied with ALSA sequencer core, both are built in the same level; i.e. when CONFIG_SND_SEQUENCER=y, the OSS sequencer emulation is also always built-in, even though the functionality can be built as an individual module. This patch changes the rule and allows users to build snd-seq-oss module while others are built-in. Essentially, it's just a few simple changes in Kconfig and Makefile. Some driver codes like opl3 need to convert from the simple ifdef to IS_ENABLED(). But that's all. You might wonder how about the dependency: right, it can be messy, but it still works. Since we rewrote the sequencer binding with the standard bus, the driver can be bound at any time on demand. So, the synthesizer driver module can be loaded individually from the OSS emulation core before/after it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/opl3')
-rw-r--r--sound/drivers/opl3/opl3_seq.c4
-rw-r--r--sound/drivers/opl3/opl3_voice.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index fdae5d7f421f..d3e91be8b23a 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -252,7 +252,7 @@ static int snd_opl3_seq_probe(struct device *_dev)
252 spin_lock_init(&opl3->sys_timer_lock); 252 spin_lock_init(&opl3->sys_timer_lock);
253 opl3->sys_timer_status = 0; 253 opl3->sys_timer_status = 0;
254 254
255#ifdef CONFIG_SND_SEQUENCER_OSS 255#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
256 snd_opl3_init_seq_oss(opl3, name); 256 snd_opl3_init_seq_oss(opl3, name);
257#endif 257#endif
258 return 0; 258 return 0;
@@ -267,7 +267,7 @@ static int snd_opl3_seq_remove(struct device *_dev)
267 if (opl3 == NULL) 267 if (opl3 == NULL)
268 return -EINVAL; 268 return -EINVAL;
269 269
270#ifdef CONFIG_SND_SEQUENCER_OSS 270#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
271 snd_opl3_free_seq_oss(opl3); 271 snd_opl3_free_seq_oss(opl3);
272#endif 272#endif
273 if (opl3->seq_client >= 0) { 273 if (opl3->seq_client >= 0) {
diff --git a/sound/drivers/opl3/opl3_voice.h b/sound/drivers/opl3/opl3_voice.h
index a371c075ac87..eaef435e0528 100644
--- a/sound/drivers/opl3/opl3_voice.h
+++ b/sound/drivers/opl3/opl3_voice.h
@@ -44,9 +44,12 @@ void snd_opl3_load_drums(struct snd_opl3 *opl3);
44void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan); 44void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
45 45
46/* Prototypes for opl3_oss.c */ 46/* Prototypes for opl3_oss.c */
47#ifdef CONFIG_SND_SEQUENCER_OSS 47#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
48void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name); 48void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name);
49void snd_opl3_free_seq_oss(struct snd_opl3 *opl3); 49void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);
50#else
51#define snd_opl3_init_seq_oss(opl3, name) /* NOP */
52#define snd_opl3_free_seq_oss(opl3) /* NOP */
50#endif 53#endif
51 54
52#endif 55#endif