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

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

Version: ~ [ linux-6.1-rc7 ] ~ [ linux-6.0.10 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.80 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.156 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.225 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.267 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.300 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.334 ] ~ [ 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 (Architecture i386) and /sound/pci/emu10k1/emu10k1_synth.c (Architecture sparc64)


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

~ [ 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