Ignore:
Timestamp:
Jan 4, 2021, 10:15:17 AM (5 years ago)
Author:
Paul Smedley
Message:

Update source to linux 5.10.4 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/alsa-kernel/pci/bt87x.c

    r615 r629  
    4040static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
    4141static int digital_rate[SNDRV_CARDS];   /* digital input rate */
    42 static bool load_all;   /* allow to load the non-whitelisted cards */
     42static bool load_all;   /* allow to load cards not the allowlist */
    4343
    4444module_param_array(index, int, NULL, 0444);
     
    5151MODULE_PARM_DESC(digital_rate, "Digital input rate for Bt87x soundcard");
    5252module_param(load_all, bool, 0444);
    53 MODULE_PARM_DESC(load_all, "Allow to load the non-whitelisted cards");
     53MODULE_PARM_DESC(load_all, "Allow to load cards not on the allowlist");
    5454
    5555
     
    160160};
    161161
    162 static struct snd_bt87x_board snd_bt87x_boards[] = {
     162static const struct snd_bt87x_board snd_bt87x_boards[] = {
    163163        [SND_BT87X_BOARD_UNKNOWN] = {
    164164                .dig_rate = 32000, /* just a guess */
     
    227227
    228228        if (chip->dma_risc.area == NULL) {
    229                 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
     229                if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &chip->pci->dev,
    230230                                        PAGE_ALIGN(MAX_RISC_SIZE), &chip->dma_risc) < 0)
    231231                        return -ENOMEM;
     
    281281static void snd_bt87x_pci_error(struct snd_bt87x *chip, unsigned int status)
    282282{
    283         u16 pci_status;
    284 
    285         pci_read_config_word(chip->pci, PCI_STATUS, &pci_status);
    286         pci_status &= PCI_STATUS_PARITY | PCI_STATUS_SIG_TARGET_ABORT |
    287                 PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_REC_MASTER_ABORT |
    288                 PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY;
    289         pci_write_config_word(chip->pci, PCI_STATUS, pci_status);
     283        int pci_status = pci_status_get_and_clear_errors(chip->pci);
     284
    290285        if (pci_status != PCI_STATUS_DETECTED_PARITY)
    291286                dev_err(chip->card->dev,
     
    462457{
    463458        struct snd_bt87x *chip = snd_pcm_substream_chip(substream);
    464         int err;
    465 
    466         err = snd_pcm_lib_malloc_pages(substream,
    467                                        params_buffer_bytes(hw_params));
    468         if (err < 0)
    469                 return err;
     459
    470460        return snd_bt87x_create_risc(chip, substream,
    471461                                     params_periods(hw_params),
     
    478468
    479469        snd_bt87x_free_risc(chip);
    480         snd_pcm_lib_free_pages(substream);
    481470        return 0;
    482471}
     
    549538        .open = snd_bt87x_pcm_open,
    550539        .close = snd_bt87x_close,
    551         .ioctl = snd_pcm_lib_ioctl,
    552540        .hw_params = snd_bt87x_hw_params,
    553541        .hw_free = snd_bt87x_hw_free,
     
    555543        .trigger = snd_bt87x_trigger,
    556544        .pointer = snd_bt87x_pointer,
    557         .page = snd_pcm_sgbuf_ops_page,
    558545};
    559546
     
    710697        strcpy(pcm->name, name);
    711698        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_bt87x_pcm_ops);
    712         snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
    713                                               snd_dma_pci_data(chip->pci),
    714                                               128 * 1024,
    715                                               ALIGN(255 * 4092, 1024));
     699        snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
     700                                       &chip->pci->dev,
     701                                       128 * 1024,
     702                                       ALIGN(255 * 4092, 1024));
    716703        return 0;
    717704}
     
    723710        struct snd_bt87x *chip;
    724711        int err;
    725         static struct snd_device_ops ops = {
     712        static const struct snd_device_ops ops = {
    726713                .dev_free = snd_bt87x_dev_free
    727714        };
     
    769756        }
    770757        chip->irq = pci->irq;
     758        card->sync_irq = chip->irq;
    771759        pci_set_master(pci);
    772         synchronize_irq(chip->irq);
    773760
    774761        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
     
    824811static struct {
    825812        unsigned short subvendor, subdevice;
    826 } blacklist[] = {
     813} denylist[] = {
    827814        {0x0071, 0x0101}, /* Nebula Electronics DigiTV */
    828815        {0x11bd, 0x001c}, /* Pinnacle PCTV Sat */
     
    840827static struct pci_driver driver;
    841828
    842 /* return the id of the card, or a negative value if it's blacklisted */
     829/* return the id of the card, or a negative value if it's on the denylist */
    843830static int snd_bt87x_detect_card(struct pci_dev *pci)
    844831{
     
    850837                return supported->driver_data;
    851838
    852         for (i = 0; i < ARRAY_SIZE(blacklist); ++i)
    853                 if (blacklist[i].subvendor == pci->subsystem_vendor &&
    854                     blacklist[i].subdevice == pci->subsystem_device) {
     839        for (i = 0; i < ARRAY_SIZE(denylist); ++i)
     840                if (denylist[i].subvendor == pci->subsystem_vendor &&
     841                    denylist[i].subdevice == pci->subsystem_device) {
    855842                        dev_dbg(&pci->dev,
    856843                                "card %#04x-%#04x:%#04x has no audio\n",
Note: See TracChangeset for help on using the changeset viewer.