Changeset 7de1988c in mainline for uspace/drv/audio/sb16/sb16.c
- Timestamp:
- 2013-09-12T20:53:09Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ddd0499d
- Parents:
- 8049b79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/sb16.c
r8049b79 r7de1988c 77 77 } 78 78 79 void sb16_irq_code(void *regs, int dma8, int dma16, irq_cmd_t cmds[], irq_pio_range_t ranges[]) 79 void sb16_irq_code(addr_range_t *regs, int dma8, int dma16, irq_cmd_t cmds[], 80 irq_pio_range_t ranges[]) 80 81 { 81 82 assert(regs); 82 83 assert(dma8 > 0 && dma8 < 4); 83 sb16_regs_t *registers = regs; 84 85 sb16_regs_t *registers = RNGABSPTR(*regs); 84 86 memcpy(cmds, irq_cmds, sizeof(irq_cmds)); 85 cmds[0].addr = (void *)®isters->dsp_read_status;86 ranges[0].base = (uintptr_t) registers;87 cmds[0].addr = (void *) ®isters->dsp_read_status; 88 ranges[0].base = (uintptr_t) registers; 87 89 ranges[0].size = sizeof(*registers); 88 90 if (dma16 > 4 && dma16 < 8) { 89 91 /* Valid dma16 */ 90 cmds[1].addr = (void *)®isters->dma16_ack;92 cmds[1].addr = (void *) ®isters->dma16_ack; 91 93 } else { 92 94 cmds[1].cmd = CMD_ACCEPT; … … 94 96 } 95 97 96 int sb16_init_sb16(sb16_t *sb, void *regs, size_t size,97 ddf_dev_t *dev, int dma8,int dma16)98 int sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8, 99 int dma16) 98 100 { 99 101 assert(sb); 102 100 103 /* Setup registers */ 101 int ret = pio_enable (regs, size, (void**)&sb->regs);104 int ret = pio_enable_range(regs, (void **) &sb->regs); 102 105 if (ret != EOK) 103 106 return ret; 104 ddf_log_ debug("PIO registers at %p accessible.", sb->regs);107 ddf_log_note("PIO registers at %p accessible.", sb->regs); 105 108 106 109 /* Initialize DSP */ … … 187 190 } 188 191 189 int sb16_init_mpu(sb16_t *sb, void *regs, size_t size)192 int sb16_init_mpu(sb16_t *sb, addr_range_t *regs) 190 193 { 191 194 sb->mpu_regs = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.