diff options
Diffstat (limited to 'sound/synth/emux/emux.c')
-rw-r--r-- | sound/synth/emux/emux.c | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index 9e2b4c0c8a8a..7c8e328fae62 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -35,9 +35,9 @@ MODULE_LICENSE("GPL"); /* * create a new hardware dependent device for Emu8000/Emu10k1 */ -int snd_emux_new(snd_emux_t **remu) +int snd_emux_new(struct snd_emux **remu) { - snd_emux_t *emu; + struct snd_emux *emu; *remu = NULL; emu = kzalloc(sizeof(*emu), GFP_KERNEL); @@ -66,10 +66,33 @@ int snd_emux_new(snd_emux_t **remu) /* */ -int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) +static int sf_sample_new(void *private_data, struct snd_sf_sample *sp, + struct snd_util_memhdr *hdr, + const void __user *buf, long count) +{ + struct snd_emux *emu = private_data; + return emu->ops.sample_new(emu, sp, hdr, buf, count); + +} + +static int sf_sample_free(void *private_data, struct snd_sf_sample *sp, + struct snd_util_memhdr *hdr) +{ + struct snd_emux *emu = private_data; + return emu->ops.sample_free(emu, sp, hdr); + +} + +static void sf_sample_reset(void *private_data) +{ + struct snd_emux *emu = private_data; + emu->ops.sample_reset(emu); +} + +int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name) { int err; - snd_sf_callback_t sf_cb; + struct snd_sf_callback sf_cb; snd_assert(emu->hw != NULL, return -EINVAL); snd_assert(emu->max_voices > 0, return -EINVAL); @@ -78,16 +101,20 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) emu->card = card; emu->name = kstrdup(name, GFP_KERNEL); - emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL); + emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), + GFP_KERNEL); if (emu->voices == NULL) return -ENOMEM; /* create soundfont list */ memset(&sf_cb, 0, sizeof(sf_cb)); sf_cb.private_data = emu; - sf_cb.sample_new = (snd_sf_sample_new_t)emu->ops.sample_new; - sf_cb.sample_free = (snd_sf_sample_free_t)emu->ops.sample_free; - sf_cb.sample_reset = (snd_sf_sample_reset_t)emu->ops.sample_reset; + if (emu->ops.sample_new) + sf_cb.sample_new = sf_sample_new; + if (emu->ops.sample_free) + sf_cb.sample_free = sf_sample_free; + if (emu->ops.sample_reset) + sf_cb.sample_reset = sf_sample_reset; emu->sflist = snd_sf_new(&sf_cb, emu->memhdr); if (emu->sflist == NULL) return -ENOMEM; @@ -112,7 +139,7 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) /* */ -int snd_emux_free(snd_emux_t *emu) +int snd_emux_free(struct snd_emux *emu) { unsigned long flags; |