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/wavefront/wavefront.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  ALSA card-level driver for Turtle Beach Wavefront cards
     
    45 *
    56 *  Copyright (c) 1997-1999 by Paul Barton-Davis <pbd@op.net>
    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
     
    2512#include <linux/isa.h>
    2613#include <linux/pnp.h>
    27 #include <linux/moduleparam.h>
     14#include <linux/module.h>
    2815#include <sound/core.h>
    2916#include <sound/initval.h>
     
    3926static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;          /* Index 0-MAX */
    4027static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;           /* ID for this card */
    41 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;      /* Enable this card */
     28static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;     /* Enable this card */
    4229#ifdef CONFIG_PNP
    43 static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
     30static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
    4431#endif
    4532static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;  /* PnP setup */
     
    5239static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;           /* 0,1,3,5,6,7 */
    5340static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;           /* 0,1,3,5,6,7 */
    54 static int use_cs4232_midi[SNDRV_CARDS];
     41static bool use_cs4232_midi[SNDRV_CARDS];
    5542
    5643module_param_array(index, int, NULL, 0444);
     
    6451MODULE_PARM_DESC(isapnp, "ISA PnP detection for WaveFront soundcards.");
    6552#endif
    66 module_param_array(cs4232_pcm_port, long, NULL, 0444);
     53module_param_hw_array(cs4232_pcm_port, long, ioport, NULL, 0444);
    6754MODULE_PARM_DESC(cs4232_pcm_port, "Port # for CS4232 PCM interface.");
    68 module_param_array(cs4232_pcm_irq, int, NULL, 0444);
     55module_param_hw_array(cs4232_pcm_irq, int, irq, NULL, 0444);
    6956MODULE_PARM_DESC(cs4232_pcm_irq, "IRQ # for CS4232 PCM interface.");
    70 module_param_array(dma1, int, NULL, 0444);
     57module_param_hw_array(dma1, int, dma, NULL, 0444);
    7158MODULE_PARM_DESC(dma1, "DMA1 # for CS4232 PCM interface.");
    72 module_param_array(dma2, int, NULL, 0444);
     59module_param_hw_array(dma2, int, dma, NULL, 0444);
    7360MODULE_PARM_DESC(dma2, "DMA2 # for CS4232 PCM interface.");
    74 module_param_array(cs4232_mpu_port, long, NULL, 0444);
     61module_param_hw_array(cs4232_mpu_port, long, ioport, NULL, 0444);
    7562MODULE_PARM_DESC(cs4232_mpu_port, "port # for CS4232 MPU-401 interface.");
    76 module_param_array(cs4232_mpu_irq, int, NULL, 0444);
     63module_param_hw_array(cs4232_mpu_irq, int, irq, NULL, 0444);
    7764MODULE_PARM_DESC(cs4232_mpu_irq, "IRQ # for CS4232 MPU-401 interface.");
    78 module_param_array(ics2115_irq, int, NULL, 0444);
     65module_param_hw_array(ics2115_irq, int, irq, NULL, 0444);
    7966MODULE_PARM_DESC(ics2115_irq, "IRQ # for ICS2115.");
    80 module_param_array(ics2115_port, long, NULL, 0444);
     67module_param_hw_array(ics2115_port, long, ioport, NULL, 0444);
    8168MODULE_PARM_DESC(ics2115_port, "Port # for ICS2115.");
    82 module_param_array(fm_port, long, NULL, 0444);
     69module_param_hw_array(fm_port, long, ioport, NULL, 0444);
    8370MODULE_PARM_DESC(fm_port, "FM port #.");
    8471module_param_array(use_cs4232_midi, bool, NULL, 0444);
     
    8976static int pnp_registered;
    9077
    91 static struct pnp_card_device_id snd_wavefront_pnpids[] = {
     78static const struct pnp_card_device_id snd_wavefront_pnpids[] = {
    9279        /* Tropez */
    9380        { .id = "CSC7532", .devs = { { "CSC0000" }, { "CSC0010" }, { "PnPb006" }, { "CSC0004" } } },
     
    9986MODULE_DEVICE_TABLE(pnp_card, snd_wavefront_pnpids);
    10087
    101 static int __devinit
     88static int
    10289snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *card,
    10390                   const struct pnp_card_device_id *id)
     
    232219}
    233220
    234 static struct snd_hwdep * __devinit
    235 snd_wavefront_new_synth (struct snd_card *card,
    236                          int hw_dev,
    237                          snd_wavefront_card_t *acard)
     221static struct snd_hwdep *snd_wavefront_new_synth(struct snd_card *card,
     222                                                 int hw_dev,
     223                                                 snd_wavefront_card_t *acard)
    238224{
    239225        struct snd_hwdep *wavefront_synth;
     
    258244}
    259245
    260 static struct snd_hwdep * __devinit
    261 snd_wavefront_new_fx (struct snd_card *card,
    262                       int hw_dev,
    263                       snd_wavefront_card_t *acard,
    264                       unsigned long port)
     246static struct snd_hwdep *snd_wavefront_new_fx(struct snd_card *card,
     247                                              int hw_dev,
     248                                              snd_wavefront_card_t *acard,
     249                                              unsigned long port)
    265250
    266251{
     
    285270static snd_wavefront_mpu_id external_id = external_mpu;
    286271
    287 static struct snd_rawmidi *__devinit
    288 snd_wavefront_new_midi (struct snd_card *card,
    289                         int midi_dev,
    290                         snd_wavefront_card_t *acard,
    291                         unsigned long port,
    292                         snd_wavefront_mpu_id mpu)
     272static struct snd_rawmidi *snd_wavefront_new_midi(struct snd_card *card,
     273                                                  int midi_dev,
     274                                                  snd_wavefront_card_t *acard,
     275                                                  unsigned long port,
     276                                                  snd_wavefront_mpu_id mpu)
    293277
    294278{
     
    338322}
    339323
    340 static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
     324static int snd_wavefront_card_new(struct device *pdev, int dev,
     325                                  struct snd_card **cardp)
    341326{
    342327        struct snd_card *card;
     
    344329        int err;
    345330
    346         err = snd_card_create(index[dev], id[dev], THIS_MODULE,
    347                               sizeof(snd_wavefront_card_t), &card);
     331        err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
     332                           sizeof(snd_wavefront_card_t), &card);
    348333        if (err < 0)
    349334                return err;
     
    362347}
    363348
    364 static int __devinit
     349static int
    365350snd_wavefront_probe (struct snd_card *card, int dev)
    366351{
     
    383368        }
    384369
    385         err = snd_wss_pcm(chip, 0, NULL);
     370        err = snd_wss_pcm(chip, 0);
    386371        if (err < 0)
    387372                return err;
    388373
    389         err = snd_wss_timer(chip, 0, NULL);
     374        err = snd_wss_timer(chip, 0);
    390375        if (err < 0)
    391376                return err;
     
    419404        }
    420405        if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt,
    421                         IRQF_DISABLED, "ICS2115", acard)) {
     406                        0, "ICS2115", acard)) {
    422407                snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]);
    423408                return -EBUSY;
     
    425410       
    426411        acard->wavefront.irq = ics2115_irq[dev];
     412        card->sync_irq = acard->wavefront.irq;
    427413        acard->wavefront.base = ics2115_port[dev];
    428414
     
    450436                err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232,
    451437                                          cs4232_mpu_port[dev], 0,
    452                                           cs4232_mpu_irq[dev], IRQF_DISABLED,
    453                                           NULL);
     438                                          cs4232_mpu_irq[dev], NULL);
    454439                if (err < 0) {
    455440                        snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n");
     
    543528}       
    544529
    545 static int __devinit snd_wavefront_isa_match(struct device *pdev,
    546                                              unsigned int dev)
     530static int snd_wavefront_isa_match(struct device *pdev,
     531                                   unsigned int dev)
    547532{
    548533        if (!enable[dev])
     
    563548}
    564549
    565 static int __devinit snd_wavefront_isa_probe(struct device *pdev,
    566                                              unsigned int dev)
     550static int snd_wavefront_isa_probe(struct device *pdev,
     551                                   unsigned int dev)
    567552{
    568553        struct snd_card *card;
    569554        int err;
    570555
    571         err = snd_wavefront_card_new(dev, &card);
     556        err = snd_wavefront_card_new(pdev, dev, &card);
    572557        if (err < 0)
    573558                return err;
    574         snd_card_set_dev(card, pdev);
    575559        if ((err = snd_wavefront_probe(card, dev)) < 0) {
    576560                snd_card_free(card);
     
    582566}
    583567
    584 static int __devexit snd_wavefront_isa_remove(struct device *devptr,
    585                                               unsigned int dev)
     568static int snd_wavefront_isa_remove(struct device *devptr,
     569                                    unsigned int dev)
    586570{
    587571        snd_card_free(dev_get_drvdata(devptr));
    588         dev_set_drvdata(devptr, NULL);
    589572        return 0;
    590573}
     
    595578        .match          = snd_wavefront_isa_match,
    596579        .probe          = snd_wavefront_isa_probe,
    597         .remove         = __devexit_p(snd_wavefront_isa_remove),
     580        .remove         = snd_wavefront_isa_remove,
    598581        /* FIXME: suspend, resume */
    599582        .driver         = {
     
    604587
    605588#ifdef CONFIG_PNP
    606 static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
    607                                         const struct pnp_card_device_id *pid)
     589static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
     590                                    const struct pnp_card_device_id *pid)
    608591{
    609592        static int dev;
     
    618601                return -ENODEV;
    619602
    620         res = snd_wavefront_card_new(dev, &card);
     603        res = snd_wavefront_card_new(&pcard->card->dev, dev, &card);
    621604        if (res < 0)
    622605                return res;
     
    629612                }
    630613        }
    631         snd_card_set_dev(card, &pcard->card->dev);
    632614
    633615        if ((res = snd_wavefront_probe(card, dev)) < 0)
     
    639621}
    640622
    641 static void __devexit snd_wavefront_pnp_remove(struct pnp_card_link * pcard)
     623static void snd_wavefront_pnp_remove(struct pnp_card_link *pcard)
    642624{
    643625        snd_card_free(pnp_get_card_drvdata(pcard));
     
    650632        .id_table       = snd_wavefront_pnpids,
    651633        .probe          = snd_wavefront_pnp_detect,
    652         .remove         = __devexit_p(snd_wavefront_pnp_remove),
     634        .remove         = snd_wavefront_pnp_remove,
    653635        /* FIXME: suspend,resume */
    654636};
Note: See TracChangeset for help on using the changeset viewer.