]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix DMA register access to use _REG access
authorTony Lindgren <tony@atomide.com>
Wed, 9 Nov 2005 19:31:27 +0000 (11:31 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 9 Nov 2005 19:31:27 +0000 (11:31 -0800)
DMA register access changed to use REG16 adn REG32 macros when 24xx DMA
support was added

drivers/media/video/omap/omap16xxcam.c
drivers/net/irda/omap1610-ir.c
drivers/usb/gadget/omap_udc.c
sound/arm/omap-alsa-dma.c
sound/oss/omap-audio-dma-intfc.c

index c85851f298d965012ee96df3a281f7d995be5f0d..6f85bd25f01e74aa6ec355de0f2ba272f72cdb4a 100644 (file)
@@ -174,10 +174,10 @@ omap16xx_cam_link_open(struct omap16xxcam *data)
                 return ret;
         }
        data->next_dmach = data->dma_channel_number1;
-       omap_writew(data->dma_channel_number2, 
-                               OMAP_DMA_CLNK_CTRL(data->dma_channel_number1));
-       omap_writew(data->dma_channel_number1, 
-                               OMAP_DMA_CLNK_CTRL(data->dma_channel_number2));
+       OMAP_DMA_CLNK_CTRL_REG(data->dma_channel_number1) =
+               data->dma_channel_number2;
+       OMAP_DMA_CLNK_CTRL_REG(data->dma_channel_number2) =
+               data->dma_channel_number1;
 
        return 0;
 }
@@ -222,7 +222,7 @@ omap16xx_cam_dma_link_callback(int lch, unsigned short ch_status, void *data)
 
        while (cam->free_dmach < 2)
        {
-               if ((omap_readw(OMAP_DMA_CCR(lch)) & (1 << 7) ))
+               if (OMAP_DMA_CCR_REG(lch) & (1 << 7))
                        break;  
 
                count = (lch == cam->dma_channel_number2) ? 1 : 0;
@@ -341,10 +341,8 @@ omap16xxcam_start_dma(struct sgdma_state *sgdma,
                        sg_dma_len(sglist)/(4 * FIFO_TRIGGER_LVL), 
                        OMAP_DMA_SYNC_FRAME,
                        0, 0);
-       
 
-       omap_writew(omap_readw(OMAP_DMA_CLNK_CTRL(dmach)) & ~(1<<15), 
-                                       OMAP_DMA_CLNK_CTRL(dmach));
+       OMAP_DMA_CLNK_CTRL_REG(dmach) &= ~( 1<< 15);
 
        prev_dmach = (dmach == data->dma_channel_number2) ? 
                data->dma_channel_number1 : data->dma_channel_number2;
@@ -353,11 +351,8 @@ omap16xxcam_start_dma(struct sgdma_state *sgdma,
                data->new = 0;
                omap16xx_cam_waitfor_syncedge(data, EN_V_UP);
        } else {
-               if (omap_readw(OMAP_DMA_CCR(prev_dmach)) & (1 << 7)) {
-                       omap_writew((omap_readw(OMAP_DMA_CLNK_CTRL(prev_dmach)) |
-                                        (1 << 15)),
-                       OMAP_DMA_CLNK_CTRL(prev_dmach));
-               }
+               if (OMAP_DMA_CCR_REG(prev_dmach) & (1 << 7))
+                       OMAP_DMA_CLNK_CTRL_REG(prev_dmach) |= (1 << 15);
                else {
                        /* no transfer is in progress */
                        omap_start_dma(dmach);
index 1bfbb4ed47694d7da8a6ef568404a36ab94f72ac..19514560ad877de5ca787bea946c14f2806273e5 100644 (file)
@@ -404,8 +404,8 @@ omap1610_irda_irq(int irq, void *dev_id, struct pt_regs *hw_regs)
 
                skb_reserve(skb, 1);
 
-               w = omap_readw(OMAP_DMA_CDAC(si->rx_dma_channel));
-               w -= omap_readw(OMAP_DMA_CDSA_L(si->rx_dma_channel));
+               w = OMAP_DMA_CDAC_REG(si->rx_dma_channel);
+               w -= OMAP_DMA_CDSA_L_REG(si->rx_dma_channel);
 
                if (si->speed != 4000000) {
                        memcpy(skb_put(skb, w - 2), si->rx_buf_dma_virt, w - 2);        /* Copy DMA buffer to skb */
index e2144979fa0f58997bc1282c48e77b5094adf417..9e12923a5169f3dd44dd9f22b9f36c552ad3851a 100644 (file)
@@ -544,9 +544,9 @@ static inline dma_addr_t dma_csac(unsigned lch)
        /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
         * read before the DMA controller finished disabling the channel.
         */
-       csac = omap_readw(OMAP_DMA_CSAC(lch));
+       csac = OMAP_DMA_CSAC_REG(lch);
        if (csac == 0)
-               csac = omap_readw(OMAP_DMA_CSAC(lch));
+               csac = OMAP_DMA_CSAC_REG(lch);
        return csac;
 }
 
@@ -557,9 +557,9 @@ static inline dma_addr_t dma_cdac(unsigned lch)
        /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
         * read before the DMA controller finished disabling the channel.
         */
-       cdac = omap_readw(OMAP_DMA_CDAC(lch));
+       cdac = OMAP_DMA_CDAC_REG(lch);
        if (cdac == 0)
-               cdac = omap_readw(OMAP_DMA_CDAC(lch));
+               cdac = OMAP_DMA_CDAC_REG(lch);
        return cdac;
 }
 
@@ -584,7 +584,7 @@ static u16 dma_src_len(struct omap_ep *ep, dma_addr_t start)
 }
 
 #define DMA_DEST_LAST(x) (cpu_is_omap15xx() \
-               ? omap_readw(OMAP_DMA_CSAC(x)) /* really: CPC */ \
+               ? OMAP_DMA_CSAC_REG(x) /* really: CPC */ \
                : dma_cdac(x))
 
 static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start)
