Changeset b7f7183 in mainline
- Timestamp:
- 2011-10-24T15:40:37Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7785e951
- Parents:
- b130d0e
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dma_controller.c
rb130d0e rb7f7183 62 62 #define DMA_SINGLE_MASK_CHAN_SEL_SHIFT (0) 63 63 #define DMA_SINGLE_MASK_CHAN_TO_REG(x) \ 64 (( (x % 4)& DMA_SINGLE_MASK_CHAN_SEL_MASK) << DMA_SINGLE_MASK_CHAN_SEL_SHIFT)64 ((x & DMA_SINGLE_MASK_CHAN_SEL_MASK) << DMA_SINGLE_MASK_CHAN_SEL_SHIFT) 65 65 #define DMA_SINGLE_MASK_MASKED_FLAG (1 << 2) 66 66 … … 69 69 #define DMA_MODE_CHAN_SELECT_SHIFT (0) 70 70 #define DMA_MODE_CHAN_TO_REG(x) \ 71 (( (x % 4)& DMA_MODE_CHAN_SELECT_MASK) << DMA_MODE_CHAN_SELECT_SHIFT)71 ((x & DMA_MODE_CHAN_SELECT_MASK) << DMA_MODE_CHAN_SELECT_SHIFT) 72 72 #define DMA_MODE_CHAN_TRA_MASK (0x3) 73 73 #define DMA_MODE_CHAN_TRA_SHIFT (2) … … 217 217 } 218 218 /*----------------------------------------------------------------------------*/ 219 int dma_setup_channel(unsigned channel, uintptr_t pa, size_t size)219 int dma_setup_channel(unsigned channel, uintptr_t pa, uint16_t size) 220 220 { 221 221 if (channel == 0 || channel == 4) … … 235 235 /* Size is the count of 16bit words */ 236 236 assert(size % 2 == 0); 237 size /= 2;237 size >>= 1; 238 238 /* Address is fun: lower 16bits need to be shifted by 1 */ 239 239 pa = ((pa & 0xffff) >> 1) | (pa & 0xff0000); … … 250 250 251 251 /* Set address -- reset flip-flop*/ 252 pio_write_8(dma_channel.flip_flop_address, 1);252 pio_write_8(dma_channel.flip_flop_address, 0); 253 253 254 254 /* Low byte */ … … 268 268 269 269 /* Set size -- reset flip-flop */ 270 pio_write_8(dma_channel.flip_flop_address, 1);270 pio_write_8(dma_channel.flip_flop_address, 0); 271 271 272 272 /* Low byte */ -
uspace/drv/audio/sb16/dma_controller.h
rb130d0e rb7f7183 43 43 } transfer_mode_t; 44 44 45 int dma_setup_channel(unsigned channel, uintptr_t pa, size_t size);45 int dma_setup_channel(unsigned channel, uintptr_t pa, uint16_t size); 46 46 47 47 int dma_prepare_channel(
Note:
See TracChangeset
for help on using the changeset viewer.