]> Zhao Yanbai Git Server - minix.git/commitdiff
sb16: Don't confuse pv_set() 53/753/2
authorArne Welzel <arne.welzel@gmail.com>
Wed, 14 Nov 2012 21:59:38 +0000 (22:59 +0100)
committerGerrit Code Review <gerrit@gerrit>
Tue, 20 Aug 2013 17:42:30 +0000 (19:42 +0200)
Change-Id: Ib7b528aa3a369b54dda3bbceb498db4a600c4cb4

drivers/audio/sb16/sb16.c

index 84574ccbfbf26f089f53d729e57f5365c28723ed..db7cd7f454ff66e89cb2599c0172d70c6398f8a1 100644 (file)
@@ -295,12 +295,12 @@ static void dsp_dma_setup(phys_bytes address, int count, int DmaMode) {
                /* set DMA mode */
                pv_set(pvb[2], DMA8_MODE, (DmaMode == DEV_WRITE_S ? DMA8_AUTO_PLAY : DMA8_AUTO_REC)); 
 
-               pv_set(pvb[3], DMA8_ADDR, address >>  0);        /* Low_byte of address */
-               pv_set(pvb[4], DMA8_ADDR, address >>  8);        /* High byte of address */
-               pv_set(pvb[5], DMA8_PAGE, address >> 16);        /* 64K page number */
-               pv_set(pvb[6], DMA8_COUNT, count >> 0);          /* Low byte of count */
-               pv_set(pvb[7], DMA8_COUNT, count >> 8);          /* High byte of count */
-               pv_set(pvb[8], DMA8_MASK, SB_DMA_8);           /* Enable DMA channel */
+               pv_set(pvb[3], DMA8_ADDR, (u8_t)(address >>  0)); /* Low_byte of address */
+               pv_set(pvb[4], DMA8_ADDR, (u8_t)(address >>  8)); /* High byte of address */
+               pv_set(pvb[5], DMA8_PAGE, (u8_t)(address >> 16)); /* 64K page number */
+               pv_set(pvb[6], DMA8_COUNT, (u8_t)(count >> 0));   /* Low byte of count */
+               pv_set(pvb[7], DMA8_COUNT, (u8_t)(count >> 8));   /* High byte of count */
+               pv_set(pvb[8], DMA8_MASK, SB_DMA_8);              /* Enable DMA channel */
 
                sys_voutb(pvb, 9);
        } else {  /* 16 bit sound */
@@ -316,8 +316,8 @@ static void dsp_dma_setup(phys_bytes address, int count, int DmaMode) {
                pv_set(pvb[3], DMA16_ADDR, (address >> 1) & 0xFF);  /* Low_byte of address */
                pv_set(pvb[4], DMA16_ADDR, (address >> 9) & 0xFF);  /* High byte of address */
                pv_set(pvb[5], DMA16_PAGE, (address >> 16) & 0xFE); /* 128K page number */
-               pv_set(pvb[6], DMA16_COUNT, count >> 1);            /* Low byte of count */
-               pv_set(pvb[7], DMA16_COUNT, count >> 9);            /* High byte of count */
+               pv_set(pvb[6], DMA16_COUNT, (u8_t)(count >> 1));    /* Low byte of count */
+               pv_set(pvb[7], DMA16_COUNT, (u8_t)(count >> 9));    /* High byte of count */
                pv_set(pvb[8], DMA16_MASK, SB_DMA_16 & 3);          /* Enable DMA channel */
 
                sys_voutb(pvb, 9);