Commit 0ee46c9d authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds

[ALSA] opl3 - Fix compilation without sequencer support

Add proper ifdef's to the patch loading code moved from the old instr
layer so that opl3 driver can be compiled without the sequencer support.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2c020a99
...@@ -370,12 +370,13 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device, ...@@ -370,12 +370,13 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device,
int snd_opl3_open(struct snd_hwdep * hw, struct file *file); int snd_opl3_open(struct snd_hwdep * hw, struct file *file);
int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file, int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
loff_t *offset);
int snd_opl3_release(struct snd_hwdep * hw, struct file *file); int snd_opl3_release(struct snd_hwdep * hw, struct file *file);
void snd_opl3_reset(struct snd_opl3 * opl3); void snd_opl3_reset(struct snd_opl3 * opl3);
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
loff_t *offset);
int snd_opl3_load_patch(struct snd_opl3 *opl3, int snd_opl3_load_patch(struct snd_opl3 *opl3,
int prog, int bank, int type, int prog, int bank, int type,
const char *name, const char *name,
...@@ -384,5 +385,9 @@ int snd_opl3_load_patch(struct snd_opl3 *opl3, ...@@ -384,5 +385,9 @@ int snd_opl3_load_patch(struct snd_opl3 *opl3,
struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank, struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
int create_patch); int create_patch);
void snd_opl3_clear_patches(struct snd_opl3 *opl3); void snd_opl3_clear_patches(struct snd_opl3 *opl3);
#else
#define snd_opl3_write NULL
static inline void snd_opl3_clear_patches(struct snd_opl3 *opl3) {}
#endif
#endif /* __SOUND_OPL3_H */ #endif /* __SOUND_OPL3_H */
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#include <sound/opl3.h> #include <sound/opl3.h>
#include <sound/asound_fm.h> #include <sound/asound_fm.h>
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
#define OPL3_SUPPORT_SYNTH
#endif
/* /*
* There is 18 possible 2 OP voices * There is 18 possible 2 OP voices
* (9 in the left and 9 in the right). * (9 in the left and 9 in the right).
...@@ -155,9 +159,11 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file, ...@@ -155,9 +159,11 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
#endif #endif
return snd_opl3_set_connection(opl3, (int) arg); return snd_opl3_set_connection(opl3, (int) arg);
#ifdef OPL3_SUPPORT_SYNTH
case SNDRV_DM_FM_IOCTL_CLEAR_PATCHES: case SNDRV_DM_FM_IOCTL_CLEAR_PATCHES:
snd_opl3_clear_patches(opl3); snd_opl3_clear_patches(opl3);
return 0; return 0;
#endif
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
default: default:
...@@ -178,6 +184,7 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file) ...@@ -178,6 +184,7 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
return 0; return 0;
} }
#ifdef OPL3_SUPPORT_SYNTH
/* /*
* write the device - load patches * write the device - load patches
*/ */
...@@ -341,6 +348,7 @@ void snd_opl3_clear_patches(struct snd_opl3 *opl3) ...@@ -341,6 +348,7 @@ void snd_opl3_clear_patches(struct snd_opl3 *opl3)
} }
memset(opl3->patch_table, 0, sizeof(opl3->patch_table)); memset(opl3->patch_table, 0, sizeof(opl3->patch_table));
} }
#endif /* OPL3_SUPPORT_SYNTH */
/* ------------------------------ */ /* ------------------------------ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment