Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d774d5e authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent eb3b705a
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -25,9 +25,7 @@
#include <sound/seq_device.h>
#include <sound/seq_device.h>
#include <sound/soundfont.h>
#include <sound/soundfont.h>
#include <sound/seq_midi_emul.h>
#include <sound/seq_midi_emul.h>
#ifdef CONFIG_SND_SEQUENCER_OSS
#include <sound/seq_oss.h>
#include <sound/seq_oss.h>
#endif
#include <sound/emux_legacy.h>
#include <sound/emux_legacy.h>
#include <sound/seq_virmidi.h>
#include <sound/seq_virmidi.h>


@@ -66,7 +64,7 @@ struct snd_emux_operators {
		       const void __user *data, long count);
		       const void __user *data, long count);
	void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
	void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
		      struct snd_midi_channel_set *chset);
		      struct snd_midi_channel_set *chset);
#ifdef CONFIG_SND_SEQUENCER_OSS
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
	int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
	int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
#endif
#endif
};
};
@@ -129,7 +127,7 @@ struct snd_emux {
	struct snd_info_entry *proc;
	struct snd_info_entry *proc;
#endif
#endif


#ifdef CONFIG_SND_SEQUENCER_OSS
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
	struct snd_seq_device *oss_synth;
	struct snd_seq_device *oss_synth;
#endif
#endif
};
};
@@ -150,7 +148,7 @@ struct snd_emux_port {
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
	struct snd_emux_effect_table *effect;
	struct snd_emux_effect_table *effect;
#endif
#endif
#ifdef CONFIG_SND_SEQUENCER_OSS
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
	struct snd_seq_oss_arg *oss_arg;
	struct snd_seq_oss_arg *oss_arg;
#endif
#endif
};
};
+1 −3
Original line number Original line Diff line number Diff line
@@ -55,10 +55,8 @@
#include <sound/hwdep.h>
#include <sound/hwdep.h>
#include <sound/timer.h>
#include <sound/timer.h>
#include <sound/seq_midi_emul.h>
#include <sound/seq_midi_emul.h>
#ifdef CONFIG_SND_SEQUENCER_OSS
#include <sound/seq_oss.h>
#include <sound/seq_oss.h>
#include <sound/seq_oss_legacy.h>
#include <sound/seq_oss_legacy.h>
#endif
#include <sound/seq_device.h>
#include <sound/seq_device.h>
#include <sound/asound_fm.h>
#include <sound/asound_fm.h>


@@ -330,7 +328,7 @@ struct snd_opl3 {
	struct snd_seq_device *seq_dev;	/* sequencer device */
	struct snd_seq_device *seq_dev;	/* sequencer device */
	struct snd_midi_channel_set * chset;
	struct snd_midi_channel_set * chset;


#ifdef CONFIG_SND_SEQUENCER_OSS
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
	struct snd_seq_device *oss_seq_dev;	/* OSS sequencer device */
	struct snd_seq_device *oss_seq_dev;	/* OSS sequencer device */
	struct snd_midi_channel_set * oss_chset;
	struct snd_midi_channel_set * oss_chset;
#endif
#endif
+1 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ config SND_PCM_TIMER
	  footprint, about 20KB on x86_64 platform.
	  footprint, about 20KB on x86_64 platform.


config SND_SEQUENCER_OSS
config SND_SEQUENCER_OSS
	bool "OSS Sequencer API"
	tristate "OSS Sequencer API"
	depends on SND_SEQUENCER
	depends on SND_SEQUENCER
	depends on SND_OSSEMUL
	depends on SND_OSSEMUL
	help
	help
+3 −4
Original line number Original line Diff line number Diff line
@@ -15,10 +15,9 @@ snd-seq-dummy-objs := seq_dummy.o
snd-seq-virmidi-objs := seq_virmidi.o
snd-seq-virmidi-objs := seq_virmidi.o


obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o
obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o
ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
obj-$(CONFIG_SND_SEQUENCER_OSS) += snd-seq-midi-event.o
  obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o
obj-$(CONFIG_SND_SEQUENCER_OSS) += oss/
  obj-$(CONFIG_SND_SEQUENCER) += oss/

endif
obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o
obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o


# Toplevel Module Dependency
# Toplevel Module Dependency
+1 −1
Original line number Original line Diff line number Diff line
@@ -7,4 +7,4 @@ snd-seq-oss-objs := seq_oss.o seq_oss_init.o seq_oss_timer.o seq_oss_ioctl.o \
		     seq_oss_event.o seq_oss_rw.o seq_oss_synth.o \
		     seq_oss_event.o seq_oss_rw.o seq_oss_synth.o \
		     seq_oss_midi.o seq_oss_readq.o seq_oss_writeq.o
		     seq_oss_midi.o seq_oss_readq.o seq_oss_writeq.o


obj-$(CONFIG_SND_SEQUENCER) += snd-seq-oss.o
obj-$(CONFIG_SND_SEQUENCER_OSS) += snd-seq-oss.o
Loading