Commit b298af65 authored by Juha Yrjola's avatar Juha Yrjola Committed by Tony Lindgren

ARM: OMAP: DMA update

Sync with linux-omap tree. Updates DMA code to check for active
LCD transfers.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 50fc6897
...@@ -794,10 +794,6 @@ static void set_b1_regs(void) ...@@ -794,10 +794,6 @@ static void set_b1_regs(void)
w = omap_readw(OMAP1610_DMA_LCD_CTRL); w = omap_readw(OMAP1610_DMA_LCD_CTRL);
/* Always set the source port as SDRAM for now*/ /* Always set the source port as SDRAM for now*/
w &= ~(0x03 << 6); w &= ~(0x03 << 6);
if (lcd_dma.ext_ctrl)
w |= 1 << 8;
else
w &= ~(1 << 8);
if (lcd_dma.callback != NULL) if (lcd_dma.callback != NULL)
w |= 1 << 1; /* Block interrupt enable */ w |= 1 << 1; /* Block interrupt enable */
else else
...@@ -889,9 +885,15 @@ void omap_enable_lcd_dma(void) ...@@ -889,9 +885,15 @@ void omap_enable_lcd_dma(void)
*/ */
if (enable_1510_mode || !lcd_dma.ext_ctrl) if (enable_1510_mode || !lcd_dma.ext_ctrl)
return; return;
w = omap_readw(OMAP1610_DMA_LCD_CTRL);
w |= 1 << 8;
omap_writew(w, OMAP1610_DMA_LCD_CTRL);
w = omap_readw(OMAP1610_DMA_LCD_CCR); w = omap_readw(OMAP1610_DMA_LCD_CCR);
w |= 1 << 7; w |= 1 << 7;
omap_writew(w, OMAP1610_DMA_LCD_CCR); omap_writew(w, OMAP1610_DMA_LCD_CCR);
lcd_dma.active = 1; lcd_dma.active = 1;
} }
...@@ -922,10 +924,19 @@ void omap_setup_lcd_dma(void) ...@@ -922,10 +924,19 @@ void omap_setup_lcd_dma(void)
void omap_stop_lcd_dma(void) void omap_stop_lcd_dma(void)
{ {
u16 w;
lcd_dma.active = 0; lcd_dma.active = 0;
if (!enable_1510_mode && lcd_dma.ext_ctrl) if (enable_1510_mode || !lcd_dma.ext_ctrl)
omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~(1 << 7), return;
OMAP1610_DMA_LCD_CCR);
w = omap_readw(OMAP1610_DMA_LCD_CCR);
w &= ~(1 << 7);
omap_writew(w, OMAP1610_DMA_LCD_CCR);
w = omap_readw(OMAP1610_DMA_LCD_CTRL);
w &= ~(1 << 8);
omap_writew(w, OMAP1610_DMA_LCD_CTRL);
} }
/* /*
...@@ -972,6 +983,25 @@ dma_addr_t omap_get_dma_dst_pos(int lch) ...@@ -972,6 +983,25 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
(OMAP_DMA_CDSA_U(lch) << 16)); (OMAP_DMA_CDSA_U(lch) << 16));
} }
int omap_dma_running(void)
{
int lch;
/* Check if LCD DMA is running */
if (cpu_is_omap16xx())
if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN)
return 1;
for (lch = 0; lch < dma_chan_count; lch++) {
u16 w;
w = omap_readw(OMAP_DMA_CCR(lch));
if (w & OMAP_DMA_CCR_EN)
return 1;
}
return 0;
}
static int __init omap_init_dma(void) static int __init omap_init_dma(void)
{ {
int ch, r; int ch, r;
......
...@@ -241,6 +241,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue); ...@@ -241,6 +241,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
extern dma_addr_t omap_get_dma_src_pos(int lch); extern dma_addr_t omap_get_dma_src_pos(int lch);
extern dma_addr_t omap_get_dma_dst_pos(int lch); extern dma_addr_t omap_get_dma_dst_pos(int lch);
extern void omap_clear_dma(int lch); extern void omap_clear_dma(int lch);
extern int omap_dma_running(void);
/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
extern int omap_dma_in_1510_mode(void); extern int omap_dma_in_1510_mode(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment