Changeset 679 for GPL/trunk/alsa-kernel/isa/sb/sb8.c
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
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/isa/sb/sb8.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Driver for SoundBlaster 1.0/2.0/Pro soundcards and compatible 3 4 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 4 *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 5 */ 21 6 … … 24 9 #include <linux/isa.h> 25 10 #include <linux/ioport.h> 26 #include <linux/module param.h>11 #include <linux/module.h> 27 12 #include <sound/core.h> 28 13 #include <sound/sb.h> … … 37 22 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 38 23 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 39 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */24 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 40 25 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 41 26 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ … … 48 33 module_param_array(enable, bool, NULL, 0444); 49 34 MODULE_PARM_DESC(enable, "Enable Sound Blaster soundcard."); 50 module_param_ array(port, long, NULL, 0444);35 module_param_hw_array(port, long, ioport, NULL, 0444); 51 36 MODULE_PARM_DESC(port, "Port # for SB8 driver."); 52 module_param_ array(irq, int, NULL, 0444);37 module_param_hw_array(irq, int, irq, NULL, 0444); 53 38 MODULE_PARM_DESC(irq, "IRQ # for SB8 driver."); 54 module_param_ array(dma8, int, NULL, 0444);39 module_param_hw_array(dma8, int, dma, NULL, 0444); 55 40 MODULE_PARM_DESC(dma8, "8-bit DMA # for SB8 driver."); 56 41 … … 80 65 } 81 66 82 static int __devinitsnd_sb8_match(struct device *pdev, unsigned int dev)67 static int snd_sb8_match(struct device *pdev, unsigned int dev) 83 68 { 84 69 if (!enable[dev]) … … 95 80 } 96 81 97 static int __devinitsnd_sb8_probe(struct device *pdev, unsigned int dev)82 static int snd_sb8_probe(struct device *pdev, unsigned int dev) 98 83 { 99 84 struct snd_sb *chip; … … 103 88 int err; 104 89 105 err = snd_card_ create(index[dev], id[dev], THIS_MODULE,106 90 err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, 91 sizeof(struct snd_sb8), &card); 107 92 if (err < 0) 108 93 return err; … … 112 97 /* block the 0x388 port to avoid PnP conflicts */ 113 98 acard->fm_res = request_region(0x388, 4, "SoundBlaster FM"); 99 if (!acard->fm_res) { 100 err = -EBUSY; 101 goto _err; 102 } 114 103 115 104 if (port[dev] != SNDRV_AUTO_PORT) { … … 123 112 } else { 124 113 /* auto-probe legacy ports */ 125 static unsigned long possible_ports[] = {114 static const unsigned long possible_ports[] = { 126 115 0x220, 0x240, 0x260, 127 116 }; … … 158 147 } 159 148 160 if ((err = snd_sb8dsp_pcm(chip, 0 , NULL)) < 0)149 if ((err = snd_sb8dsp_pcm(chip, 0)) < 0) 161 150 goto _err; 162 151 … … 183 172 } 184 173 185 if ((err = snd_sb8dsp_midi(chip, 0 , NULL)) < 0)174 if ((err = snd_sb8dsp_midi(chip, 0)) < 0) 186 175 goto _err; 187 176 … … 193 182 irq[dev], dma8[dev]); 194 183 195 snd_card_set_dev(card, pdev);196 197 184 if ((err = snd_card_register(card)) < 0) 198 185 goto _err; … … 206 193 } 207 194 208 static int __devexitsnd_sb8_remove(struct device *pdev, unsigned int dev)195 static int snd_sb8_remove(struct device *pdev, unsigned int dev) 209 196 { 210 197 snd_card_free(dev_get_drvdata(pdev)); 211 dev_set_drvdata(pdev, NULL);212 198 return 0; 213 199 } … … 222 208 223 209 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 224 snd_pcm_suspend_all(chip->pcm);225 210 snd_sbmixer_suspend(chip); 226 211 return 0; … … 245 230 .match = snd_sb8_match, 246 231 .probe = snd_sb8_probe, 247 .remove = __devexit_p(snd_sb8_remove),232 .remove = snd_sb8_remove, 248 233 #ifdef CONFIG_PM 249 234 .suspend = snd_sb8_suspend, … … 255 240 }; 256 241 257 static int __init alsa_card_sb8_init(void) 258 { 259 return isa_register_driver(&snd_sb8_driver, SNDRV_CARDS); 260 } 261 262 static void __exit alsa_card_sb8_exit(void) 263 { 264 isa_unregister_driver(&snd_sb8_driver); 265 } 266 267 module_init(alsa_card_sb8_init) 268 module_exit(alsa_card_sb8_exit) 242 module_isa_driver(snd_sb8_driver, SNDRV_CARDS);
Note:
See TracChangeset
for help on using the changeset viewer.