Changeset 426 for GPL/trunk/alsa-kernel/pci/ca0106
- Timestamp:
- May 9, 2009, 11:45:26 AM (17 years ago)
- File:
-
- 1 edited
-
GPL/trunk/alsa-kernel/pci/ca0106/ca0106_main.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/ca0106/ca0106_main.c
r410 r426 256 256 .i2c_adc = 1, 257 257 .spi_dac = 1 } , 258 /* Giga-byte GA-G1975X mobo 259 * Novell bnc#395807 260 */ 261 /* FIXME: the GPIO and I2C setting aren't tested well */ 262 { .serial = 0x1458a006, 263 .name = "Giga-byte GA-G1975X", 264 .gpio_type = 1, 265 .i2c_adc = 1 }, 258 266 /* Shuttle XPC SD31P which has an onboard Creative Labs 259 267 * Sound Blaster Live! 24-bit EAX … … 405 413 406 414 tmp = reg << 25 | value << 16; 407 // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value); 415 /* 416 snd_printk(KERN_DEBUG "I2C-write:reg=0x%x, value=0x%x\n", reg, value); 417 */ 408 418 /* Not sure what this I2C channel controls. */ 409 419 /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */ … … 423 433 while (1) { 424 434 status = snd_ca0106_ptr_read(emu, I2C_A, 0); 425 //snd_printk("I2C:status=0x%x\n", status); 435 /*snd_printk(KERN_DEBUG "I2C:status=0x%x\n", status);*/ 426 436 timeout++; 427 437 if ((status & I2C_A_ADC_START) == 0) … … 522 532 523 533 channel->use = 1; 524 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 534 /* 535 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 536 channel_id, chip, channel); 537 */ 525 538 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 526 539 channel->epcm = epcm; … … 615 628 616 629 channel->use = 1; 617 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 630 /* 631 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 632 channel_id, chip, channel); 633 */ 618 634 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 619 635 channel->epcm = epcm; … … 706 722 int i; 707 723 708 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 709 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 710 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 724 #if 0 /* debug */ 725 snd_printk(KERN_DEBUG 726 "prepare:channel_number=%d, rate=%d, format=0x%x, " 727 "channels=%d, buffer_size=%ld, period_size=%ld, " 728 "periods=%u, frames_to_bytes=%d\n", 729 channel, runtime->rate, runtime->format, 730 runtime->channels, runtime->buffer_size, 731 runtime->period_size, runtime->periods, 732 frames_to_bytes(runtime, 1)); 733 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n", 734 runtime->dma_addr, runtime->dma_area, table_base); 735 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n", 736 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 737 #endif /* debug */ 711 738 /* Rate can be set per channel. */ 712 739 /* reg40 control host to fifo */ … … 800 827 u32 reg71; 801 828 802 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 803 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 804 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 829 #if 0 /* debug */ 830 snd_printk(KERN_DEBUG 831 "prepare:channel_number=%d, rate=%d, format=0x%x, " 832 "channels=%d, buffer_size=%ld, period_size=%ld, " 833 "periods=%u, frames_to_bytes=%d\n", 834 channel, runtime->rate, runtime->format, 835 runtime->channels, runtime->buffer_size, 836 runtime->period_size, runtime->periods, 837 frames_to_bytes(runtime, 1)); 838 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n", 839 runtime->dma_addr, runtime->dma_area, table_base); 840 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n", 841 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 842 #endif /* debug */ 805 843 /* reg71 controls ADC rate. */ 806 844 switch (runtime->rate) { … … 847 885 848 886 849 //printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); 887 /* 888 printk(KERN_DEBUG 889 "prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, " 890 "buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n", 891 channel, runtime->rate, runtime->format, runtime->channels, 892 runtime->buffer_size, runtime->period_size, 893 frames_to_bytes(runtime, 1)); 894 */ 850 895 snd_ca0106_ptr_write(emu, 0x13, channel, 0); 851 896 snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); … … 889 934 epcm = runtime->private_data; 890 935 channel = epcm->channel_id; 891 /* snd_printk( "channel=%d\n",channel); */936 /* snd_printk(KERN_DEBUG "channel=%d\n", channel); */ 892 937 epcm->running = running; 893 938 basic |= (0x1 << channel); … … 895 940 snd_pcm_trigger_done(s, substream); 896 941 } 897 /* snd_printk( "basic=0x%x, extended=0x%x\n",basic, extended); */942 /* snd_printk(KERN_DEBUG "basic=0x%x, extended=0x%x\n",basic, extended); */ 898 943 899 944 switch (cmd) { … … 973 1018 if (ptr >= runtime->buffer_size) 974 1019 ptr -= runtime->buffer_size; 975 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 976 1020 /* 1021 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, " 1022 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", 1023 ptr1, ptr2, ptr, (int)runtime->buffer_size, 1024 (int)runtime->period_size, (int)runtime->frame_bits, 1025 (int)runtime->rate); 1026 */ 977 1027 return ptr; 978 1028 } … … 996 1046 if (ptr >= runtime->buffer_size) 997 1047 ptr -= runtime->buffer_size; 998 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 999 1048 /* 1049 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, " 1050 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", 1051 ptr1, ptr2, ptr, (int)runtime->buffer_size, 1052 (int)runtime->period_size, (int)runtime->frame_bits, 1053 (int)runtime->rate); 1054 */ 1000 1055 return ptr; 1001 1056 } … … 1182 1237 1183 1238 stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0); 1184 //snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76); 1185 //snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0)); 1239 /* 1240 snd_printk(KERN_DEBUG "interrupt status = 0x%08x, stat76=0x%08x\n", 1241 status, stat76); 1242 snd_printk(KERN_DEBUG "ptr=0x%08x\n", 1243 snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0)); 1244 */ 1186 1245 mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */ 1187 1246 for(i = 0; i < 4; i++) { … … 1471 1530 1472 1531 size = ARRAY_SIZE(i2c_adc_init); 1473 /* snd_printk( "I2C:array size=0x%x\n", size); */1532 /* snd_printk(KERN_DEBUG "I2C:array size=0x%x\n", size); */ 1474 1533 for (n = 0; n < size; n++) 1475 1534 snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], … … 1531 1590 if (err < 0) 1532 1591 return err; 1533 if (pci_set_dma_mask(pci, DMA_ 32BIT_MASK) < 0 ||1534 pci_set_consistent_dma_mask(pci, DMA_ 32BIT_MASK) < 0) {1592 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 || 1593 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { 1535 1594 printk(KERN_ERR "error to set 32bit mask DMA\n"); 1536 1595 pci_disable_device(pci);
Note:
See TracChangeset
for help on using the changeset viewer.
