Changeset 426 for GPL/trunk/alsa-kernel/pci/emu10k1
- Timestamp:
- May 9, 2009, 11:45:26 AM (16 years ago)
- Location:
- GPL/trunk/alsa-kernel/pci/emu10k1
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c
r399 r426 104 104 vp = &emu->voices[best[i].voice]; 105 105 if ((ch = vp->ch) < 0) { 106 //printk("synth_get_voice: ch < 0 (%d) ??", i); 106 /* 107 printk(KERN_WARNING 108 "synth_get_voice: ch < 0 (%d) ??", i); 109 */ 107 110 continue; 108 111 } … … 336 339 emem->map_locked++; 337 340 if (snd_emu10k1_memblk_map(hw, emem) < 0) { 338 / / printk("emu: cannot map!\n");341 /* printk(KERN_ERR "emu: cannot map!\n"); */ 339 342 return -ENOMEM; 340 343 } -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c
r402 r426 715 715 { 716 716 struct snd_emu10k1 *emu = data; 717 int tmp, tmp2; 718 int reg; 717 u32 tmp, tmp2, reg; 719 718 int err; 720 719 … … 762 761 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp); 763 762 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2); 764 snd_printk("Audio Dock ver:%d.%d\n", tmp, tmp2); 763 snd_printk(KERN_INFO "Audio Dock ver: %u.%u\n", 764 tmp, tmp2); 765 765 /* Sync clocking between 1010 and Dock */ 766 766 /* Allow DLL to settle */ … … 808 808 { 809 809 unsigned int i; 810 int tmp, tmp2; 811 int reg; 810 u32 tmp, tmp2, reg; 812 811 int err; 813 812 const char *filename = NULL; … … 891 890 snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp); 892 891 snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2); 893 snd_printk( "emu1010: Hana version: %d.%d\n", tmp, tmp2);892 snd_printk(KERN_INFO "emu1010: Hana version: %u.%u\n", tmp, tmp2); 894 893 /* Enable 48Volt power to Audio Dock */ 895 894 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON); … … 1532 1531 .spk71 = 1, 1533 1532 .spdif_bug = 1, 1533 .invert_shared_spdif = 1, /* digital/analog switch swapped */ 1534 1534 .ac97_chip = 1} , 1535 1535 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102, -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c
r410 r426 898 898 if ((err = pci_enable_device(pci)) < 0) 899 899 return err; 900 if (pci_set_dma_mask(pci, DMA_ 28BIT_MASK) < 0 ||901 pci_set_consistent_dma_mask(pci, DMA_ 28BIT_MASK) < 0) {900 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || 901 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { 902 902 snd_printk(KERN_ERR "error to set 28bit mask DMA\n"); 903 903 pci_disable_device(pci); -
GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
r399 r426 1520 1520 if (emu->card_capabilities->emu_model) { 1521 1521 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ 1522 snd_printk( "EMU outputs on\n");1522 snd_printk(KERN_INFO "EMU outputs on\n"); 1523 1523 for (z = 0; z < 8; z++) { 1524 1524 if (emu->card_capabilities->ca0108_chip) { … … 1568 1568 if (emu->card_capabilities->emu_model) { 1569 1569 if (emu->card_capabilities->ca0108_chip) { 1570 snd_printk( "EMU2 inputs on\n");1570 snd_printk(KERN_INFO "EMU2 inputs on\n"); 1571 1571 for (z = 0; z < 0x10; z++) { 1572 1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, … … 1576 1576 } 1577 1577 } else { 1578 snd_printk( "EMU inputs on\n");1578 snd_printk(KERN_INFO "EMU inputs on\n"); 1579 1579 /* Capture 16 (originally 8) channels of S32_LE sound */ 1580 1580 1581 /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */ 1581 /* 1582 printk(KERN_DEBUG "emufx.c: gpr=0x%x, tmp=0x%x\n", 1583 gpr, tmp); 1584 */ 1582 1585 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ 1583 1586 /* A_P16VIN(0) is delayed by one sample, … … 2491 2494 if (!capable(CAP_SYS_ADMIN)) 2492 2495 return -EPERM; 2493 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2494 if (icode == NULL) 2495 return -ENOMEM; 2496 if (copy_from_user(icode, argp, sizeof(*icode))) { 2497 kfree(icode); 2498 return -EFAULT; 2499 } 2496 2497 icode = memdup_user(argp, sizeof(*icode)); 2498 if (IS_ERR(icode)) 2499 return PTR_ERR(icode); 2500 2500 res = snd_emu10k1_icode_poke(emu, icode); 2501 2501 kfree(icode); 2502 2502 return res; 2503 2503 case SNDRV_EMU10K1_IOCTL_CODE_PEEK: 2504 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2505 if (icode == NULL) 2506 return -ENOMEM; 2507 if (copy_from_user(icode, argp, sizeof(*icode))) { 2508 kfree(icode); 2509 return -EFAULT; 2510 } 2504 icode = memdup_user(argp, sizeof(*icode)); 2505 if (IS_ERR(icode)) 2506 return PTR_ERR(icode); 2511 2507 res = snd_emu10k1_icode_peek(emu, icode); 2512 2508 if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) { … … 2517 2513 return res; 2518 2514 case SNDRV_EMU10K1_IOCTL_PCM_POKE: 2519 ipcm = kmalloc(sizeof(*ipcm), GFP_KERNEL); 2520 if (ipcm == NULL) 2521 return -ENOMEM; 2522 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) { 2523 kfree(ipcm); 2524 return -EFAULT; 2525 } 2515 ipcm = memdup_user(argp, sizeof(*ipcm)); 2516 if (IS_ERR(ipcm)) 2517 return PTR_ERR(ipcm); 2526 2518 res = snd_emu10k1_ipcm_poke(emu, ipcm); 2527 2519 kfree(ipcm); 2528 2520 return res; 2529 2521 case SNDRV_EMU10K1_IOCTL_PCM_PEEK: 2530 ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL); 2531 if (ipcm == NULL) 2532 return -ENOMEM; 2533 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) { 2534 kfree(ipcm); 2535 return -EFAULT; 2536 } 2522 ipcm = memdup_user(argp, sizeof(*ipcm)); 2523 if (IS_ERR(ipcm)) 2524 return PTR_ERR(ipcm); 2537 2525 res = snd_emu10k1_ipcm_peek(emu, ipcm); 2538 2526 if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) { -
GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c
r305 r426 45 45 return; 46 46 #if 0 47 printk( "IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n",47 printk(KERN_DEBUG "IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n", 48 48 epcm->substream->runtime->hw->pointer(emu, epcm->substream), 49 49 snd_pcm_lib_period_bytes(epcm->substream), … … 147 147 &epcm->extra); 148 148 if (err < 0) { 149 /* printk("pcm_channel_alloc: failed extra: voices=%d, frame=%d\n", voices, frame); */ 149 /* 150 printk(KERN_DEBUG "pcm_channel_alloc: " 151 "failed extra: voices=%d, frame=%d\n", 152 voices, frame); 153 */ 150 154 for (i = 0; i < voices; i++) { 151 155 snd_emu10k1_voice_free(epcm->emu, epcm->voices[i]); … … 738 742 int result = 0; 739 743 740 /* printk("trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", (int)emu, cmd, substream->ops->pointer(substream)); */ 744 /* 745 printk(KERN_DEBUG "trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", 746 (int)emu, cmd, substream->ops->pointer(substream)) 747 */ 741 748 spin_lock(&emu->reg_lock); 742 749 switch (cmd) { … … 787 794 outl(epcm->capture_ipr, emu->port + IPR); 788 795 snd_emu10k1_intr_enable(emu, epcm->capture_inte); 789 /* printk("adccr = 0x%x, adcbs = 0x%x\n", epcm->adccr, epcm->adcbs); */ 796 /* 797 printk(KERN_DEBUG "adccr = 0x%x, adcbs = 0x%x\n", 798 epcm->adccr, epcm->adcbs); 799 */ 790 800 switch (epcm->type) { 791 801 case CAPTURE_AC97ADC: … … 858 868 } 859 869 #endif 860 /* printk("ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", ptr, runtime->buffer_size, runtime->period_size); */ 870 /* 871 printk(KERN_DEBUG 872 "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", 873 ptr, runtime->buffer_size, runtime->period_size); 874 */ 861 875 return ptr; 862 876 } … … 1547 1561 unsigned int tram_shift) 1548 1562 { 1549 /* printk("tram_poke1: dst_left = 0x%p, dst_right = 0x%p, src = 0x%p, count = 0x%x\n", dst_left, dst_right, src, count); */ 1563 /* 1564 printk(KERN_DEBUG "tram_poke1: dst_left = 0x%p, dst_right = 0x%p, " 1565 "src = 0x%p, count = 0x%x\n", 1566 dst_left, dst_right, src, count); 1567 */ 1550 1568 if ((tram_shift & 1) == 0) { 1551 1569 while (count--) { … … 1624 1642 unsigned int i; 1625 1643 1626 /* printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2); */ 1644 /* 1645 printk(KERN_DEBUG "prepare: etram_pages = 0x%p, dma_area = 0x%x, " 1646 "buffer_size = 0x%x (0x%x)\n", 1647 emu->fx8010.etram_pages, runtime->dma_area, 1648 runtime->buffer_size, runtime->buffer_size << 2); 1649 */ 1627 1650 memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec)); 1628 1651 pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */ -
GPL/trunk/alsa-kernel/pci/emu10k1/io.c
r305 r426 227 227 228 228 if (timeout > 1000) { 229 snd_printk("emu10k1:I2C:timeout status=0x%x\n", status); 229 snd_printk(KERN_WARNING 230 "emu10k1:I2C:timeout status=0x%x\n", 231 status); 230 232 break; 231 233 } … … 489 491 break; 490 492 } 491 if (count > =16384)493 if (count > 16384) 492 494 break; 493 495 curtime = newtime; -
GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c
r305 r426 169 169 170 170 if (epcm) { 171 / /snd_printk("epcm free: %p\n", epcm);171 /* snd_printk(KERN_DEBUG "epcm free: %p\n", epcm); */ 172 172 kfree(epcm); 173 173 } … … 184 184 185 185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 186 / /snd_printk("epcm kcalloc: %p\n", epcm);186 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */ 187 187 188 188 if (epcm == NULL) … … 190 190 epcm->emu = emu; 191 191 epcm->substream = substream; 192 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 193 192 /* 193 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n", 194 substream->pcm->device, channel_id); 195 */ 194 196 runtime->private_data = epcm; 195 197 runtime->private_free = snd_p16v_pcm_free_substream; … … 201 203 202 204 channel->use=1; 203 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 204 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 205 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 206 channel->epcm=epcm; 205 #if 0 /* debug */ 206 snd_printk(KERN_DEBUG 207 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", 208 channel_id, channel, channel->use); 209 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 210 channel_id, chip, channel); 211 #endif /* debug */ 212 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 213 channel->epcm = epcm; 207 214 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 208 215 return err; … … 225 232 226 233 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 227 / /snd_printk("epcm kcalloc: %p\n", epcm);234 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */ 228 235 229 236 if (epcm == NULL) … … 231 238 epcm->emu = emu; 232 239 epcm->substream = substream; 233 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 234 240 /* 241 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n", 242 substream->pcm->device, channel_id); 243 */ 235 244 runtime->private_data = epcm; 236 245 runtime->private_free = snd_p16v_pcm_free_substream; … … 242 251 243 252 channel->use=1; 244 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 245 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 246 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 247 channel->epcm=epcm; 253 #if 0 /* debug */ 254 snd_printk(KERN_DEBUG 255 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", 256 channel_id, channel, channel->use); 257 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 258 channel_id, chip, channel); 259 #endif /* debug */ 260 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 261 channel->epcm = epcm; 248 262 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 249 263 return err; … … 335 349 u32 tmp; 336 350 337 //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)); 338 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 339 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes); 351 #if 0 /* debug */ 352 snd_printk(KERN_DEBUG "prepare:channel_number=%d, rate=%d, " 353 "format=0x%x, channels=%d, buffer_size=%ld, " 354 "period_size=%ld, periods=%u, frames_to_bytes=%d\n", 355 channel, runtime->rate, runtime->format, runtime->channels, 356 runtime->buffer_size, runtime->period_size, 357 runtime->periods, frames_to_bytes(runtime, 1)); 358 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n", 359 runtime->dma_addr, runtime->dma_area, table_base); 360 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n", 361 emu->p16v_buffer.addr, emu->p16v_buffer.area, 362 emu->p16v_buffer.bytes); 363 #endif /* debug */ 340 364 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 341 365 switch (runtime->rate) { … … 380 404 int channel = substream->pcm->device - emu->p16v_device_offset; 381 405 u32 tmp; 382 //printk("prepare capture: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)); 406 407 /* 408 printk(KERN_DEBUG "prepare capture:channel_number=%d, rate=%d, " 409 "format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, " 410 "frames_to_bytes=%d\n", 411 channel, runtime->rate, runtime->format, runtime->channels, 412 runtime->buffer_size, runtime->period_size, 413 frames_to_bytes(runtime, 1)); 414 */ 383 415 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 384 416 switch (runtime->rate) { … … 460 492 epcm = runtime->private_data; 461 493 channel = substream->pcm->device-emu->p16v_device_offset; 462 / /snd_printk("p16v channel=%d\n",channel);494 /* snd_printk(KERN_DEBUG "p16v channel=%d\n", channel); */ 463 495 epcm->running = running; 464 496 basic |= (0x1<<channel); … … 466 498 snd_pcm_trigger_done(s, substream); 467 499 } 468 / /snd_printk("basic=0x%x, inte=0x%x\n",basic, inte);500 /* snd_printk(KERN_DEBUG "basic=0x%x, inte=0x%x\n", basic, inte); */ 469 501 470 502 switch (cmd) { … … 559 591 printk(KERN_WARNING "buffer capture limited!\n"); 560 592 } 561 //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); 562 593 /* 594 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, " 595 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", 596 ptr1, ptr2, ptr, (int)runtime->buffer_size, 597 (int)runtime->period_size, (int)runtime->frame_bits, 598 (int)runtime->rate); 599 */ 563 600 return ptr; 564 601 } … … 593 630 if (chip->p16v_buffer.area) { 594 631 snd_dma_free_pages(&chip->p16v_buffer); 595 //snd_printk("period lables free: %p\n", &chip->p16v_buffer); 632 /* 633 snd_printk(KERN_DEBUG "period lables free: %p\n", 634 &chip->p16v_buffer); 635 */ 596 636 } 597 637 return 0; … … 605 645 int capture=1; 606 646 607 / /snd_printk("snd_p16v_pcm called. device=%d\n", device);647 /* snd_printk("KERN_DEBUG snd_p16v_pcm called. device=%d\n", device); */ 608 648 emu->p16v_device_offset = device; 609 649 if (rpcm) … … 632 672 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) 633 673 return err; 634 //snd_printk("preallocate playback substream: err=%d\n", err); 674 /* 675 snd_printk(KERN_DEBUG 676 "preallocate playback substream: err=%d\n", err); 677 */ 635 678 } 636 679 … … 643 686 65536 - 64, 65536 - 64)) < 0) 644 687 return err; 645 //snd_printk("preallocate capture substream: err=%d\n", err); 688 /* 689 snd_printk(KERN_DEBUG 690 "preallocate capture substream: err=%d\n", err); 691 */ 646 692 } 647 693 -
GPL/trunk/alsa-kernel/pci/emu10k1/voice.c
r399 r426 54 54 first_voice = last_voice = 0; 55 55 for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) { 56 // printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice); 56 /* 57 printk(KERN_DEBUG "i %d j %d next free %d!\n", 58 i, j, emu->next_free_voice); 59 */ 57 60 i %= NUM_G; 58 61 … … 72 75 } 73 76 if (!skip) { 74 / / printk("allocated voice %d\n", i);77 /* printk(KERN_DEBUG "allocated voice %d\n", i); */ 75 78 first_voice = i; 76 79 last_voice = (i + number) % NUM_G; … … 85 88 for (i = 0; i < number; i++) { 86 89 voice = &emu->voices[(first_voice + i) % NUM_G]; 87 // printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number); 90 /* 91 printk(kERN_DEBUG "voice alloc - %i, %i of %i\n", 92 voice->number, idx-first_voice+1, number); 93 */ 88 94 voice->use = 1; 89 95 switch (type) {
Note:
See TracChangeset
for help on using the changeset viewer.
