Changeset 629 for GPL/branches/uniaud32-next/alsa-kernel/pci/bt87x.c
- Timestamp:
- Jan 4, 2021, 10:15:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/alsa-kernel/pci/bt87x.c
r615 r629 40 40 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 41 41 static int digital_rate[SNDRV_CARDS]; /* digital input rate */ 42 static bool load_all; /* allow to load the non-whitelisted cards*/42 static bool load_all; /* allow to load cards not the allowlist */ 43 43 44 44 module_param_array(index, int, NULL, 0444); … … 51 51 MODULE_PARM_DESC(digital_rate, "Digital input rate for Bt87x soundcard"); 52 52 module_param(load_all, bool, 0444); 53 MODULE_PARM_DESC(load_all, "Allow to load the non-whitelisted cards");53 MODULE_PARM_DESC(load_all, "Allow to load cards not on the allowlist"); 54 54 55 55 … … 160 160 }; 161 161 162 static struct snd_bt87x_board snd_bt87x_boards[] = {162 static const struct snd_bt87x_board snd_bt87x_boards[] = { 163 163 [SND_BT87X_BOARD_UNKNOWN] = { 164 164 .dig_rate = 32000, /* just a guess */ … … 227 227 228 228 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, 230 230 PAGE_ALIGN(MAX_RISC_SIZE), &chip->dma_risc) < 0) 231 231 return -ENOMEM; … … 281 281 static void snd_bt87x_pci_error(struct snd_bt87x *chip, unsigned int status) 282 282 { 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 290 285 if (pci_status != PCI_STATUS_DETECTED_PARITY) 291 286 dev_err(chip->card->dev, … … 462 457 { 463 458 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 470 460 return snd_bt87x_create_risc(chip, substream, 471 461 params_periods(hw_params), … … 478 468 479 469 snd_bt87x_free_risc(chip); 480 snd_pcm_lib_free_pages(substream);481 470 return 0; 482 471 } … … 549 538 .open = snd_bt87x_pcm_open, 550 539 .close = snd_bt87x_close, 551 .ioctl = snd_pcm_lib_ioctl,552 540 .hw_params = snd_bt87x_hw_params, 553 541 .hw_free = snd_bt87x_hw_free, … … 555 543 .trigger = snd_bt87x_trigger, 556 544 .pointer = snd_bt87x_pointer, 557 .page = snd_pcm_sgbuf_ops_page,558 545 }; 559 546 … … 710 697 strcpy(pcm->name, name); 711 698 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 715 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)); 716 703 return 0; 717 704 } … … 723 710 struct snd_bt87x *chip; 724 711 int err; 725 static struct snd_device_ops ops = {712 static const struct snd_device_ops ops = { 726 713 .dev_free = snd_bt87x_dev_free 727 714 }; … … 769 756 } 770 757 chip->irq = pci->irq; 758 card->sync_irq = chip->irq; 771 759 pci_set_master(pci); 772 synchronize_irq(chip->irq);773 760 774 761 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); … … 824 811 static struct { 825 812 unsigned short subvendor, subdevice; 826 } blacklist[] = {813 } denylist[] = { 827 814 {0x0071, 0x0101}, /* Nebula Electronics DigiTV */ 828 815 {0x11bd, 0x001c}, /* Pinnacle PCTV Sat */ … … 840 827 static struct pci_driver driver; 841 828 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 */ 843 830 static int snd_bt87x_detect_card(struct pci_dev *pci) 844 831 { … … 850 837 return supported->driver_data; 851 838 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) { 855 842 dev_dbg(&pci->dev, 856 843 "card %#04x-%#04x:%#04x has no audio\n",
Note:
See TracChangeset
for help on using the changeset viewer.