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

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/isa/gus/gusextreme.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Driver for Gravis UltraSound Extreme soundcards
    34 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
    4  *
    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  *
    205 */
    216
     
    2510#include <linux/delay.h>
    2611#include <linux/time.h>
    27 #include <linux/moduleparam.h>
     12#include <linux/module.h>
    2813#include <asm/dma.h>
    2914#include <sound/core.h>
     
    4732static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;      /* Index 0-MAX */
    4833static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */
    49 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;  /* Enable this card */
     34static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
    5035static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* 0x220,0x240,0x260 */
    5136static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */
     
    6752module_param_array(enable, bool, NULL, 0444);
    6853MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard.");
    69 module_param_array(port, long, NULL, 0444);
     54module_param_hw_array(port, long, ioport, NULL, 0444);
    7055MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver.");
    71 module_param_array(gf1_port, long, NULL, 0444);
     56module_param_hw_array(gf1_port, long, ioport, NULL, 0444);
    7257MODULE_PARM_DESC(gf1_port, "GF1 port # for " CRD_NAME " driver (optional).");
    73 module_param_array(mpu_port, long, NULL, 0444);
     58module_param_hw_array(mpu_port, long, ioport, NULL, 0444);
    7459MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver.");
    75 module_param_array(irq, int, NULL, 0444);
     60module_param_hw_array(irq, int, irq, NULL, 0444);
    7661MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver.");
    77 module_param_array(mpu_irq, int, NULL, 0444);
     62module_param_hw_array(mpu_irq, int, irq, NULL, 0444);
    7863MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver.");
    79 module_param_array(gf1_irq, int, NULL, 0444);
     64module_param_hw_array(gf1_irq, int, irq, NULL, 0444);
    8065MODULE_PARM_DESC(gf1_irq, "GF1 IRQ # for " CRD_NAME " driver.");
    81 module_param_array(dma8, int, NULL, 0444);
     66module_param_hw_array(dma8, int, dma, NULL, 0444);
    8267MODULE_PARM_DESC(dma8, "8-bit DMA # for " CRD_NAME " driver.");
    83 module_param_array(dma1, int, NULL, 0444);
     68module_param_hw_array(dma1, int, dma, NULL, 0444);
    8469MODULE_PARM_DESC(dma1, "GF1 DMA # for " CRD_NAME " driver.");
    8570module_param_array(joystick_dac, int, NULL, 0444);
     
    9075MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver.");
    9176
    92 static int __devinit snd_gusextreme_match(struct device *dev, unsigned int n)
     77static int snd_gusextreme_match(struct device *dev, unsigned int n)
    9378{
    9479        return enable[n];
    9580}
    9681
    97 static int __devinit snd_gusextreme_es1688_create(struct snd_card *card,
    98                 struct snd_es1688 *chip, struct device *dev, unsigned int n)
    99 {
    100         static long possible_ports[] = {0x220, 0x240, 0x260};
    101         static int possible_irqs[] = {5, 9, 10, 7, -1};
    102         static int possible_dmas[] = {1, 3, 0, -1};
     82static int snd_gusextreme_es1688_create(struct snd_card *card,
     83                                        struct snd_es1688 *chip,
     84                                        struct device *dev, unsigned int n)
     85{
     86        static const long possible_ports[] = {0x220, 0x240, 0x260};
     87        static const int possible_irqs[] = {5, 9, 10, 7, -1};
     88        static const int possible_dmas[] = {1, 3, 0, -1};
    10389
    10490        int i, error;
     
    133119}
    134120
    135 static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card,
    136                 struct device *dev, unsigned int n, struct snd_gus_card **rgus)
    137 {
    138         static int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1};
    139         static int possible_dmas[] = {5, 6, 7, 3, 1, -1};
     121static int snd_gusextreme_gus_card_create(struct snd_card *card,
     122                                          struct device *dev, unsigned int n,
     123                                          struct snd_gus_card **rgus)
     124{
     125        static const int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1};
     126        static const int possible_dmas[] = {5, 6, 7, 3, 1, -1};
    140127
    141128        if (gf1_irq[n] == SNDRV_AUTO_IRQ) {
     
    157144}
    158145
    159 static int __devinit snd_gusextreme_detect(struct snd_gus_card *gus,
    160         struct snd_es1688 *es1688)
     146static int snd_gusextreme_detect(struct snd_gus_card *gus,
     147                                 struct snd_es1688 *es1688)
    161148{
    162149        unsigned long flags;
     
    207194}
    208195
    209 static int __devinit snd_gusextreme_mixer(struct snd_card *card)
     196static int snd_gusextreme_mixer(struct snd_card *card)
    210197{
    211198        struct snd_ctl_elem_id id1, id2;
     
    233220}
    234221
    235 static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
     222static int snd_gusextreme_probe(struct device *dev, unsigned int n)
    236223{
    237224        struct snd_card *card;
     
    241228        int error;
    242229
    243         error = snd_card_create(index[n], id[n], THIS_MODULE,
    244                                 sizeof(struct snd_es1688), &card);
     230        error = snd_card_new(dev, index[n], id[n], THIS_MODULE,
     231                             sizeof(struct snd_es1688), &card);
    245232        if (error < 0)
    246233                return error;
     
    283270        gus->codec_flag = 1;
    284271
    285         error = snd_es1688_pcm(card, es1688, 0, NULL);
     272        error = snd_es1688_pcm(card, es1688, 0);
    286273        if (error < 0)
    287274                goto out;
     
    294281
    295282        if (pcm_channels[n] > 0) {
    296                 error = snd_gf1_pcm_new(gus, 1, 1, NULL);
     283                error = snd_gf1_pcm_new(gus, 1, 1);
    297284                if (error < 0)
    298285                        goto out;
     
    318305        if (es1688->mpu_port >= 0x300) {
    319306                error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
    320                                 es1688->mpu_port, 0,
    321                                 mpu_irq[n], IRQF_DISABLED, NULL);
     307                                es1688->mpu_port, 0, mpu_irq[n], NULL);
    322308                if (error < 0)
    323309                        goto out;
     
    328314                gus->gf1.irq, es1688->irq, gus->gf1.dma1, es1688->dma8);
    329315
    330         snd_card_set_dev(card, dev);
    331 
    332316        error = snd_card_register(card);
    333317        if (error < 0)
     
    341325}
    342326
    343 static int __devexit snd_gusextreme_remove(struct device *dev, unsigned int n)
     327static int snd_gusextreme_remove(struct device *dev, unsigned int n)
    344328{
    345329        snd_card_free(dev_get_drvdata(dev));
    346         dev_set_drvdata(dev, NULL);
    347330        return 0;
    348331}
     
    351334        .match          = snd_gusextreme_match,
    352335        .probe          = snd_gusextreme_probe,
    353         .remove         = __devexit_p(snd_gusextreme_remove),
     336        .remove         = snd_gusextreme_remove,
    354337#if 0   /* FIXME */
    355338        .suspend        = snd_gusextreme_suspend,
     
    361344};
    362345
    363 static int __init alsa_card_gusextreme_init(void)
    364 {
    365         return isa_register_driver(&snd_gusextreme_driver, SNDRV_CARDS);
    366 }
    367 
    368 static void __exit alsa_card_gusextreme_exit(void)
    369 {
    370         isa_unregister_driver(&snd_gusextreme_driver);
    371 }
    372 
    373 module_init(alsa_card_gusextreme_init);
    374 module_exit(alsa_card_gusextreme_exit);
     346module_isa_driver(snd_gusextreme_driver, SNDRV_CARDS);
Note: See TracChangeset for help on using the changeset viewer.