Changeset 679 for GPL/trunk/alsa-kernel/synth
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (5 years ago)
- Location:
- GPL/trunk
- Files:
-
- 13 edited
-
. (modified) (1 prop)
-
alsa-kernel/synth/Makefile (modified) (1 diff)
-
alsa-kernel/synth/emux/emux.c (modified) (7 diffs)
-
alsa-kernel/synth/emux/emux_effect.c (modified) (3 diffs)
-
alsa-kernel/synth/emux/emux_hwdep.c (modified) (4 diffs)
-
alsa-kernel/synth/emux/emux_nrpn.c (modified) (7 diffs)
-
alsa-kernel/synth/emux/emux_oss.c (modified) (14 diffs)
-
alsa-kernel/synth/emux/emux_proc.c (modified) (4 diffs)
-
alsa-kernel/synth/emux/emux_seq.c (modified) (13 diffs)
-
alsa-kernel/synth/emux/emux_synth.c (modified) (11 diffs)
-
alsa-kernel/synth/emux/emux_voice.h (modified) (4 diffs)
-
alsa-kernel/synth/emux/soundfont.c (modified) (11 diffs)
-
alsa-kernel/synth/util_mem.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/synth/Makefile
r587 r679 6 6 !include $(ROOT)\tools\header.mif 7 7 8 WMAKEOPTS=-h $(__MAKEOPTS__) KEE=$(KEE)DEBUG=$(DEBUG)8 WMAKEOPTS=-h $(__MAKEOPTS__) DEBUG=$(DEBUG) 9 9 10 10 #=================================================================== -
GPL/trunk/alsa-kernel/synth/emux/emux.c
r399 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> 3 4 * 4 5 * Routines for control of EMU WaveTable chip 5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 6 */ 20 7 … … 25 12 #include <sound/emux_synth.h> 26 13 #include <linux/init.h> 14 #include <linux/module.h> 27 15 #include "emux_voice.h" 28 16 … … 47 35 48 36 emu->client = -1; 49 #if def CONFIG_SND_SEQUENCER_OSS37 #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) 50 38 emu->oss_synth = NULL; 51 39 #endif … … 53 41 emu->use_time = 0; 54 42 43 #ifndef TARGET_OS2 44 timer_setup(&emu->tlist, snd_emux_timer_callback, 0); 45 #else 55 46 init_timer(&emu->tlist); 56 emu->tlist.function = snd_emux_timer_callback;47 emu->tlist.function = (void(*)(unsigned long))snd_emux_timer_callback; 57 48 emu->tlist.data = (unsigned long)emu; 49 #endif 58 50 emu->timer_active = 0; 59 51 … … 125 117 126 118 snd_emux_init_seq(emu, card, index); 127 #if def CONFIG_SND_SEQUENCER_OSS119 #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) 128 120 snd_emux_init_seq_oss(emu); 129 121 #endif 130 122 snd_emux_init_virmidi(emu, card); 131 123 132 #ifdef CONFIG_PROC_FS133 124 snd_emux_proc_init(emu, card, index); 134 #endif135 125 return 0; 136 126 } … … 152 142 spin_unlock_irqrestore(&emu->voice_lock, flags); 153 143 154 #ifdef CONFIG_PROC_FS155 144 snd_emux_proc_free(emu); 156 #endif157 145 snd_emux_delete_virmidi(emu); 158 #if def CONFIG_SND_SEQUENCER_OSS146 #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) 159 147 snd_emux_detach_seq_oss(emu); 160 148 #endif 161 149 snd_emux_detach_seq(emu); 162 163 150 snd_emux_delete_hwdep(emu); 164 165 if (emu->sflist) 166 snd_sf_free(emu->sflist); 167 151 snd_sf_free(emu->sflist); 168 152 kfree(emu->voices); 169 153 kfree(emu->name); … … 173 157 174 158 EXPORT_SYMBOL(snd_emux_free); 175 176 177 /*178 * INIT part179 */180 181 static int __init alsa_emux_init(void)182 {183 return 0;184 }185 186 static void __exit alsa_emux_exit(void)187 {188 }189 190 module_init(alsa_emux_init)191 module_exit(alsa_emux_exit) -
GPL/trunk/alsa-kernel/synth/emux/emux_effect.c
r305 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Midi synth routines for the Emu8k/Emu10k1 … … 6 7 * 7 8 * Contains code based on awe_wave.c by Takashi Iwai 8 *9 * This program is free software; you can redistribute it and/or modify10 * it under the terms of the GNU General Public License as published by11 * the Free Software Foundation; either version 2 of the License, or12 * (at your option) any later version.13 *14 * This program is distributed in the hope that it will be useful,15 * but WITHOUT ANY WARRANTY; without even the implied warranty of16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 * GNU General Public License for more details.18 *19 * You should have received a copy of the GNU General Public License20 * along with this program; if not, write to the Free Software21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22 *23 9 */ 24 10 … … 151 137 } 152 138 153 #if def CONFIG_SND_SEQUENCER_OSS139 #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) 154 140 /* change effects - for OSS sequencer compatibility */ 155 141 void -
GPL/trunk/alsa-kernel/synth/emux/emux_hwdep.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Interface for hwdep device 3 4 * 4 5 * Copyright (C) 2004 Takashi Iwai <tiwai@suse.de> 5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 *20 6 */ 21 7 22 8 #include <sound/core.h> 23 9 #include <sound/hwdep.h> 24 #include <asm/uaccess.h> 10 #include <linux/uaccess.h> 11 #include <linux/nospec.h> 25 12 #include "emux_voice.h" 26 27 13 28 14 #define TMP_CLIENT_ID 0x1001 … … 39 25 if (copy_from_user(&patch, arg, sizeof(patch))) 40 26 return -EFAULT; 27 28 if (patch.key == GUS_PATCH) 29 return snd_soundfont_load_guspatch(emu->sflist, arg, 30 patch.len + sizeof(patch), 31 TMP_CLIENT_ID); 41 32 42 33 if (patch.type >= SNDRV_SFNT_LOAD_INFO && … … 67 58 if (info.mode < 0 || info.mode >= EMUX_MD_END) 68 59 return -EINVAL; 60 info.mode = array_index_nospec(info.mode, EMUX_MD_END); 69 61 70 62 if (info.port < 0) { … … 72 64 emu->portptrs[i]->ctrls[info.mode] = info.value; 73 65 } else { 74 if (info.port < emu->num_ports) 66 if (info.port < emu->num_ports) { 67 info.port = array_index_nospec(info.port, emu->num_ports); 75 68 emu->portptrs[info.port]->ctrls[info.mode] = info.value; 69 } 76 70 } 77 71 return 0; -
GPL/trunk/alsa-kernel/synth/emux/emux_nrpn.c
r399 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * NRPN / SYSEX callbacks for Emu8k/Emu10k1 3 4 * 4 5 * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 *20 6 */ 21 7 … … 49 35 */ 50 36 51 static int send_converted_effect(struct nrpn_conv_table *table, int num_tables, 37 static int send_converted_effect(const struct nrpn_conv_table *table, 38 int num_tables, 52 39 struct snd_emux_port *port, 53 40 struct snd_midi_channel *chan, … … 77 64 * adjusted for chaos 8MB soundfonts 78 65 */ 79 static int gs_sense[] =66 static const int gs_sense[] = 80 67 { 81 68 DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE, … … 86 73 * adjusted for chaos 8MB soundfonts 87 74 */ 88 static int xg_sense[] =75 static const int xg_sense[] = 89 76 { 90 77 DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE, … … 180 167 181 168 182 static struct nrpn_conv_table awe_effects[] =169 static const struct nrpn_conv_table awe_effects[] = 183 170 { 184 171 { 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay}, … … 267 254 } 268 255 269 static struct nrpn_conv_table gs_effects[] =256 static const struct nrpn_conv_table gs_effects[] = 270 257 { 271 258 {32, EMUX_FX_CUTOFF, gs_cutoff}, … … 351 338 } 352 339 353 static struct nrpn_conv_table xg_effects[] =340 static const struct nrpn_conv_table xg_effects[] = 354 341 { 355 342 {71, EMUX_FX_CUTOFF, xg_cutoff}, -
GPL/trunk/alsa-kernel/synth/emux/emux_oss.c
r426 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Interface for OSS sequencer emulation … … 4 5 * Copyright (C) 1999 Takashi Iwai <tiwai@suse.de> 5 6 * 6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 *20 7 * Changes 21 8 * 19990227 Steve Ratcliffe Made separate file and merged in latest … … 24 11 25 12 26 #ifdef CONFIG_SND_SEQUENCER_OSS 27 28 #include <asm/uaccess.h> 13 #include <linux/export.h> 14 #include <linux/uaccess.h> 29 15 #include <sound/core.h> 30 16 #include "emux_voice.h" … … 49 35 50 36 /* operators */ 51 static struct snd_seq_oss_callback oss_callback = {37 static const struct snd_seq_oss_callback oss_callback = { 52 38 .owner = THIS_MODULE, 53 39 .open = snd_emux_open_seq_oss, … … 69 55 struct snd_seq_device *dev; 70 56 71 if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, 57 /* using device#1 here for avoiding conflicts with OPL3 */ 58 if (snd_seq_device_new(emu->card, 1, SNDRV_SEQ_DEV_ID_OSS, 72 59 sizeof(struct snd_seq_oss_reg), &dev) < 0) 73 60 return; … … 118 105 return -ENXIO; 119 106 120 mutex_lock(&emu->register_mutex); 121 122 if (!snd_emux_inc_count(emu)) { 123 mutex_unlock(&emu->register_mutex); 107 if (!snd_emux_inc_count(emu)) 124 108 return -EFAULT; 125 }126 109 127 110 memset(&callback, 0, sizeof(callback)); … … 135 118 snd_printk(KERN_ERR "can't create port\n"); 136 119 snd_emux_dec_count(emu); 137 mutex_unlock(&emu->register_mutex);138 120 return -ENOMEM; 139 121 } … … 148 130 149 131 snd_emux_reset_port(p); 150 151 mutex_unlock(&emu->register_mutex);152 132 return 0; 153 133 } … … 195 175 return -ENXIO; 196 176 197 mutex_lock(&emu->register_mutex);198 177 snd_emux_sounds_off_all(p); 199 178 snd_soundfont_close_check(emu->sflist, SF_CLIENT_NO(p->chset.port)); … … 201 180 snd_emux_dec_count(emu); 202 181 203 mutex_unlock(&emu->register_mutex);204 182 return 0; 205 183 } … … 233 211 struct soundfont_patch_info patch; 234 212 if (count < (int)sizeof(patch)) 235 r c =-EINVAL;213 return -EINVAL; 236 214 if (copy_from_user(&patch, buf, sizeof(patch))) 237 r c =-EFAULT;215 return -EFAULT; 238 216 if (patch.type >= SNDRV_SFNT_LOAD_INFO && 239 217 patch.type <= SNDRV_SFNT_PROBE_DATA) … … 440 418 int voice; 441 419 unsigned short p1; 442 short p2;443 420 int plong; 444 421 struct snd_midi_channel *chan; … … 455 432 456 433 p1 = *(unsigned short *) &event[4]; 457 p2 = *(short *) &event[6];458 434 plong = *(int*) &event[4]; 459 435 … … 513 489 snd_emux_event_input(&ev, 0, port, atomic, hop); 514 490 } 515 516 #endif /* CONFIG_SND_SEQUENCER_OSS */ -
GPL/trunk/alsa-kernel/synth/emux/emux_proc.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> 3 4 * 4 5 * Proc interface for Emu8k/Emu10k1 WaveTable synth 5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 6 */ 20 7 … … 24 11 #include <sound/info.h> 25 12 #include "emux_voice.h" 26 27 #ifdef CONFIG_PROC_FS28 13 29 14 static void … … 118 103 entry->private_data = emu; 119 104 entry->c.text.read = snd_emux_proc_info_read; 120 if (snd_info_register(entry) < 0)121 snd_info_free_entry(entry);122 else123 emu->proc = entry;124 105 } 125 106 … … 129 110 emu->proc = NULL; 130 111 } 131 132 #endif /* CONFIG_PROC_FS */ -
GPL/trunk/alsa-kernel/synth/emux/emux_seq.c
r426 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Midi Sequencer interface routines. … … 4 5 * Copyright (C) 1999 Steve Ratcliffe 5 6 * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 6 *7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License as published by9 * the Free Software Foundation; either version 2 of the License, or10 * (at your option) any later version.11 *12 * This program is distributed in the hope that it will be useful,13 * but WITHOUT ANY WARRANTY; without even the implied warranty of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 * GNU General Public License for more details.16 *17 * You should have received a copy of the GNU General Public License18 * along with this program; if not, write to the Free Software19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 7 */ 21 8 22 9 #include "emux_voice.h" 23 10 #include <linux/slab.h> 24 11 #include <linux/module.h> 25 12 26 13 /* Prototypes for static functions */ … … 33 20 * MIDI emulation operators 34 21 */ 35 static struct snd_midi_op emux_ops = {36 snd_emux_note_on,37 snd_emux_note_off,38 snd_emux_key_press,39 snd_emux_terminate_note,40 snd_emux_control,41 snd_emux_nrpn,42 snd_emux_sysex,22 static const struct snd_midi_op emux_ops = { 23 .note_on = snd_emux_note_on, 24 .note_off = snd_emux_note_off, 25 .key_press = snd_emux_key_press, 26 .note_terminate = snd_emux_terminate_note, 27 .control = snd_emux_control, 28 .nrpn = snd_emux_nrpn, 29 .sysex = snd_emux_sysex, 43 30 }; 44 31 … … 100 87 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, 101 88 0, &pinfo); 102 if ( p == NULL) {89 if (!p) { 103 90 snd_printk(KERN_ERR "can't create port\n"); 104 91 return -ENOMEM; … … 125 112 snd_emux_terminate_all(emu); 126 113 127 mutex_lock(&emu->register_mutex);128 114 if (emu->client >= 0) { 129 115 snd_seq_delete_kernel_client(emu->client); 130 116 emu->client = -1; 131 117 } 132 mutex_unlock(&emu->register_mutex);133 118 } 134 119 … … 147 132 148 133 /* Allocate structures for this channel */ 149 if ((p = kzalloc(sizeof(*p), GFP_KERNEL)) == NULL) {150 snd_printk(KERN_ERR "no memory\n");134 p = kzalloc(sizeof(*p), GFP_KERNEL); 135 if (!p) 151 136 return NULL; 152 } 153 p->chset.channels = kcalloc(max_channels, sizeof( struct snd_midi_channel), GFP_KERNEL);154 if (p->chset.channels == NULL) {155 snd_printk(KERN_ERR "no memory\n");137 138 p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels), 139 GFP_KERNEL); 140 if (!p->chset.channels) { 156 141 kfree(p); 157 142 return NULL; … … 270 255 * increment usage count 271 256 */ 272 int273 snd_emux_inc_count(struct snd_emux *emu)257 static int 258 __snd_emux_inc_count(struct snd_emux *emu) 274 259 { 275 260 emu->used++; … … 285 270 } 286 271 272 int snd_emux_inc_count(struct snd_emux *emu) 273 { 274 int ret; 275 276 mutex_lock(&emu->register_mutex); 277 ret = __snd_emux_inc_count(emu); 278 mutex_unlock(&emu->register_mutex); 279 return ret; 280 } 287 281 288 282 /* 289 283 * decrease usage count 290 284 */ 291 void292 snd_emux_dec_count(struct snd_emux *emu)285 static void 286 __snd_emux_dec_count(struct snd_emux *emu) 293 287 { 294 288 module_put(emu->card->module); … … 299 293 } 300 294 295 void snd_emux_dec_count(struct snd_emux *emu) 296 { 297 mutex_lock(&emu->register_mutex); 298 __snd_emux_dec_count(emu); 299 mutex_unlock(&emu->register_mutex); 300 } 301 301 302 302 /* … … 318 318 mutex_lock(&emu->register_mutex); 319 319 snd_emux_init_port(p); 320 snd_emux_inc_count(emu);320 __snd_emux_inc_count(emu); 321 321 mutex_unlock(&emu->register_mutex); 322 322 return 0; … … 341 341 mutex_lock(&emu->register_mutex); 342 342 snd_emux_sounds_off_all(p); 343 snd_emux_dec_count(emu);343 __snd_emux_dec_count(emu); 344 344 mutex_unlock(&emu->register_mutex); 345 345 return 0; … … 358 358 return 0; 359 359 360 emu->vmidi = kcalloc(emu->midi_ports, sizeof( struct snd_rawmidi *), GFP_KERNEL);361 if ( emu->vmidi == NULL)360 emu->vmidi = kcalloc(emu->midi_ports, sizeof(*emu->vmidi), GFP_KERNEL); 361 if (!emu->vmidi) 362 362 return -ENOMEM; 363 363 … … 391 391 int i; 392 392 393 if ( emu->vmidi == NULL)393 if (!emu->vmidi) 394 394 return 0; 395 395 -
GPL/trunk/alsa-kernel/synth/emux/emux_synth.c
r426 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Midi synth routines for the Emu8k/Emu10k1 … … 6 7 * 7 8 * Contains code based on awe_wave.c by Takashi Iwai 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2 of the License, or 12 * (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * 23 */ 24 9 */ 10 11 #include <linux/export.h> 25 12 #include "emux_voice.h" 26 13 #include <sound/asoundef.h> … … 186 173 vp->state = SNDRV_EMUX_ST_PENDING; 187 174 if (! emu->timer_active) { 188 emu->tlist.expires = jiffies + 1; 189 add_timer(&emu->tlist); 175 mod_timer(&emu->tlist, jiffies + 1); 190 176 emu->timer_active = 1; 191 177 } … … 198 184 } 199 185 186 #define from_timer(var, callback_timer, timer_fieldname) \ 187 container_of(callback_timer, struct snd_emux, timer_fieldname) 188 200 189 /* 201 190 * timer callback … … 203 192 * release the pending note-offs 204 193 */ 205 void snd_emux_timer_callback( unsigned long data)206 { 207 struct snd_emux *emu = (struct snd_emux *) data;194 void snd_emux_timer_callback(struct timer_list *t) 195 { 196 struct snd_emux *emu = from_timer(emu, t, tlist); 208 197 struct snd_emux_voice *vp; 209 198 unsigned long flags; … … 223 212 } 224 213 if (do_again) { 225 emu->tlist.expires = jiffies + 1; 226 add_timer(&emu->tlist); 214 mod_timer(&emu->tlist, jiffies + 1); 227 215 emu->timer_active = 1; 228 216 } else … … 545 533 #if 0 // not used 546 534 /* table for volume target calculation */ 547 static unsigned short voltarget[16] = {535 static const unsigned short voltarget[16] = { 548 536 0xEAC0, 0xE0C8, 0xD740, 0xCE20, 0xC560, 0xBD08, 0xB500, 0xAD58, 549 537 0xA5F8, 0x9EF0, 0x9830, 0x91C0, 0x8B90, 0x85A8, 0x8000, 0x7A90 … … 632 620 * calculate pitch parameter 633 621 */ 634 static unsigned char pan_volumes[256] = {622 static const unsigned char pan_volumes[256] = { 635 623 0x00,0x03,0x06,0x09,0x0c,0x0f,0x12,0x14,0x17,0x1a,0x1d,0x20,0x22,0x25,0x28,0x2a, 636 624 0x2d,0x30,0x32,0x35,0x37,0x3a,0x3c,0x3f,0x41,0x44,0x46,0x49,0x4b,0x4d,0x50,0x52, … … 700 688 701 689 /* tables for volume->attenuation calculation */ 702 static unsigned char voltab1[128] = {690 static const unsigned char voltab1[128] = { 703 691 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 704 692 0x63, 0x2b, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, … … 716 704 }; 717 705 718 static unsigned char voltab2[128] = {706 static const unsigned char voltab2[128] = { 719 707 0x32, 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x2a, 720 708 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x24, 0x23, 0x22, 0x21, … … 732 720 }; 733 721 734 static unsigned char expressiontab[128] = {722 static const unsigned char expressiontab[128] = { 735 723 0x7f, 0x6c, 0x62, 0x5a, 0x54, 0x50, 0x4b, 0x48, 0x45, 0x42, 736 724 0x40, 0x3d, 0x3b, 0x39, 0x38, 0x36, 0x34, 0x33, 0x31, 0x30, -
GPL/trunk/alsa-kernel/synth/emux/emux_voice.h
r305 r679 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 1 2 #ifndef __EMUX_VOICE_H 2 3 #define __EMUX_VOICE_H … … 7 8 * Copyright (C) 1999 Steve Ratcliffe 8 9 * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 9 *10 * This program is free software; you can redistribute it and/or modify11 * it under the terms of the GNU General Public License as published by12 * the Free Software Foundation; either version 2 of the License, or13 * (at your option) any later version.14 *15 * This program is distributed in the hope that it will be useful,16 * but WITHOUT ANY WARRANTY; without even the implied warranty of17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the18 * GNU General Public License for more details.19 *20 * You should have received a copy of the GNU General Public License21 * along with this program; if not, write to the Free Software22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA23 10 */ 24 11 … … 56 43 void snd_emux_update_port(struct snd_emux_port *port, int update); 57 44 58 void snd_emux_timer_callback( unsigned long data);45 void snd_emux_timer_callback(struct timer_list *t); 59 46 60 47 /* emux_effect.c */ … … 83 70 84 71 /* emux_proc.c */ 85 #if def CONFIG_PROC_FS72 #if defined(CONFIG_SND_PROC_FS) || defined(TARGET_OS2) 86 73 void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device); 87 74 void snd_emux_proc_free(struct snd_emux *emu); 75 #else 76 static inline void snd_emux_proc_init(struct snd_emux *emu, 77 struct snd_card *card, int device) {} 78 static inline void snd_emux_proc_free(struct snd_emux *emu) {} 88 79 #endif 89 80 -
GPL/trunk/alsa-kernel/synth/emux/soundfont.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Soundfont generic routines. … … 6 7 * Copyright (C) 1999 Steve Ratcliffe 7 8 * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 8 *9 * This program is free software; you can redistribute it and/or modify10 * it under the terms of the GNU General Public License as published by11 * the Free Software Foundation; either version 2 of the License, or12 * (at your option) any later version.13 *14 * This program is distributed in the hope that it will be useful,15 * but WITHOUT ANY WARRANTY; without even the implied warranty of16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 * GNU General Public License for more details.18 *19 * You should have received a copy of the GNU General Public License20 * along with this program; if not, write to the Free Software21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22 9 */ 23 10 /* … … 26 13 * Everything may change when there is an alsa way of doing things. 27 14 */ 28 #include < asm/uaccess.h>15 #include <linux/uaccess.h> 29 16 #include <linux/slab.h> 17 #include <linux/export.h> 30 18 #include <sound/core.h> 31 19 #include <sound/soundfont.h> … … 249 237 parm.type |= SNDRV_SFNT_PAT_SHARED; 250 238 sf = newsf(sflist, parm.type, NULL); 251 } else 239 } else 252 240 sf = newsf(sflist, parm.type, parm.name); 253 241 if (sf == NULL) { … … 766 754 767 755 /* log2_tbl[i] = log2(i+128) * 0x10000 */ 768 static int log_tbl[129] = {756 static const int log_tbl[129] = { 769 757 0x70000, 0x702df, 0x705b9, 0x7088e, 0x70b5d, 0x70e26, 0x710eb, 0x713aa, 770 758 0x71663, 0x71918, 0x71bc8, 0x71e72, 0x72118, 0x723b9, 0x72655, 0x728ed, … … 858 846 r = (3 - ((rate >> 6) & 3)) * 3; 859 847 p = rate & 0x3f; 848 if (!p) 849 p = 1; 860 850 t = end - start; 861 851 if (t < 0) t = -t; … … 870 860 871 861 /* attack & decay/release time table (msec) */ 872 static short attack_time_tbl[128] = {862 static const short attack_time_tbl[128] = { 873 863 32767, 32767, 5989, 4235, 2994, 2518, 2117, 1780, 1497, 1373, 1259, 1154, 1058, 970, 890, 816, 874 864 707, 691, 662, 634, 607, 581, 557, 533, 510, 489, 468, 448, 429, 411, 393, 377, … … 881 871 }; 882 872 883 static short decay_time_tbl[128] = {873 static const short decay_time_tbl[128] = { 884 874 32767, 32767, 22614, 15990, 11307, 9508, 7995, 6723, 5653, 5184, 4754, 4359, 3997, 3665, 3361, 3082, 885 875 2828, 2765, 2648, 2535, 2428, 2325, 2226, 2132, 2042, 1955, 1872, 1793, 1717, 1644, 1574, 1507, … … 904 894 /* search an index for specified time from given time table */ 905 895 static int 906 calc_parm_search(int msec, short *table)896 calc_parm_search(int msec, const short *table) 907 897 { 908 898 int left = 1, right = 127, mid; … … 1023 1013 if (rc < 0) { 1024 1014 sf_sample_delete(sflist, sf, smp); 1015 kfree(zone); 1025 1016 return rc; 1026 1017 } … … 1068 1059 (patch.env_rate[5], patch.env_offset[4], 1069 1060 patch.env_offset[5]); 1070 zone->v.parm.volatkhld = 1061 zone->v.parm.volatkhld = 1071 1062 (snd_sf_calc_parm_hold(hold) << 8) | 1072 1063 snd_sf_calc_parm_attack(attack); -
GPL/trunk/alsa-kernel/synth/util_mem.c
r399 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> 3 4 * 4 5 * Generic memory management routines for soundcard memory allocation 5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 6 */ 20 7 … … 22 9 #include <linux/init.h> 23 10 #include <linux/slab.h> 11 #include <linux/module.h> 24 12 #include <sound/core.h> 25 13 #include <sound/util_mem.h> … … 193 181 EXPORT_SYMBOL(__snd_util_mem_free); 194 182 EXPORT_SYMBOL(__snd_util_memblk_new); 195 196 /*197 * INIT part198 */199 200 static int __init alsa_util_mem_init(void)201 {202 return 0;203 }204 205 static void __exit alsa_util_mem_exit(void)206 {207 }208 209 module_init(alsa_util_mem_init)210 module_exit(alsa_util_mem_exit)
Note:
See TracChangeset
for help on using the changeset viewer.