@@ -854,7 +854,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 
                /* channel type P: hw synch (fifo) */
                if (!cpu_is_omap15xx())
-                       omap_writew(2, OMAP_DMA_LCH_CTRL(ep->lch));
+                       OMAP1_DMA_LCH_CTRL_REG(ep->lch) = 2;
        }
 
 just_restart:
@@ -901,7 +901,7 @@ static void dma_channel_release(struct omap_ep *ep)
        else
                req = NULL;
 
-       active = ((1 << 7) & omap_readl(OMAP_DMA_CCR(ep->lch))) != 0;
+       active = ((1 << 7) & OMAP_DMA_CCR_REG(ep->lch)) != 0;
 
        DBG("%s release %s %cxdma%d %p\n", ep->ep.name,
                        active ? "active" : "idle",
index 7028577889d127c7216de305cd576eb48c8b7532..8d6e9b4cb05d3803721dfb459f43c9e7b7fcdd96 100644 (file)
@@ -428,8 +428,7 @@ static void sound_dma_irq_handler(int sound_curr_lch, u16 ch_status,
                sound_curr_lch, ch_status, dma_status, data);
 
        if (dma_status & (DCSR_ERROR)) {
-               omap_writew(omap_readw(OMAP_DMA_CCR(sound_curr_lch)) &
-                           ~DCCR_EN, OMAP_DMA_CCR(sound_curr_lch));
+               OMAP_DMA_CCR_REG(sound_curr_lch) &= ~DCCR_EN;
                ERR("DCSR_ERROR!\n");
                FN_OUT(-1);
                return;
index 2bd61073d7acd18f5b845ba5d7e86511441a81dc..9f3451731c7106e1e9c9a8966025f0d50baa46c4 100644 (file)
@@ -847,8 +847,7 @@ static void sound_dma_irq_handler(int sound_curr_lch, u16 ch_status, void *data)
                ch_status, dma_status, data);
 
        if (dma_status & (DCSR_ERROR)) {
-               omap_writew(omap_readw(OMAP_DMA_CCR(sound_curr_lch)) & ~DCCR_EN,
-                           OMAP_DMA_CCR(sound_curr_lch));
+               OMAP_DMA_CCR_REG(sound_curr_lch) &= ~DCCR_EN;
                ERR("DCSR_ERROR!\n");
                FN_OUT(-1);
                return;