Ignore:
Timestamp:
May 9, 2009, 11:45:26 AM (16 years ago)
Author:
Paul Smedley
Message:

Update alsa-kernel to ALSA 1.0.20 level

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  
    104104                        vp = &emu->voices[best[i].voice];
    105105                        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                                */
    107110                                continue;
    108111                        }
     
    336339        emem->map_locked++;
    337340        if (snd_emu10k1_memblk_map(hw, emem) < 0) {
    338                 // printk("emu: cannot map!\n");
     341                /* printk(KERN_ERR "emu: cannot map!\n"); */
    339342                return -ENOMEM;
    340343        }
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c

    r402 r426  
    715715{
    716716        struct snd_emu10k1 *emu = data;
    717         int tmp, tmp2;
    718         int reg;
     717        u32 tmp, tmp2, reg;
    719718        int err;
    720719
     
    762761                        snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
    763762                        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);
    765765                        /* Sync clocking between 1010 and Dock */
    766766                        /* Allow DLL to settle */
     
    808808{
    809809        unsigned int i;
    810         int tmp, tmp2;
    811         int reg;
     810        u32 tmp, tmp2, reg;
    812811        int err;
    813812        const char *filename = NULL;
     
    891890        snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
    892891        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);
    894893        /* Enable 48Volt power to Audio Dock */
    895894        snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
     
    15321531         .spk71 = 1,
    15331532         .spdif_bug = 1,
     1533         .invert_shared_spdif = 1,      /* digital/analog switch swapped */
    15341534         .ac97_chip = 1} ,
    15351535        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c

    r410 r426  
    898898        if ((err = pci_enable_device(pci)) < 0)
    899899                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) {
    902902                snd_printk(KERN_ERR "error to set 28bit mask DMA\n");
    903903                pci_disable_device(pci);
  • GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c

    r399 r426  
    15201520        if (emu->card_capabilities->emu_model) {
    15211521                /* 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");
    15231523                for (z = 0; z < 8; z++) {
    15241524                        if (emu->card_capabilities->ca0108_chip) {
     
    15681568        if (emu->card_capabilities->emu_model) {
    15691569                if (emu->card_capabilities->ca0108_chip) {
    1570                         snd_printk("EMU2 inputs on\n");
     1570                        snd_printk(KERN_INFO "EMU2 inputs on\n");
    15711571                        for (z = 0; z < 0x10; z++) {
    15721572                                snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
     
    15761576                        }
    15771577                } else {
    1578                         snd_printk("EMU inputs on\n");
     1578                        snd_printk(KERN_INFO "EMU inputs on\n");
    15791579                        /* Capture 16 (originally 8) channels of S32_LE sound */
    15801580
    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                        */
    15821585                        /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */
    15831586                        /* A_P16VIN(0) is delayed by one sample,
     
    24912494                if (!capable(CAP_SYS_ADMIN))
    24922495                        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);
    25002500                res = snd_emu10k1_icode_poke(emu, icode);
    25012501                kfree(icode);
    25022502                return res;
    25032503        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);
    25112507                res = snd_emu10k1_icode_peek(emu, icode);
    25122508                if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) {
     
    25172513                return res;
    25182514        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);
    25262518                res = snd_emu10k1_ipcm_poke(emu, ipcm);
    25272519                kfree(ipcm);
    25282520                return res;
    25292521        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);
    25372525                res = snd_emu10k1_ipcm_peek(emu, ipcm);
    25382526                if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) {
  • GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c

    r305 r426  
    4545                return;
    4646#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",
    4848                        epcm->substream->runtime->hw->pointer(emu, epcm->substream),
    4949                        snd_pcm_lib_period_bytes(epcm->substream),
     
    147147                                              &epcm->extra);
    148148                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                        */
    150154                        for (i = 0; i < voices; i++) {
    151155                                snd_emu10k1_voice_free(epcm->emu, epcm->voices[i]);
     
    738742        int result = 0;
    739743
    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        */
    741748        spin_lock(&emu->reg_lock);
    742749        switch (cmd) {
     
    787794                outl(epcm->capture_ipr, emu->port + IPR);
    788795                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                */
    790800                switch (epcm->type) {
    791801                case CAPTURE_AC97ADC:
     
    858868        }
    859869#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        */
    861875        return ptr;
    862876}
     
    15471561                                                   unsigned int tram_shift)
    15481562{
    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        */
    15501568        if ((tram_shift & 1) == 0) {
    15511569                while (count--) {
     
    16241642        unsigned int i;
    16251643       
    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        */
    16271650        memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec));
    16281651        pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */
  • GPL/trunk/alsa-kernel/pci/emu10k1/io.c

    r305 r426  
    227227
    228228                        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);
    230232                                break;
    231233                        }
     
    489491                                break;
    490492                }
    491                 if (count >= 16384)
     493                if (count > 16384)
    492494                        break;
    493495                curtime = newtime;
  • GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c

    r305 r426  
    169169 
    170170        if (epcm) {
    171                 //snd_printk("epcm free: %p\n", epcm);
     171                /* snd_printk(KERN_DEBUG "epcm free: %p\n", epcm); */
    172172                kfree(epcm);
    173173        }
     
    184184
    185185        epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
    186         //snd_printk("epcm kcalloc: %p\n", epcm);
     186        /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
    187187
    188188        if (epcm == NULL)
     
    190190        epcm->emu = emu;
    191191        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        */
    194196        runtime->private_data = epcm;
    195197        runtime->private_free = snd_p16v_pcm_free_substream;
     
    201203
    202204        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;
    207214        if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
    208215                return err;
     
    225232
    226233        epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
    227         //snd_printk("epcm kcalloc: %p\n", epcm);
     234        /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
    228235
    229236        if (epcm == NULL)
     
    231238        epcm->emu = emu;
    232239        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        */
    235244        runtime->private_data = epcm;
    236245        runtime->private_free = snd_p16v_pcm_free_substream;
     
    242251
    243252        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;
    248262        if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
    249263                return err;
     
    335349        u32 tmp;
    336350       
    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 */
    340364        tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
    341365        switch (runtime->rate) {
     
    380404        int channel = substream->pcm->device - emu->p16v_device_offset;
    381405        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        */
    383415        tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
    384416        switch (runtime->rate) {
     
    460492                epcm = runtime->private_data;
    461493                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); */
    463495                epcm->running = running;
    464496                basic |= (0x1<<channel);
     
    466498                snd_pcm_trigger_done(s, substream);
    467499        }
    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); */
    469501
    470502        switch (cmd) {
     
    559591                printk(KERN_WARNING "buffer capture limited!\n");
    560592        }
    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        */
    563600        return ptr;
    564601}
     
    593630        if (chip->p16v_buffer.area) {
    594631                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                */
    596636        }
    597637        return 0;
     
    605645        int capture=1;
    606646 
    607         //snd_printk("snd_p16v_pcm called. device=%d\n", device);
     647        /* snd_printk("KERN_DEBUG snd_p16v_pcm called. device=%d\n", device); */
    608648        emu->p16v_device_offset = device;
    609649        if (rpcm)
     
    632672                                                         ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
    633673                        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                */
    635678        }
    636679
     
    643686                                                   65536 - 64, 65536 - 64)) < 0)
    644687                        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                */
    646692        }
    647693 
  • GPL/trunk/alsa-kernel/pci/emu10k1/voice.c

    r399 r426  
    5454        first_voice = last_voice = 0;
    5555        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                */
    5760                i %= NUM_G;
    5861
     
    7275                }
    7376                if (!skip) {
    74                         // printk("allocated voice %d\n", i);
     77                        /* printk(KERN_DEBUG "allocated voice %d\n", i); */
    7578                        first_voice = i;
    7679                        last_voice = (i + number) % NUM_G;
     
    8588        for (i = 0; i < number; i++) {
    8689                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                */
    8894                voice->use = 1;
    8995                switch (type) {
Note: See TracChangeset for help on using the changeset viewer.