Changeset 352


Ignore:
Timestamp:
Apr 21, 2008, 11:54:49 AM (17 years ago)
Author:
Paul Smedley
Message:

IRQ patch from Pavel

Location:
GPL/branches/uniaud32-2.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.0/drv32/rmhelp.cpp

    r65 r352  
    156156
    157157  Resource.ResourceType          = RS_TYPE_IRQ;
    158   Resource.IRQResource.IRQLevel  = (USHORT)ulIrq;
     158  Resource.IRQResource.IRQLevel  = (USHORT)ulIrq & 0xff;
    159159  Resource.IRQResource.IRQFlags  = ( fShared ) ? RS_IRQ_SHARED : RS_IRQ_EXCLUSIVE;
    160   Resource.IRQResource.PCIIrqPin = RS_PCI_INT_NONE;
     160  Resource.IRQResource.PCIIrqPin = (USHORT)( (ulIrq >> 8) & 0xf);
    161161
    162162  rc = RMAllocResource(DriverHandle,                    // Handle to driver.
  • GPL/branches/uniaud32-2.0/lib32/irq.c

    r316 r352  
    6969                    unsigned long x0, const char *x1, void *x2)
    7070{
    71     IRQ_SLOT    *pSlot = FindSlot(irq);
     71    IRQ_SLOT    *pSlot = FindSlot(irq & 0xff);
    7272    unsigned    u, uSlotNo = (unsigned)-1;
    7373    if( !pSlot )
     
    8686    if( pSlot )
    8787    {
    88         if(RMRequestIRQ(/*hResMgr,*/ irq, (x0 & SA_SHIRQ) != 0) == FALSE) {
     88        if(RMRequestIRQ(/*hResMgr,*/ irq , (x0 & SA_SHIRQ) != 0) == FALSE) {
    8989            dprintf(("RMRequestIRQ failed for irq %d", irq));
    9090            //  return 0;
     
    9595            if( pSlot->irqHandlers[u].handler == NULL )
    9696            {
    97                 pSlot->irqNo = irq;
     97                pSlot->irqNo = irq & 0xff;
    9898                pSlot->irqHandlers[u].handler = handler;
    9999                pSlot->irqHandlers[u].x0 = x0;
     
    102102
    103103                if( pSlot->flHandlers != 0 ||
    104                    ALSA_SetIrq(irq, uSlotNo, (x0 & SA_SHIRQ) != 0) )
     104                   ALSA_SetIrq( irq & 0xff, uSlotNo, (x0 & SA_SHIRQ) != 0) )
    105105                {
    106106                    pSlot->flHandlers |= 1 << u;
     
    113113    }
    114114
    115     dprintf(("request_irq: Unable to register irq handler for irq %d\n", irq));
     115    dprintf(("request_irq: Unable to register irq handler for irq %d\n", irq & 0xff ));
    116116    return 1;
    117117}
     
    162162     if( pSlot )        pSlot->fEOI = 1;
    163163     */
    164     eoiIrq[irq]++;
     164    eoiIrq[irq & 0xff]++;
    165165}
    166166
  • GPL/branches/uniaud32-2.0/lib32/sound.c

    r344 r352  
    778778    BOOL                fTryAgain = FALSE;
    779779    ULONG ulMinRate, ulMaxRate;
    780     struct snd_pcm_info      *pcminfo = NULL;
    781780
    782781#ifdef DEBUG
     
    803802        return OSSERR_INVALID_PARAMETER;
    804803    }
    805 
    806     // Get pcminfo so that we have the device & mixer name so we can do chipset specific hacks
    807     pcminfo = (struct snd_pcm_info *)kmalloc(sizeof(struct snd_pcm_info)+sizeof(struct snd_pcm_hw_params), GFP_KERNEL);
    808     //set operation to non-blocking
    809     pHandle->file.f_flags = O_NONBLOCK;
    810    
    811     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_INFO, (ULONG)pcminfo);
    812 
    813804tryagain:
    814805    //set operation to non-blocking
     
    930921    minperiodbytes = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->min;
    931922    maxperiodbytes = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->max;
     923
    932924    if(periodbytes < minperiodbytes) {
    933925        periodbytes = minperiodbytes;
     
    955947    //make sure period size is a whole fraction of the buffer size
    956948    bufsize = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->max;
     949
     950#if 0
    957951    if(periodsize) {
    958952        nrperiods = bufsize/periodbytes;
     
    964958        return OSSERR_INVALID_PARAMETER;
    965959    }
     960#else
     961    nrperiods = 3;
     962#endif
    966963    //check nr of periods against lower and upper boundaries
    967964    minnrperiods = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIODS)->min;
     
    10121009
    10131010//#ifdef DEBUG_PK
    1014     printk("Hardware parameters: sample rate %i, data type %i, channels %i, period size %i, nrperiods %i\n",
    1015              pHwParams->ulSampleRate, pHwParams->ulDataType, pHwParams->ulNumChannels, periodsize, nrperiods);
     1011    printk("Hardware parameters: sample rate %i, data type %i, channels %i, period bytes %i, period size %i, nrperiods %i\n",
     1012             pHwParams->ulSampleRate, pHwParams->ulDataType, pHwParams->ulNumChannels, periodbytes, periodsize, nrperiods);
    10161013//#endif
    10171014    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_HW_PARAMS, (ULONG)__Stack32ToFlat(&params));
Note: See TracChangeset for help on using the changeset viewer.