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:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_drums.c

    r305 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Uros Bizjak <uros@kss-loka.si>
    34 *
    45 *   OPL2/OPL3/OPL4 FM routines for internal percussion channels
    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 "opl3_voice.h"
    239
    24 extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
    25 
    26 static char snd_opl3_drum_table[47] =
     10static const char snd_opl3_drum_table[47] =
    2711{
    2812        OPL3_BASSDRUM_ON,  OPL3_BASSDRUM_ON,  OPL3_HIHAT_ON,    /* 35 - 37 */
     
    6448};
    6549
    66 static struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
    67 static struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
    68 static struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09};
    69 
    70 static struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
    71 
    72 static struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
    73 static struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d};
    74 
    75 static struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
    76 static struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09};
    77 
    78 static struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
     50static const struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
     51static const struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
     52static const struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09};
     53
     54static const struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
     55
     56static const struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
     57static const struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d};
     58
     59static const struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
     60static const struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09};
     61
     62static const struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
    7963
    8064/*
     
    8266 */
    8367static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,
    84                                     struct snd_opl3_drum_voice *data)
     68                                    const struct snd_opl3_drum_voice *data)
    8569{
    8670        unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
     
    117101 */
    118102static void snd_opl3_drum_note_set(struct snd_opl3 *opl3,
    119                                    struct snd_opl3_drum_note *data)
     103                                   const struct snd_opl3_drum_note *data)
    120104{
    121105        unsigned char voice_offset = data->voice;
     
    135119 */
    136120static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3,
    137                                   struct snd_opl3_drum_voice *data,
     121                                  const struct snd_opl3_drum_voice *data,
    138122                                  int vel, struct snd_midi_channel *chan)
    139123{
     
    187171{
    188172        unsigned char drum_mask;
    189         struct snd_opl3_drum_voice *drum_voice;
     173        const struct snd_opl3_drum_voice *drum_voice;
    190174
    191175        if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE))
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_lib.c

    r426 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
     
    78 *
    89 *  Most if code is ported from OSS/Lite.
    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
    23  *
    2410 */
    2511
    2612#include <sound/opl3.h>
    27 #include <asm/io.h>
     13#include <linux/io.h>
    2814#include <linux/delay.h>
     15#include <linux/module.h>
    2916#include <linux/init.h>
    3017#include <linux/slab.h>
    3118#include <linux/ioport.h>
    3219#include <sound/minors.h>
     20#include "opl3_voice.h"
    3321
    3422MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Hannu Savolainen 1993-1996, Rob Hooft");
    3523MODULE_DESCRIPTION("Routines for control of AdLib FM cards (OPL2/OPL3/OPL4 chips)");
    3624MODULE_LICENSE("GPL");
    37 
    38 extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
    3925
    4026static void snd_opl2_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
     
    229215 */
    230216
    231 static struct snd_timer_hardware snd_opl3_timer1 =
     217static const struct snd_timer_hardware snd_opl3_timer1 =
    232218{
    233219        .flags =        SNDRV_TIMER_HW_STOP,
     
    238224};
    239225
    240 static struct snd_timer_hardware snd_opl3_timer2 =
     226static const struct snd_timer_hardware snd_opl3_timer2 =
    241227{
    242228        .flags =        SNDRV_TIMER_HW_STOP,
     
    347333                 struct snd_opl3 **ropl3)
    348334{
    349         static struct snd_device_ops ops = {
     335        static const struct snd_device_ops ops = {
    350336                .dev_free = snd_opl3_dev_free,
    351337        };
     
    355341        *ropl3 = NULL;
    356342        opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
    357         if (opl3 == NULL) {
    358                 snd_printk(KERN_ERR "opl3: cannot allocate\n");
     343        if (!opl3)
    359344                return -ENOMEM;
    360         }
    361345
    362346        opl3->card = card;
     
    501485        hw->exclusive = 1;
    502486#ifdef CONFIG_SND_OSSEMUL
    503         if (device == 0) {
     487        if (device == 0)
    504488                hw->oss_type = SNDRV_OSS_DEVICE_TYPE_DMFM;
    505                 sprintf(hw->oss_dev, "dmfm%i", card->number);
    506         }
    507489#endif
    508490        strcpy(hw->name, hw->id);
     
    530512        opl3->hwdep = hw;
    531513        opl3->seq_dev_num = seq_device;
    532 #if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
     514#if IS_ENABLED(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER)
    533515        if (snd_seq_device_new(card, seq_device, SNDRV_SEQ_DEV_ID_OPL3,
    534516                               sizeof(struct snd_opl3 *), &opl3->seq_dev) >= 0) {
     
    543525
    544526EXPORT_SYMBOL(snd_opl3_hwdep_new);
    545 
    546 /*
    547  *  INIT part
    548  */
    549 
    550 static int __init alsa_opl3_init(void)
    551 {
    552         return 0;
    553 }
    554 
    555 static void __exit alsa_opl3_exit(void)
    556 {
    557 }
    558 
    559 module_init(alsa_opl3_init)
    560 module_exit(alsa_opl3_exit)
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_midi.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Uros Bizjak <uros@kss-loka.si>
    34 *
    45 *  Midi synth routines for OPL2/OPL3/OPL4 FM
    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
     
    2511#include "opl3_voice.h"
    2612#include <sound/asoundef.h>
    27 
    28 extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
    29 
    30 extern int use_internal_drums;
    3113
    3214static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
     
    4224 */
    4325
    44 static char opl3_volume_table[128] =
     26static const char opl3_volume_table[128] =
    4527{
    4628        -63, -48, -40, -35, -32, -29, -27, -26,
     
    8870 * Converts the note frequency to block and fnum values for the FM chip
    8971 */
    90 static short opl3_note_table[16] =
     72static const short opl3_note_table[16] =
    9173{
    9274        305, 323,       /* for pitch bending, -2 semitones */
     
    10688                int segment;
    10789
     90                if (pitchbend < -0x2000)
     91                        pitchbend = -0x2000;
    10892                if (pitchbend > 0x1FFF)
    10993                        pitchbend = 0x1FFF;
     
    130114        printk(KERN_DEBUG "time %.5i: %s [%.2i]: ", opl3->use_time, s, voice);
    131115        for (i = 0; i < opl3->max_voices; i++)
    132                 printk("%c", *(str + opl3->voices[i].state + 1));
    133         printk("\n");
     116                printk(KERN_CONT "%c", *(str + opl3->voices[i].state + 1));
     117        printk(KERN_CONT "\n");
    134118}
    135119#endif
     
    164148
    165149        for (i = 0; i < END; i++) {
    166                 best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */;
     150                best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */
    167151                best[i].voice = -1;
    168152        }
     
    234218/* ------------------------------ */
    235219
     220#define from_timer(var, callback_timer, timer_fieldname) \
     221        container_of(callback_timer, struct snd_opl3, timer_fieldname)
     222
    236223/*
    237224 * System timer interrupt function
    238225 */
    239 void snd_opl3_timer_func(unsigned long data)
    240 {
    241 
    242         struct snd_opl3 *opl3 = (struct snd_opl3 *)data;
     226void snd_opl3_timer_func(struct timer_list *t)
     227{
     228
     229        struct snd_opl3 *opl3 = from_timer(opl3, t, tlist);
    243230        unsigned long flags;
    244231        int again = 0;
     
    259246
    260247        spin_lock_irqsave(&opl3->sys_timer_lock, flags);
    261         if (again) {
    262                 opl3->tlist.expires = jiffies + 1;      /* invoke again */
    263                 add_timer(&opl3->tlist);
    264         } else {
     248        if (again)
     249                mod_timer(&opl3->tlist, jiffies + 1);   /* invoke again */
     250        else
    265251                opl3->sys_timer_status = 0;
    266         }
    267252        spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
    268253}
     
    276261        spin_lock_irqsave(&opl3->sys_timer_lock, flags);
    277262        if (! opl3->sys_timer_status) {
    278                 opl3->tlist.expires = jiffies + 1;
    279                 add_timer(&opl3->tlist);
     263                mod_timer(&opl3->tlist, jiffies + 1);
    280264                opl3->sys_timer_status = 1;
    281265        }
     
    286270
    287271
    288 static int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
     272static const int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
    289273        0, 1, 2, 9, 10, 11, 6, 7, 8, 15, 16, 17, 3, 4 ,5, 12, 13, 14
    290274};
     
    374358                        break;
    375359                }
     360                fallthrough;
    376361        default:
    377362                spin_unlock_irqrestore(&opl3->voice_lock, flags);
     
    389374                /* remap OSS voice */
    390375                voice = snd_opl3_oss_map[chan->number];         
     376        }
     377
     378        if (voice < 0) {
     379                spin_unlock_irqrestore(&opl3->voice_lock, flags);
     380                return;
    391381        }
    392382
     
    457447                case 0x03:
    458448                        snd_opl3_calc_volume(&vol_op[2], vel, chan);
    459                         /* fallthru */
     449                fallthrough;
    460450                case 0x02:
    461451                        snd_opl3_calc_volume(&vol_op[0], vel, chan);
     
    718708void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
    719709{
    720         struct snd_opl3 *opl3;
    721 
    722         opl3 = p;
    723710#ifdef DEBUG_MIDI
    724711        snd_printk(KERN_DEBUG "Key pressure, ch#: %i, inst#: %i\n",
     
    732719void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)
    733720{
    734         struct snd_opl3 *opl3;
    735 
    736         opl3 = p;
    737721#ifdef DEBUG_MIDI
    738722        snd_printk(KERN_DEBUG "Terminate note, ch#: %i, inst#: %i\n",
     
    858842                   struct snd_midi_channel_set *chset)
    859843{
    860         struct snd_opl3 *opl3;
    861 
    862         opl3 = p;
    863844#ifdef DEBUG_MIDI
    864845        snd_printk(KERN_DEBUG "NRPN, ch#: %i, inst#: %i\n",
     
    873854                    int parsed, struct snd_midi_channel_set *chset)
    874855{
    875         struct snd_opl3 *opl3;
    876 
    877         opl3 = p;
    878856#ifdef DEBUG_MIDI
    879857        snd_printk(KERN_DEBUG "SYSEX\n");
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_seq.c

    r305 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Uros Bizjak <uros@kss-loka.si>
     
    67 *  OPL2/3 FM instrument loader:
    78 *   alsa-tools/seq/sbiload/
    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
     
    2612#include <linux/init.h>
    2713#include <linux/moduleparam.h>
     14#include <linux/module.h>
    2815#include <sound/initval.h>
    2916
     
    3118MODULE_LICENSE("GPL");
    3219MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth");
    33 
    34 int use_internal_drums = 0;
     20#ifdef TARGET_OS2
     21#define KBUILD_MODNAME "opl3_seq"
     22#endif
     23
     24bool use_internal_drums = 0;
    3525module_param(use_internal_drums, bool, 0444);
    3626MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");
     
    111101        if (use_internal_drums) {
    112102                /* Percussion mode */
    113                 opl3->voices[6].state = opl3->voices[7].state = 
     103                opl3->voices[6].state = opl3->voices[7].state =
    114104                        opl3->voices[8].state = SNDRV_OPL3_ST_NOT_AVAIL;
    115105                snd_opl3_load_drums(opl3);
     
    142132 * MIDI emulation operators
    143133 */
    144 struct snd_midi_op opl3_ops = {
     134const struct snd_midi_op opl3_ops = {
    145135        .note_on =              snd_opl3_note_on,
    146136        .note_off =             snd_opl3_note_off,
     
    216206/* ------------------------------ */
    217207
    218 static int snd_opl3_seq_new_device(struct snd_seq_device *dev)
    219 {
     208static int snd_opl3_seq_probe(struct device *_dev)
     209{
     210        struct snd_seq_device *dev = to_seq_dev(_dev);
    220211        struct snd_opl3 *opl3;
    221212        int client, err;
     
    247238
    248239        /* setup system timer */
     240#ifndef TARGET_OS2
     241        timer_setup(&opl3->tlist, snd_opl3_timer_func, 0);
     242#else
    249243        init_timer(&opl3->tlist);
    250         opl3->tlist.function = snd_opl3_timer_func;
     244        opl3->tlist.function = (void(*)(unsigned long))snd_opl3_timer_func;
    251245        opl3->tlist.data = (unsigned long) opl3;
     246#endif
    252247        spin_lock_init(&opl3->sys_timer_lock);
    253248        opl3->sys_timer_status = 0;
    254249
    255 #ifdef CONFIG_SND_SEQUENCER_OSS
     250#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    256251        snd_opl3_init_seq_oss(opl3, name);
    257252#endif
     
    259254}
    260255
    261 static int snd_opl3_seq_delete_device(struct snd_seq_device *dev)
    262 {
     256static int snd_opl3_seq_remove(struct device *_dev)
     257{
     258        struct snd_seq_device *dev = to_seq_dev(_dev);
    263259        struct snd_opl3 *opl3;
    264260
     
    267263                return -EINVAL;
    268264
    269 #ifdef CONFIG_SND_SEQUENCER_OSS
     265#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    270266        snd_opl3_free_seq_oss(opl3);
    271267#endif
     
    277273}
    278274
    279 static int __init alsa_opl3_seq_init(void)
    280 {
    281         static struct snd_seq_dev_ops ops =
    282         {
    283                 snd_opl3_seq_new_device,
    284                 snd_opl3_seq_delete_device
    285         };
    286 
    287         return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL3, &ops,
    288                                               sizeof(struct snd_opl3 *));
    289 }
    290 
    291 static void __exit alsa_opl3_seq_exit(void)
    292 {
    293         snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_OPL3);
    294 }
    295 
    296 module_init(alsa_opl3_seq_init)
    297 module_exit(alsa_opl3_seq_exit)
     275static struct snd_seq_driver opl3_seq_driver = {
     276        .driver = {
     277                .name = KBUILD_MODNAME,
     278                .probe = snd_opl3_seq_probe,
     279                .remove = snd_opl3_seq_remove,
     280        },
     281        .id = SNDRV_SEQ_DEV_ID_OPL3,
     282        .argsize = sizeof(struct snd_opl3 *),
     283};
     284
     285module_snd_seq_driver(opl3_seq_driver);
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_synth.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Uros Bizjak <uros@kss-loka.si>
    34 *                   
    45 *  Routines for OPL2/OPL3/OPL4 control
    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 <linux/slab.h>
     9#include <linux/export.h>
     10#include <linux/nospec.h>
    2311#include <sound/opl3.h>
    2412#include <sound/asound_fm.h>
    25 
    26 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
     13#include "opl3_voice.h"
     14
     15#if (IS_ENABLED(CONFIG_SND_SEQUENCER) || defined TARGET_OS2)
    2716#define OPL3_SUPPORT_SYNTH
    2817#endif
     
    10291                {
    10392                        struct snd_dm_fm_info info;
     93
     94                        memset(&info, 0, sizeof(info));
    10495
    10596                        info.fm_mode = opl3->fm_mode;
     
    311302 * new patch object.
    312303 */
     304
    313305struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
    314306                                     int create_patch)
     
    448440        unsigned short reg_side;
    449441        unsigned char op_offset;
    450         unsigned char voice_offset;
     442        unsigned char voice_offset, voice_op;
    451443
    452444        unsigned short opl3_reg;
     
    473465        }
    474466        /* Get register offset of operator */
    475         op_offset = snd_opl3_regmap[voice_offset][voice->op];
     467        voice_offset = array_index_nospec(voice_offset, MAX_OPL2_VOICES);
     468        voice_op = array_index_nospec(voice->op, 4);
     469        op_offset = snd_opl3_regmap[voice_offset][voice_op];
    476470
    477471        reg_val = 0x00;
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_voice.h

    r305 r679  
     1/* SPDX-License-Identifier: GPL-2.0-or-later */
    12#ifndef __OPL3_VOICE_H
    23#define __OPL3_VOICE_H
     
    45/*
    56 *  Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si>
    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
     
    3825
    3926void snd_opl3_calc_volume(unsigned char *reg, int vel, struct snd_midi_channel *chan);
    40 void snd_opl3_timer_func(unsigned long data);
     27void snd_opl3_timer_func(struct timer_list *t);
    4128
    4229/* Prototypes for opl3_drums.c */
    4330void snd_opl3_load_drums(struct snd_opl3 *opl3);
    44 void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
     31void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan);
    4532
    4633/* Prototypes for opl3_oss.c */
    47 #ifdef CONFIG_SND_SEQUENCER_OSS
     34#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
    4835void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name);
    4936void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);
     37#else
     38#define snd_opl3_init_seq_oss(opl3, name) /* NOP */
     39#define snd_opl3_free_seq_oss(opl3) /* NOP */
    5040#endif
    5141
     42extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
     43extern bool use_internal_drums;
     44extern const struct snd_midi_op opl3_ops;
     45
    5246#endif
Note: See TracChangeset for help on using the changeset viewer.