From 11d1b1d5dbc665c0ee46da8f73b154dcd2b4f689 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Wed, 9 Nov 2005 11:31:27 -0800 Subject: [PATCH] ARM: OMAP: Fix DMA register access to use _REG access DMA register access changed to use REG16 adn REG32 macros when 24xx DMA support was added --- drivers/media/video/omap/omap16xxcam.c | 21 ++++++++------------- drivers/net/irda/omap1610-ir.c | 4 ++-- drivers/usb/gadget/omap_udc.c | 14 +++++++------- sound/arm/omap-alsa-dma.c | 3 +-- sound/oss/omap-audio-dma-intfc.c | 3 +-- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers/media/video/omap/omap16xxcam.c b/drivers/media/video/omap/omap16xxcam.c index c85851f298d..6f85bd25f01 100644 --- a/drivers/media/video/omap/omap16xxcam.c +++ b/drivers/media/video/omap/omap16xxcam.c @@ -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); diff --git a/drivers/net/irda/omap1610-ir.c b/drivers/net/irda/omap1610-ir.c index 1bfbb4ed476..19514560ad8 100644 --- a/drivers/net/irda/omap1610-ir.c +++ b/drivers/net/irda/omap1610-ir.c @@ -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 */ diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index e2144979fa0..9e12923a516 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -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", diff --git a/sound/arm/omap-alsa-dma.c b/sound/arm/omap-alsa-dma.c index 7028577889d..8d6e9b4cb05 100644 --- a/sound/arm/omap-alsa-dma.c +++ b/sound/arm/omap-alsa-dma.c @@ -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; diff --git a/sound/oss/omap-audio-dma-intfc.c b/sound/oss/omap-audio-dma-intfc.c index 2bd61073d7a..9f3451731c7 100644 --- a/sound/oss/omap-audio-dma-intfc.c +++ b/sound/oss/omap-audio-dma-intfc.c @@ -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; -- 2.41.1