Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (5 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/synth/Makefile

    r587 r679  
    66!include $(ROOT)\tools\header.mif
    77
    8 WMAKEOPTS=-h $(__MAKEOPTS__) KEE=$(KEE) DEBUG=$(DEBUG)
     8WMAKEOPTS=-h $(__MAKEOPTS__) DEBUG=$(DEBUG)
    99
    1010#===================================================================
  • GPL/trunk/alsa-kernel/synth/emux/emux.c

    r399 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (C) 2000 Takashi Iwai <tiwai@suse.de>
    34 *
    45 *  Routines for control of EMU WaveTable chip
    5  *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    196 */
    207
     
    2512#include <sound/emux_synth.h>
    2613#include <linux/init.h>
     14#include <linux/module.h>
    2715#include "emux_voice.h"
    2816
     
    4735
    4836        emu->client = -1;
    49 #ifdef CONFIG_SND_SEQUENCER_OSS
     37#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    5038        emu->oss_synth = NULL;
    5139#endif
     
    5341        emu->use_time = 0;
    5442
     43#ifndef TARGET_OS2
     44        timer_setup(&emu->tlist, snd_emux_timer_callback, 0);
     45#else
    5546        init_timer(&emu->tlist);
    56         emu->tlist.function = snd_emux_timer_callback;
     47        emu->tlist.function = (void(*)(unsigned long))snd_emux_timer_callback;
    5748        emu->tlist.data = (unsigned long)emu;
     49#endif
    5850        emu->timer_active = 0;
    5951
     
    125117
    126118        snd_emux_init_seq(emu, card, index);
    127 #ifdef CONFIG_SND_SEQUENCER_OSS
     119#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    128120        snd_emux_init_seq_oss(emu);
    129121#endif
    130122        snd_emux_init_virmidi(emu, card);
    131123
    132 #ifdef CONFIG_PROC_FS
    133124        snd_emux_proc_init(emu, card, index);
    134 #endif
    135125        return 0;
    136126}
     
    152142        spin_unlock_irqrestore(&emu->voice_lock, flags);
    153143
    154 #ifdef CONFIG_PROC_FS
    155144        snd_emux_proc_free(emu);
    156 #endif
    157145        snd_emux_delete_virmidi(emu);
    158 #ifdef CONFIG_SND_SEQUENCER_OSS
     146#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    159147        snd_emux_detach_seq_oss(emu);
    160148#endif
    161149        snd_emux_detach_seq(emu);
    162 
    163150        snd_emux_delete_hwdep(emu);
    164 
    165         if (emu->sflist)
    166                 snd_sf_free(emu->sflist);
    167 
     151        snd_sf_free(emu->sflist);
    168152        kfree(emu->voices);
    169153        kfree(emu->name);
     
    173157
    174158EXPORT_SYMBOL(snd_emux_free);
    175 
    176 
    177 /*
    178  *  INIT part
    179  */
    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
    12/*
    23 *  Midi synth routines for the Emu8k/Emu10k1
     
    67 *
    78 *  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  *
    239 */
    2410
     
    151137}
    152138
    153 #ifdef CONFIG_SND_SEQUENCER_OSS
     139#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    154140/* change effects - for OSS sequencer compatibility */
    155141void
  • GPL/trunk/alsa-kernel/synth/emux/emux_hwdep.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Interface for hwdep device
    34 *
    45 *  Copyright (C) 2004 Takashi Iwai <tiwai@suse.de>
    5  *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    19  *
    206 */
    217
    228#include <sound/core.h>
    239#include <sound/hwdep.h>
    24 #include <asm/uaccess.h>
     10#include <linux/uaccess.h>
     11#include <linux/nospec.h>
    2512#include "emux_voice.h"
    26 
    2713
    2814#define TMP_CLIENT_ID   0x1001
     
    3925        if (copy_from_user(&patch, arg, sizeof(patch)))
    4026                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);
    4132
    4233        if (patch.type >= SNDRV_SFNT_LOAD_INFO &&
     
    6758        if (info.mode < 0 || info.mode >= EMUX_MD_END)
    6859                return -EINVAL;
     60        info.mode = array_index_nospec(info.mode, EMUX_MD_END);
    6961
    7062        if (info.port < 0) {
     
    7264                        emu->portptrs[i]->ctrls[info.mode] = info.value;
    7365        } 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);
    7568                        emu->portptrs[info.port]->ctrls[info.mode] = info.value;
     69                }
    7670        }
    7771        return 0;
  • GPL/trunk/alsa-kernel/synth/emux/emux_nrpn.c

    r399 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  NRPN / SYSEX callbacks for Emu8k/Emu10k1
    34 *
    45 *  Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>
    5  *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    19  *
    206 */
    217
     
    4935 */
    5036
    51 static int send_converted_effect(struct nrpn_conv_table *table, int num_tables,
     37static int send_converted_effect(const struct nrpn_conv_table *table,
     38                                 int num_tables,
    5239                                 struct snd_emux_port *port,
    5340                                 struct snd_midi_channel *chan,
     
    7764 *  adjusted for chaos 8MB soundfonts
    7865 */
    79 static int gs_sense[] =
     66static const int gs_sense[] =
    8067{
    8168        DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE,
     
    8673 * adjusted for chaos 8MB soundfonts
    8774 */
    88 static int xg_sense[] =
     75static const int xg_sense[] =
    8976{
    9077        DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE,
     
    180167
    181168
    182 static struct nrpn_conv_table awe_effects[] =
     169static const struct nrpn_conv_table awe_effects[] =
    183170{
    184171        { 0, EMUX_FX_LFO1_DELAY,        fx_lfo1_delay},
     
    267254}
    268255
    269 static struct nrpn_conv_table gs_effects[] =
     256static const struct nrpn_conv_table gs_effects[] =
    270257{
    271258        {32, EMUX_FX_CUTOFF,    gs_cutoff},
     
    351338}
    352339
    353 static struct nrpn_conv_table xg_effects[] =
     340static const struct nrpn_conv_table xg_effects[] =
    354341{
    355342        {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
    12/*
    23 *  Interface for OSS sequencer emulation
     
    45 *  Copyright (C) 1999 Takashi Iwai <tiwai@suse.de>
    56 *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    19  *
    207 * Changes
    218 * 19990227   Steve Ratcliffe   Made separate file and merged in latest
     
    2411
    2512
    26 #ifdef CONFIG_SND_SEQUENCER_OSS
    27 
    28 #include <asm/uaccess.h>
     13#include <linux/export.h>
     14#include <linux/uaccess.h>
    2915#include <sound/core.h>
    3016#include "emux_voice.h"
     
    4935
    5036/* operators */
    51 static struct snd_seq_oss_callback oss_callback = {
     37static const struct snd_seq_oss_callback oss_callback = {
    5238        .owner = THIS_MODULE,
    5339        .open = snd_emux_open_seq_oss,
     
    6955        struct snd_seq_device *dev;
    7056
    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,
    7259                               sizeof(struct snd_seq_oss_reg), &dev) < 0)
    7360                return;
     
    118105                return -ENXIO;
    119106
    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))
    124108                return -EFAULT;
    125         }
    126109
    127110        memset(&callback, 0, sizeof(callback));
     
    135118                snd_printk(KERN_ERR "can't create port\n");
    136119                snd_emux_dec_count(emu);
    137                 mutex_unlock(&emu->register_mutex);
    138120                return -ENOMEM;
    139121        }
     
    148130
    149131        snd_emux_reset_port(p);
    150 
    151         mutex_unlock(&emu->register_mutex);
    152132        return 0;
    153133}
     
    195175                return -ENXIO;
    196176
    197         mutex_lock(&emu->register_mutex);
    198177        snd_emux_sounds_off_all(p);
    199178        snd_soundfont_close_check(emu->sflist, SF_CLIENT_NO(p->chset.port));
     
    201180        snd_emux_dec_count(emu);
    202181
    203         mutex_unlock(&emu->register_mutex);
    204182        return 0;
    205183}
     
    233211                struct soundfont_patch_info patch;
    234212                if (count < (int)sizeof(patch))
    235                         rc = -EINVAL;
     213                        return -EINVAL;
    236214                if (copy_from_user(&patch, buf, sizeof(patch)))
    237                         rc = -EFAULT;
     215                        return -EFAULT;
    238216                if (patch.type >= SNDRV_SFNT_LOAD_INFO &&
    239217                    patch.type <= SNDRV_SFNT_PROBE_DATA)
     
    440418        int voice;
    441419        unsigned short p1;
    442         short p2;
    443420        int plong;
    444421        struct snd_midi_channel *chan;
     
    455432
    456433        p1 = *(unsigned short *) &event[4];
    457         p2 = *(short *) &event[6];
    458434        plong = *(int*) &event[4];
    459435
     
    513489        snd_emux_event_input(&ev, 0, port, atomic, hop);
    514490}
    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
    12/*
    23 *  Copyright (C) 2000 Takashi Iwai <tiwai@suse.de>
    34 *
    45 *  Proc interface for Emu8k/Emu10k1 WaveTable synth
    5  *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    196 */
    207
     
    2411#include <sound/info.h>
    2512#include "emux_voice.h"
    26 
    27 #ifdef CONFIG_PROC_FS
    2813
    2914static void
     
    118103        entry->private_data = emu;
    119104        entry->c.text.read = snd_emux_proc_info_read;
    120         if (snd_info_register(entry) < 0)
    121                 snd_info_free_entry(entry);
    122         else
    123                 emu->proc = entry;
    124105}
    125106
     
    129110        emu->proc = NULL;
    130111}
    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
    12/*
    23 *  Midi Sequencer interface routines.
     
    45 *  Copyright (C) 1999 Steve Ratcliffe
    56 *  Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>
    6  *
    7  *   This program is free software; you can redistribute it and/or modify
    8  *   it under the terms of the GNU General Public License as published by
    9  *   the Free Software Foundation; either version 2 of the License, or
    10  *   (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 of
    14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  *   GNU General Public License for more details.
    16  *
    17  *   You should have received a copy of the GNU General Public License
    18  *   along with this program; if not, write to the Free Software
    19  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    207 */
    218
    229#include "emux_voice.h"
    2310#include <linux/slab.h>
    24 
     11#include <linux/module.h>
    2512
    2613/* Prototypes for static functions */
     
    3320 * MIDI emulation operators
    3421 */
    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,
     22static 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,
    4330};
    4431
     
    10087                p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
    10188                                         0, &pinfo);
    102                 if (p == NULL) {
     89                if (!p) {
    10390                        snd_printk(KERN_ERR "can't create port\n");
    10491                        return -ENOMEM;
     
    125112                snd_emux_terminate_all(emu);
    126113               
    127         mutex_lock(&emu->register_mutex);
    128114        if (emu->client >= 0) {
    129115                snd_seq_delete_kernel_client(emu->client);
    130116                emu->client = -1;
    131117        }
    132         mutex_unlock(&emu->register_mutex);
    133118}
    134119
     
    147132
    148133        /* 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)
    151136                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) {
    156141                kfree(p);
    157142                return NULL;
     
    270255 * increment usage count
    271256 */
    272 int
    273 snd_emux_inc_count(struct snd_emux *emu)
     257static int
     258__snd_emux_inc_count(struct snd_emux *emu)
    274259{
    275260        emu->used++;
     
    285270}
    286271
     272int 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}
    287281
    288282/*
    289283 * decrease usage count
    290284 */
    291 void
    292 snd_emux_dec_count(struct snd_emux *emu)
     285static void
     286__snd_emux_dec_count(struct snd_emux *emu)
    293287{
    294288        module_put(emu->card->module);
     
    299293}
    300294
     295void 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}
    301301
    302302/*
     
    318318        mutex_lock(&emu->register_mutex);
    319319        snd_emux_init_port(p);
    320         snd_emux_inc_count(emu);
     320        __snd_emux_inc_count(emu);
    321321        mutex_unlock(&emu->register_mutex);
    322322        return 0;
     
    341341        mutex_lock(&emu->register_mutex);
    342342        snd_emux_sounds_off_all(p);
    343         snd_emux_dec_count(emu);
     343        __snd_emux_dec_count(emu);
    344344        mutex_unlock(&emu->register_mutex);
    345345        return 0;
     
    358358                return 0;
    359359
    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)
    362362                return -ENOMEM;
    363363
     
    391391        int i;
    392392
    393         if (emu->vmidi == NULL)
     393        if (!emu->vmidi)
    394394                return 0;
    395395
  • GPL/trunk/alsa-kernel/synth/emux/emux_synth.c

    r426 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Midi synth routines for the Emu8k/Emu10k1
     
    67 *
    78 *  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>
    2512#include "emux_voice.h"
    2613#include <sound/asoundef.h>
     
    186173                                vp->state = SNDRV_EMUX_ST_PENDING;
    187174                                if (! emu->timer_active) {
    188                                         emu->tlist.expires = jiffies + 1;
    189                                         add_timer(&emu->tlist);
     175                                        mod_timer(&emu->tlist, jiffies + 1);
    190176                                        emu->timer_active = 1;
    191177                                }
     
    198184}
    199185
     186#define from_timer(var, callback_timer, timer_fieldname) \
     187        container_of(callback_timer, struct snd_emux, timer_fieldname)
     188
    200189/*
    201190 * timer callback
     
    203192 * release the pending note-offs
    204193 */
    205 void snd_emux_timer_callback(unsigned long data)
    206 {
    207         struct snd_emux *emu = (struct snd_emux *) data;
     194void snd_emux_timer_callback(struct timer_list *t)
     195{
     196        struct snd_emux *emu = from_timer(emu, t, tlist);
    208197        struct snd_emux_voice *vp;
    209198        unsigned long flags;
     
    223212        }
    224213        if (do_again) {
    225                 emu->tlist.expires = jiffies + 1;
    226                 add_timer(&emu->tlist);
     214                mod_timer(&emu->tlist, jiffies + 1);
    227215                emu->timer_active = 1;
    228216        } else
     
    545533#if 0 // not used
    546534/* table for volume target calculation */
    547 static unsigned short voltarget[16] = {
     535static const unsigned short voltarget[16] = {
    548536        0xEAC0, 0xE0C8, 0xD740, 0xCE20, 0xC560, 0xBD08, 0xB500, 0xAD58,
    549537        0xA5F8, 0x9EF0, 0x9830, 0x91C0, 0x8B90, 0x85A8, 0x8000, 0x7A90
     
    632620 * calculate pitch parameter
    633621 */
    634 static unsigned char pan_volumes[256] = {
     622static const unsigned char pan_volumes[256] = {
    6356230x00,0x03,0x06,0x09,0x0c,0x0f,0x12,0x14,0x17,0x1a,0x1d,0x20,0x22,0x25,0x28,0x2a,
    6366240x2d,0x30,0x32,0x35,0x37,0x3a,0x3c,0x3f,0x41,0x44,0x46,0x49,0x4b,0x4d,0x50,0x52,
     
    700688
    701689/* tables for volume->attenuation calculation */
    702 static unsigned char voltab1[128] = {
     690static const unsigned char voltab1[128] = {
    703691   0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
    704692   0x63, 0x2b, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22,
     
    716704};
    717705
    718 static unsigned char voltab2[128] = {
     706static const unsigned char voltab2[128] = {
    719707   0x32, 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x2a,
    720708   0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x24, 0x23, 0x22, 0x21,
     
    732720};
    733721
    734 static unsigned char expressiontab[128] = {
     722static const unsigned char expressiontab[128] = {
    735723   0x7f, 0x6c, 0x62, 0x5a, 0x54, 0x50, 0x4b, 0x48, 0x45, 0x42,
    736724   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 */
    12#ifndef __EMUX_VOICE_H
    23#define __EMUX_VOICE_H
     
    78 *  Copyright (C) 1999 Steve Ratcliffe
    89 *  Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>
    9  *
    10  *   This program is free software; you can redistribute it and/or modify
    11  *   it under the terms of the GNU General Public License as published by
    12  *   the Free Software Foundation; either version 2 of the License, or
    13  *   (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 of
    17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18  *   GNU General Public License for more details.
    19  *
    20  *   You should have received a copy of the GNU General Public License
    21  *   along with this program; if not, write to the Free Software
    22  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    2310 */
    2411
     
    5643void snd_emux_update_port(struct snd_emux_port *port, int update);
    5744
    58 void snd_emux_timer_callback(unsigned long data);
     45void snd_emux_timer_callback(struct timer_list *t);
    5946
    6047/* emux_effect.c */
     
    8370
    8471/* emux_proc.c */
    85 #ifdef CONFIG_PROC_FS
     72#if defined(CONFIG_SND_PROC_FS) || defined(TARGET_OS2)
    8673void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device);
    8774void snd_emux_proc_free(struct snd_emux *emu);
     75#else
     76static inline void snd_emux_proc_init(struct snd_emux *emu,
     77                                      struct snd_card *card, int device) {}
     78static inline void snd_emux_proc_free(struct snd_emux *emu) {}
    8879#endif
    8980
  • GPL/trunk/alsa-kernel/synth/emux/soundfont.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Soundfont generic routines.
     
    67 *  Copyright (C) 1999 Steve Ratcliffe
    78 *  Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>
    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
    229 */
    2310/*
     
    2613 * Everything may change when there is an alsa way of doing things.
    2714 */
    28 #include <asm/uaccess.h>
     15#include <linux/uaccess.h>
    2916#include <linux/slab.h>
     17#include <linux/export.h>
    3018#include <sound/core.h>
    3119#include <sound/soundfont.h>
     
    249237                parm.type |= SNDRV_SFNT_PAT_SHARED;
    250238                sf = newsf(sflist, parm.type, NULL);
    251         } else
     239        } else 
    252240                sf = newsf(sflist, parm.type, parm.name);
    253241        if (sf == NULL) {
     
    766754
    767755/* log2_tbl[i] = log2(i+128) * 0x10000 */
    768 static int log_tbl[129] = {
     756static const int log_tbl[129] = {
    769757        0x70000, 0x702df, 0x705b9, 0x7088e, 0x70b5d, 0x70e26, 0x710eb, 0x713aa,
    770758        0x71663, 0x71918, 0x71bc8, 0x71e72, 0x72118, 0x723b9, 0x72655, 0x728ed,
     
    858846        r = (3 - ((rate >> 6) & 3)) * 3;
    859847        p = rate & 0x3f;
     848        if (!p)
     849                p = 1;
    860850        t = end - start;
    861851        if (t < 0) t = -t;
     
    870860
    871861/* attack & decay/release time table (msec) */
    872 static short attack_time_tbl[128] = {
     862static const short attack_time_tbl[128] = {
    87386332767, 32767, 5989, 4235, 2994, 2518, 2117, 1780, 1497, 1373, 1259, 1154, 1058, 970, 890, 816,
    874864707, 691, 662, 634, 607, 581, 557, 533, 510, 489, 468, 448, 429, 411, 393, 377,
     
    881871};
    882872
    883 static short decay_time_tbl[128] = {
     873static const short decay_time_tbl[128] = {
    88487432767, 32767, 22614, 15990, 11307, 9508, 7995, 6723, 5653, 5184, 4754, 4359, 3997, 3665, 3361, 3082,
    8858752828, 2765, 2648, 2535, 2428, 2325, 2226, 2132, 2042, 1955, 1872, 1793, 1717, 1644, 1574, 1507,
     
    904894/* search an index for specified time from given time table */
    905895static int
    906 calc_parm_search(int msec, short *table)
     896calc_parm_search(int msec, const short *table)
    907897{
    908898        int left = 1, right = 127, mid;
     
    10231013                if (rc < 0) {
    10241014                        sf_sample_delete(sflist, sf, smp);
     1015                        kfree(zone);
    10251016                        return rc;
    10261017                }
     
    10681059                        (patch.env_rate[5], patch.env_offset[4],
    10691060                         patch.env_offset[5]);
    1070                 zone->v.parm.volatkhld =
     1061                zone->v.parm.volatkhld = 
    10711062                        (snd_sf_calc_parm_hold(hold) << 8) |
    10721063                        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
    12/*
    23 *  Copyright (C) 2000 Takashi Iwai <tiwai@suse.de>
    34 *
    45 *  Generic memory management routines for soundcard memory allocation
    5  *
    6  *   This program is free software; you can redistribute it and/or modify
    7  *   it under the terms of the GNU General Public License as published by
    8  *   the Free Software Foundation; either version 2 of the License, or
    9  *   (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 of
    13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  *   GNU General Public License for more details.
    15  *
    16  *   You should have received a copy of the GNU General Public License
    17  *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    196 */
    207
     
    229#include <linux/init.h>
    2310#include <linux/slab.h>
     11#include <linux/module.h>
    2412#include <sound/core.h>
    2513#include <sound/util_mem.h>
     
    193181EXPORT_SYMBOL(__snd_util_mem_free);
    194182EXPORT_SYMBOL(__snd_util_memblk_new);
    195 
    196 /*
    197  *  INIT part
    198  */
    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.