• Home
  • Raw
  • Download

Lines Matching +full:ati +full:- +full:target

2  * bt87x.c - Brooktree Bt878/Bt879 driver for ALSA
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43 static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
47 static bool load_all; /* allow to load the non-whitelisted cards */
58 MODULE_PARM_DESC(load_all, "Allow to load the non-whitelisted cards");
73 #define INT_FTRGT (1 << 13) /* FIFO overrun due to target latency */
77 #define INT_PABORT (1 << 17) /* PCI master or target abort */
86 #define CTL_PKTP_4 (0 << 2) /* packet mode FIFO trigger point - 4 DWORDs */
109 #define CTL_A_PWRDN (1 << 26) /* analog audio power-down */
147 #define MAX_RISC_SIZE ((1 + 255 + (PAGE_ALIGN(255 * 4092) / PAGE_SIZE - 1) + 1 + 1) * 8)
219 return readl(chip->mmio + reg); in snd_bt87x_readl()
224 writel(value, chip->mmio + reg); in snd_bt87x_writel()
233 if (chip->dma_risc.area == NULL) { in snd_bt87x_create_risc()
234 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), in snd_bt87x_create_risc()
235 PAGE_ALIGN(MAX_RISC_SIZE), &chip->dma_risc) < 0) in snd_bt87x_create_risc()
236 return -ENOMEM; in snd_bt87x_create_risc()
238 risc = (__le32 *)chip->dma_risc.area; in snd_bt87x_create_risc()
250 len = PAGE_SIZE - (offset % PAGE_SIZE); in snd_bt87x_create_risc()
266 rest -= len; in snd_bt87x_create_risc()
272 *risc++ = cpu_to_le32(chip->dma_risc.addr); in snd_bt87x_create_risc()
273 chip->line_bytes = period_bytes; in snd_bt87x_create_risc()
274 chip->lines = periods; in snd_bt87x_create_risc()
280 if (chip->dma_risc.area) { in snd_bt87x_free_risc()
281 snd_dma_free_pages(&chip->dma_risc); in snd_bt87x_free_risc()
282 chip->dma_risc.area = NULL; in snd_bt87x_free_risc()
290 pci_read_config_word(chip->pci, PCI_STATUS, &pci_status); in snd_bt87x_pci_error()
294 pci_write_config_word(chip->pci, PCI_STATUS, pci_status); in snd_bt87x_pci_error()
296 dev_err(chip->card->dev, in snd_bt87x_pci_error()
297 "Aieee - PCI error! status %#08x, PCI status %#04x\n", in snd_bt87x_pci_error()
300 dev_err(chip->card->dev, in snd_bt87x_pci_error()
301 "Aieee - PCI parity error detected!\n"); in snd_bt87x_pci_error()
303 chip->pci_parity_errors++; in snd_bt87x_pci_error()
304 if (chip->pci_parity_errors > 20) { in snd_bt87x_pci_error()
305 dev_err(chip->card->dev, in snd_bt87x_pci_error()
307 dev_err(chip->card->dev, in snd_bt87x_pci_error()
309 dev_err(chip->card->dev, in snd_bt87x_pci_error()
311 dev_err(chip->card->dev, in snd_bt87x_pci_error()
313 chip->interrupt_mask &= ~(INT_PPERR | INT_RIPERR); in snd_bt87x_pci_error()
314 snd_bt87x_writel(chip, REG_INT_MASK, chip->interrupt_mask); in snd_bt87x_pci_error()
325 irq_status = status & chip->interrupt_mask; in snd_bt87x_interrupt()
332 dev_warn(chip->card->dev, in snd_bt87x_interrupt()
335 dev_err(chip->card->dev, in snd_bt87x_interrupt()
340 if ((irq_status & INT_RISCI) && (chip->reg_control & CTL_ACAP_EN)) { in snd_bt87x_interrupt()
344 chip->current_line = (chip->current_line + 1) % chip->lines; in snd_bt87x_interrupt()
346 current_block = chip->current_line * 16 / chip->lines; in snd_bt87x_interrupt()
349 chip->current_line = (irq_block * chip->lines + 15) / 16; in snd_bt87x_interrupt()
351 snd_pcm_period_elapsed(chip->substream); in snd_bt87x_interrupt()
394 chip->reg_control |= CTL_DA_IOM_DA | CTL_A_PWRDN; in snd_bt87x_set_digital_hw()
395 runtime->hw = snd_bt87x_digital_hw; in snd_bt87x_set_digital_hw()
396 runtime->hw.rates = snd_pcm_rate_to_rate_bit(chip->board.dig_rate); in snd_bt87x_set_digital_hw()
397 runtime->hw.rate_min = chip->board.dig_rate; in snd_bt87x_set_digital_hw()
398 runtime->hw.rate_max = chip->board.dig_rate; in snd_bt87x_set_digital_hw()
415 chip->reg_control &= ~(CTL_DA_IOM_DA | CTL_A_PWRDN); in snd_bt87x_set_analog_hw()
416 runtime->hw = snd_bt87x_analog_hw; in snd_bt87x_set_analog_hw()
424 struct snd_pcm_runtime *runtime = substream->runtime; in snd_bt87x_pcm_open()
427 if (test_and_set_bit(0, &chip->opened)) in snd_bt87x_pcm_open()
428 return -EBUSY; in snd_bt87x_pcm_open()
430 if (substream->pcm->device == DEVICE_DIGITAL) in snd_bt87x_pcm_open()
441 chip->substream = substream; in snd_bt87x_pcm_open()
445 clear_bit(0, &chip->opened); in snd_bt87x_pcm_open()
454 spin_lock_irq(&chip->reg_lock); in snd_bt87x_close()
455 chip->reg_control |= CTL_A_PWRDN; in snd_bt87x_close()
456 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_close()
457 spin_unlock_irq(&chip->reg_lock); in snd_bt87x_close()
459 chip->substream = NULL; in snd_bt87x_close()
460 clear_bit(0, &chip->opened); in snd_bt87x_close()
492 struct snd_pcm_runtime *runtime = substream->runtime; in snd_bt87x_prepare()
495 spin_lock_irq(&chip->reg_lock); in snd_bt87x_prepare()
496 chip->reg_control &= ~(CTL_DA_SDR_MASK | CTL_DA_SBR); in snd_bt87x_prepare()
497 decimation = (ANALOG_CLOCK + runtime->rate / 4) / runtime->rate; in snd_bt87x_prepare()
498 chip->reg_control |= decimation << CTL_DA_SDR_SHIFT; in snd_bt87x_prepare()
499 if (runtime->format == SNDRV_PCM_FORMAT_S8) in snd_bt87x_prepare()
500 chip->reg_control |= CTL_DA_SBR; in snd_bt87x_prepare()
501 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_prepare()
502 spin_unlock_irq(&chip->reg_lock); in snd_bt87x_prepare()
508 spin_lock(&chip->reg_lock); in snd_bt87x_start()
509 chip->current_line = 0; in snd_bt87x_start()
510 chip->reg_control |= CTL_FIFO_ENABLE | CTL_RISC_ENABLE | CTL_ACAP_EN; in snd_bt87x_start()
511 snd_bt87x_writel(chip, REG_RISC_STRT_ADD, chip->dma_risc.addr); in snd_bt87x_start()
513 chip->line_bytes | (chip->lines << 16)); in snd_bt87x_start()
514 snd_bt87x_writel(chip, REG_INT_MASK, chip->interrupt_mask); in snd_bt87x_start()
515 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_start()
516 spin_unlock(&chip->reg_lock); in snd_bt87x_start()
522 spin_lock(&chip->reg_lock); in snd_bt87x_stop()
523 chip->reg_control &= ~(CTL_FIFO_ENABLE | CTL_RISC_ENABLE | CTL_ACAP_EN); in snd_bt87x_stop()
524 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_stop()
527 spin_unlock(&chip->reg_lock); in snd_bt87x_stop()
541 return -EINVAL; in snd_bt87x_trigger()
548 struct snd_pcm_runtime *runtime = substream->runtime; in snd_bt87x_pointer()
550 return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes); in snd_bt87x_pointer()
568 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_bt87x_capture_volume_info()
569 info->count = 1; in snd_bt87x_capture_volume_info()
570 info->value.integer.min = 0; in snd_bt87x_capture_volume_info()
571 info->value.integer.max = 15; in snd_bt87x_capture_volume_info()
580 value->value.integer.value[0] = (chip->reg_control & CTL_A_GAIN_MASK) >> CTL_A_GAIN_SHIFT; in snd_bt87x_capture_volume_get()
591 spin_lock_irq(&chip->reg_lock); in snd_bt87x_capture_volume_put()
592 old_control = chip->reg_control; in snd_bt87x_capture_volume_put()
593 chip->reg_control = (chip->reg_control & ~CTL_A_GAIN_MASK) in snd_bt87x_capture_volume_put()
594 | (value->value.integer.value[0] << CTL_A_GAIN_SHIFT); in snd_bt87x_capture_volume_put()
595 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_capture_volume_put()
596 changed = old_control != chip->reg_control; in snd_bt87x_capture_volume_put()
597 spin_unlock_irq(&chip->reg_lock); in snd_bt87x_capture_volume_put()
616 value->value.integer.value[0] = !! (chip->reg_control & CTL_A_G2X); in snd_bt87x_capture_boost_get()
627 spin_lock_irq(&chip->reg_lock); in snd_bt87x_capture_boost_put()
628 old_control = chip->reg_control; in snd_bt87x_capture_boost_put()
629 chip->reg_control = (chip->reg_control & ~CTL_A_G2X) in snd_bt87x_capture_boost_put()
630 | (value->value.integer.value[0] ? CTL_A_G2X : 0); in snd_bt87x_capture_boost_put()
631 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_capture_boost_put()
632 changed = chip->reg_control != old_control; in snd_bt87x_capture_boost_put()
633 spin_unlock_irq(&chip->reg_lock); in snd_bt87x_capture_boost_put()
658 value->value.enumerated.item[0] = (chip->reg_control & CTL_A_SEL_MASK) >> CTL_A_SEL_SHIFT; in snd_bt87x_capture_source_get()
669 spin_lock_irq(&chip->reg_lock); in snd_bt87x_capture_source_put()
670 old_control = chip->reg_control; in snd_bt87x_capture_source_put()
671 chip->reg_control = (chip->reg_control & ~CTL_A_SEL_MASK) in snd_bt87x_capture_source_put()
672 | (value->value.enumerated.item[0] << CTL_A_SEL_SHIFT); in snd_bt87x_capture_source_put()
673 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_capture_source_put()
674 changed = chip->reg_control != old_control; in snd_bt87x_capture_source_put()
675 spin_unlock_irq(&chip->reg_lock); in snd_bt87x_capture_source_put()
689 if (chip->mmio) in snd_bt87x_free()
691 if (chip->irq >= 0) in snd_bt87x_free()
692 free_irq(chip->irq, chip); in snd_bt87x_free()
693 iounmap(chip->mmio); in snd_bt87x_free()
694 pci_release_regions(chip->pci); in snd_bt87x_free()
695 pci_disable_device(chip->pci); in snd_bt87x_free()
702 struct snd_bt87x *chip = device->device_data; in snd_bt87x_dev_free()
711 err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm); in snd_bt87x_pcm()
714 pcm->private_data = chip; in snd_bt87x_pcm()
715 strcpy(pcm->name, name); in snd_bt87x_pcm()
719 snd_dma_pci_data(chip->pci), in snd_bt87x_pcm()
743 return -ENOMEM; in snd_bt87x_create()
745 chip->card = card; in snd_bt87x_create()
746 chip->pci = pci; in snd_bt87x_create()
747 chip->irq = -1; in snd_bt87x_create()
748 spin_lock_init(&chip->reg_lock); in snd_bt87x_create()
755 chip->mmio = pci_ioremap_bar(pci, 0); in snd_bt87x_create()
756 if (!chip->mmio) { in snd_bt87x_create()
757 dev_err(card->dev, "cannot remap io memory\n"); in snd_bt87x_create()
758 err = -ENOMEM; in snd_bt87x_create()
762 chip->reg_control = CTL_A_PWRDN | CTL_DA_ES2 | in snd_bt87x_create()
764 chip->interrupt_mask = MY_INTERRUPTS; in snd_bt87x_create()
765 snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control); in snd_bt87x_create()
769 err = request_irq(pci->irq, snd_bt87x_interrupt, IRQF_SHARED, in snd_bt87x_create()
772 dev_err(card->dev, "cannot grab irq %d\n", pci->irq); in snd_bt87x_create()
775 chip->irq = pci->irq; in snd_bt87x_create()
777 synchronize_irq(chip->irq); in snd_bt87x_create()
807 /* ATI TV-Wonder */
819 /* Prolink PixelView PV-M4900 */
835 {0x1461, 0x0761}, /* AVermedia AverTV DVB-T */
836 {0x1461, 0x0771}, /* AVermedia DVB-T 771 */
837 {0x1822, 0x0001}, /* Twinhan VisionPlus DVB-T */
839 {0x18ac, 0xdb10}, /* DVICO FusionHDTV DVB-T Lite */
840 {0x18ac, 0xdb11}, /* Ultraview DVB-T Lite */
841 {0x270f, 0xfc00}, /* Chaintech Digitop DST-1000 DVB-S */
842 {0x7063, 0x2000}, /* pcHDTV HD-2000 TV */
854 if (supported && supported->driver_data > 0) in snd_bt87x_detect_card()
855 return supported->driver_data; in snd_bt87x_detect_card()
858 if (blacklist[i].subvendor == pci->subsystem_vendor && in snd_bt87x_detect_card()
859 blacklist[i].subdevice == pci->subsystem_device) { in snd_bt87x_detect_card()
860 dev_dbg(&pci->dev, in snd_bt87x_detect_card()
861 "card %#04x-%#04x:%#04x has no audio\n", in snd_bt87x_detect_card()
862 pci->device, pci->subsystem_vendor, pci->subsystem_device); in snd_bt87x_detect_card()
863 return -EBUSY; in snd_bt87x_detect_card()
866 dev_info(&pci->dev, "unknown card %#04x-%#04x:%#04x\n", in snd_bt87x_detect_card()
867 pci->device, pci->subsystem_vendor, pci->subsystem_device); in snd_bt87x_detect_card()
868 dev_info(&pci->dev, "please mail id, board name, and, " in snd_bt87x_detect_card()
870 "<alsa-devel@alsa-project.org>\n"); in snd_bt87x_detect_card()
883 if (!pci_id->driver_data) { in snd_bt87x_probe()
886 return -ENODEV; in snd_bt87x_probe()
889 boardid = pci_id->driver_data; in snd_bt87x_probe()
892 return -ENODEV; in snd_bt87x_probe()
895 return -ENOENT; in snd_bt87x_probe()
898 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, in snd_bt87x_probe()
907 memcpy(&chip->board, &snd_bt87x_boards[boardid], sizeof(chip->board)); in snd_bt87x_probe()
909 if (!chip->board.no_digital) { in snd_bt87x_probe()
911 chip->board.dig_rate = digital_rate[dev]; in snd_bt87x_probe()
913 chip->reg_control |= chip->board.digital_fmt; in snd_bt87x_probe()
919 if (!chip->board.no_analog) { in snd_bt87x_probe()
936 dev_info(card->dev, "bt87x%d: Using board %d, %sanalog, %sdigital " in snd_bt87x_probe()
938 chip->board.no_analog ? "no " : "", in snd_bt87x_probe()
939 chip->board.no_digital ? "no " : "", chip->board.dig_rate); in snd_bt87x_probe()
941 strcpy(card->driver, "Bt87x"); in snd_bt87x_probe()
942 sprintf(card->shortname, "Brooktree Bt%x", pci->device); in snd_bt87x_probe()
943 sprintf(card->longname, "%s at %#llx, irq %i", in snd_bt87x_probe()
944 card->shortname, (unsigned long long)pci_resource_start(pci, 0), in snd_bt87x_probe()
945 chip->irq); in snd_bt87x_probe()
946 strcpy(card->mixername, "Bt87x"); in snd_bt87x_probe()
966 /* default entries for all Bt87x cards - it's not exported */