~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/emu10k1/emu10k1_synth.c

Version: ~ [ linux-6.1-rc5 ] ~ [ linux-6.0.8 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.78 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.154 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.224 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.265 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.299 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.333 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/pci/emu10k1/emu10k1_synth.c (Version linux-5.7.19) and /sound/pci/emu10k1/emu10k1_synth.c (Version linux-4.0.9)


  1 // SPDX-License-Identifier: GPL-2.0-or-later   << 
  2 /*                                                  1 /*
  3  *  Copyright (C) 2000 Takashi Iwai <tiwai@sus      2  *  Copyright (C) 2000 Takashi Iwai <tiwai@suse.de>
  4  *                                                  3  *
  5  *  Routines for control of EMU10K1 WaveTable       4  *  Routines for control of 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
  6  */                                                19  */
  7                                                    20 
  8 #include "emu10k1_synth_local.h"                   21 #include "emu10k1_synth_local.h"
  9 #include <linux/init.h>                            22 #include <linux/init.h>
 10 #include <linux/module.h>                          23 #include <linux/module.h>
 11                                                    24 
 12 MODULE_AUTHOR("Takashi Iwai");                     25 MODULE_AUTHOR("Takashi Iwai");
 13 MODULE_DESCRIPTION("Routines for control of EM     26 MODULE_DESCRIPTION("Routines for control of EMU10K1 WaveTable synth");
 14 MODULE_LICENSE("GPL");                             27 MODULE_LICENSE("GPL");
 15                                                    28 
 16 /*                                                 29 /*
 17  * create a new hardware dependent device for      30  * create a new hardware dependent device for Emu10k1
 18  */                                                31  */
 19 static int snd_emu10k1_synth_probe(struct devi !!  32 static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
 20 {                                                  33 {
 21         struct snd_seq_device *dev = to_seq_de << 
 22         struct snd_emux *emux;                     34         struct snd_emux *emux;
 23         struct snd_emu10k1 *hw;                    35         struct snd_emu10k1 *hw;
 24         struct snd_emu10k1_synth_arg *arg;         36         struct snd_emu10k1_synth_arg *arg;
 25         unsigned long flags;                       37         unsigned long flags;
 26                                                    38 
 27         arg = SNDRV_SEQ_DEVICE_ARGPTR(dev);        39         arg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
 28         if (arg == NULL)                           40         if (arg == NULL)
 29                 return -EINVAL;                    41                 return -EINVAL;
 30                                                    42 
 31         if (arg->seq_ports <= 0)                   43         if (arg->seq_ports <= 0)
 32                 return 0; /* nothing */            44                 return 0; /* nothing */
 33         if (arg->max_voices < 1)                   45         if (arg->max_voices < 1)
 34                 arg->max_voices = 1;               46                 arg->max_voices = 1;
 35         else if (arg->max_voices > 64)             47         else if (arg->max_voices > 64)
 36                 arg->max_voices = 64;              48                 arg->max_voices = 64;
 37                                                    49 
 38         if (snd_emux_new(&emux) < 0)               50         if (snd_emux_new(&emux) < 0)
 39                 return -ENOMEM;                    51                 return -ENOMEM;
 40                                                    52 
 41         snd_emu10k1_ops_setup(emux);               53         snd_emu10k1_ops_setup(emux);
 42         hw = arg->hwptr;                           54         hw = arg->hwptr;
 43         emux->hw = hw;                             55         emux->hw = hw;
 44         emux->max_voices = arg->max_voices;        56         emux->max_voices = arg->max_voices;
 45         emux->num_ports = arg->seq_ports;          57         emux->num_ports = arg->seq_ports;
 46         emux->pitch_shift = -501;                  58         emux->pitch_shift = -501;
 47         emux->memhdr = hw->memhdr;                 59         emux->memhdr = hw->memhdr;
 48         /* maximum two ports */                    60         /* maximum two ports */
 49         emux->midi_ports = arg->seq_ports < 2      61         emux->midi_ports = arg->seq_ports < 2 ? arg->seq_ports : 2;
 50         /* audigy has two external midis */        62         /* audigy has two external midis */
 51         emux->midi_devidx = hw->audigy ? 2 : 1     63         emux->midi_devidx = hw->audigy ? 2 : 1;
 52         emux->linear_panning = 0;                  64         emux->linear_panning = 0;
 53         emux->hwdep_idx = 2; /* FIXED */           65         emux->hwdep_idx = 2; /* FIXED */
 54                                                    66 
 55         if (snd_emux_register(emux, dev->card,     67         if (snd_emux_register(emux, dev->card, arg->index, "Emu10k1") < 0) {
 56                 snd_emux_free(emux);               68                 snd_emux_free(emux);
 57                 return -ENOMEM;                    69                 return -ENOMEM;
 58         }                                          70         }
 59                                                    71 
 60         spin_lock_irqsave(&hw->voice_lock, fla     72         spin_lock_irqsave(&hw->voice_lock, flags);
 61         hw->synth = emux;                          73         hw->synth = emux;
 62         hw->get_synth_voice = snd_emu10k1_synt     74         hw->get_synth_voice = snd_emu10k1_synth_get_voice;
 63         spin_unlock_irqrestore(&hw->voice_lock     75         spin_unlock_irqrestore(&hw->voice_lock, flags);
 64                                                    76 
 65         dev->driver_data = emux;                   77         dev->driver_data = emux;
 66                                                    78 
 67         return 0;                                  79         return 0;
 68 }                                                  80 }
 69                                                    81 
 70 static int snd_emu10k1_synth_remove(struct dev !!  82 static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
 71 {                                                  83 {
 72         struct snd_seq_device *dev = to_seq_de << 
 73         struct snd_emux *emux;                     84         struct snd_emux *emux;
 74         struct snd_emu10k1 *hw;                    85         struct snd_emu10k1 *hw;
 75         unsigned long flags;                       86         unsigned long flags;
 76                                                    87 
 77         if (dev->driver_data == NULL)              88         if (dev->driver_data == NULL)
 78                 return 0; /* not registered ac     89                 return 0; /* not registered actually */
 79                                                    90 
 80         emux = dev->driver_data;                   91         emux = dev->driver_data;
 81                                                    92 
 82         hw = emux->hw;                             93         hw = emux->hw;
 83         spin_lock_irqsave(&hw->voice_lock, fla     94         spin_lock_irqsave(&hw->voice_lock, flags);
 84         hw->synth = NULL;                          95         hw->synth = NULL;
 85         hw->get_synth_voice = NULL;                96         hw->get_synth_voice = NULL;
 86         spin_unlock_irqrestore(&hw->voice_lock     97         spin_unlock_irqrestore(&hw->voice_lock, flags);
 87                                                    98 
 88         snd_emux_free(emux);                       99         snd_emux_free(emux);
 89         return 0;                                 100         return 0;
 90 }                                                 101 }
 91                                                   102 
 92 /*                                                103 /*
 93  *  INIT part                                     104  *  INIT part
 94  */                                               105  */
 95                                                   106 
 96 static struct snd_seq_driver emu10k1_synth_dri !! 107 static int __init alsa_emu10k1_synth_init(void)
 97         .driver = {                            !! 108 {
 98                 .name = KBUILD_MODNAME,        !! 109         
 99                 .probe = snd_emu10k1_synth_pro !! 110         static struct snd_seq_dev_ops ops = {
100                 .remove = snd_emu10k1_synth_re !! 111                 snd_emu10k1_synth_new_device,
101         },                                     !! 112                 snd_emu10k1_synth_delete_device,
102         .id = SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,  !! 113         };
103         .argsize = sizeof(struct snd_emu10k1_s !! 114         return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops,
104 };                                             !! 115                                               sizeof(struct snd_emu10k1_synth_arg));
                                                   >> 116 }
                                                   >> 117 
                                                   >> 118 static void __exit alsa_emu10k1_synth_exit(void)
                                                   >> 119 {
                                                   >> 120         snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH);
                                                   >> 121 }
105                                                   122 
106 module_snd_seq_driver(emu10k1_synth_driver);   !! 123 module_init(alsa_emu10k1_synth_init)
                                                   >> 124 module_exit(alsa_emu10k1_synth_exit)
107                                                   125 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp