Changeset f14e6ea in mainline for uspace/drv/audio/sb16/sb16.c


Ignore:
Timestamp:
2011-10-21T20:57:40Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dce7e41
Parents:
7257eea6
Message:

sb16: Add interrupt handler.

Set buffer alignment to something that memalign can handle (might be wrong).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/sb16.c

    r7257eea6 rf14e6ea  
    9696int sb16_init_mpu(sb16_drv_t *drv, void *regs, size_t size)
    9797{
     98        drv->mpu_regs = NULL;
    9899        return ENOTSUP;
    99100}
     101/*----------------------------------------------------------------------------*/
     102void sb16_interrupt(sb16_drv_t *drv)
     103{
     104        assert(drv);
     105        ddf_log_note("SB16 interrupt.\n");
     106        /* The acknowledgment of interrupts on DSP version 4.xx is different;
     107         * It can contain MPU-401 indicator and DMA16 transfers are acked
     108         * differently */
     109        if (drv->dsp.version.major >= 4) {
     110                pio_write_8(&drv->regs->mixer_address, MIXER_IRQ_ADDRESS);
     111                const uint8_t irq_mask = pio_read_8(&drv->regs->mixer_data);
     112                ddf_log_note("SB16 IRQ mask %hhx.\n", irq_mask);
     113                /* Third bit is MPU-401 interrupt */
     114                if (irq_mask & 0x4) {
     115                        return;
     116                }
     117        }
     118        sb_dsp_interrupt(&drv->dsp);
     119
     120}
Note: See TracChangeset for help on using the changeset viewer.