Changeset 7de1988c in mainline for uspace/drv/audio/sb16/sb16.c


Ignore:
Timestamp:
2013-09-12T20:53:09Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ddd0499d
Parents:
8049b79
Message:

Adapt drivers using parsed HW resources to use the new interface.

File:
1 edited

Legend:

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

    r8049b79 r7de1988c  
    7777}
    7878
    79 void sb16_irq_code(void *regs, int dma8, int dma16, irq_cmd_t cmds[], irq_pio_range_t ranges[])
     79void sb16_irq_code(addr_range_t *regs, int dma8, int dma16, irq_cmd_t cmds[],
     80    irq_pio_range_t ranges[])
    8081{
    8182        assert(regs);
    8283        assert(dma8 > 0 && dma8 < 4);
    83         sb16_regs_t *registers = regs;
     84
     85        sb16_regs_t *registers = RNGABSPTR(*regs);
    8486        memcpy(cmds, irq_cmds, sizeof(irq_cmds));
    85         cmds[0].addr = (void*)&registers->dsp_read_status;
    86         ranges[0].base = (uintptr_t)registers;
     87        cmds[0].addr = (void *) &registers->dsp_read_status;
     88        ranges[0].base = (uintptr_t) registers;
    8789        ranges[0].size = sizeof(*registers);
    8890        if (dma16 > 4 && dma16 < 8) {
    8991                /* Valid dma16 */
    90                 cmds[1].addr = (void*)&registers->dma16_ack;
     92                cmds[1].addr = (void *) &registers->dma16_ack;
    9193        } else {
    9294                cmds[1].cmd = CMD_ACCEPT;
     
    9496}
    9597
    96 int sb16_init_sb16(sb16_t *sb, void *regs, size_t size,
    97     ddf_dev_t *dev, int dma8, int dma16)
     98int sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8,
     99    int dma16)
    98100{
    99101        assert(sb);
     102
    100103        /* Setup registers */
    101         int ret = pio_enable(regs, size, (void**)&sb->regs);
     104        int ret = pio_enable_range(regs, (void **) &sb->regs);
    102105        if (ret != EOK)
    103106                return ret;
    104         ddf_log_debug("PIO registers at %p accessible.", sb->regs);
     107        ddf_log_note("PIO registers at %p accessible.", sb->regs);
    105108
    106109        /* Initialize DSP */
     
    187190}
    188191
    189 int sb16_init_mpu(sb16_t *sb, void *regs, size_t size)
     192int sb16_init_mpu(sb16_t *sb, addr_range_t *regs)
    190193{
    191194        sb->mpu_regs = NULL;
Note: See TracChangeset for help on using the changeset viewer.