aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/dma.c')
-rw-r--r--arch/arm/plat-omap/dma.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 015bd2cf869f..c0a5c2fa42bd 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -794,10 +794,6 @@ static void set_b1_regs(void)
794 w = omap_readw(OMAP1610_DMA_LCD_CTRL); 794 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
795 /* Always set the source port as SDRAM for now*/ 795 /* Always set the source port as SDRAM for now*/
796 w &= ~(0x03 << 6); 796 w &= ~(0x03 << 6);
797 if (lcd_dma.ext_ctrl)
798 w |= 1 << 8;
799 else
800 w &= ~(1 << 8);
801 if (lcd_dma.callback != NULL) 797 if (lcd_dma.callback != NULL)
802 w |= 1 << 1; /* Block interrupt enable */ 798 w |= 1 << 1; /* Block interrupt enable */
803 else 799 else
@@ -889,9 +885,15 @@ void omap_enable_lcd_dma(void)
889 */ 885 */
890 if (enable_1510_mode || !lcd_dma.ext_ctrl) 886 if (enable_1510_mode || !lcd_dma.ext_ctrl)
891 return; 887 return;
888
889 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
890 w |= 1 << 8;
891 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
892
892 w = omap_readw(OMAP1610_DMA_LCD_CCR); 893 w = omap_readw(OMAP1610_DMA_LCD_CCR);
893 w |= 1 << 7; 894 w |= 1 << 7;
894 omap_writew(w, OMAP1610_DMA_LCD_CCR); 895 omap_writew(w, OMAP1610_DMA_LCD_CCR);
896
895 lcd_dma.active = 1; 897 lcd_dma.active = 1;
896} 898}
897 899
@@ -922,10 +924,19 @@ void omap_setup_lcd_dma(void)
922 924
923void omap_stop_lcd_dma(void) 925void omap_stop_lcd_dma(void)
924{ 926{
927 u16 w;
928
925 lcd_dma.active = 0; 929 lcd_dma.active = 0;
926 if (!enable_1510_mode && lcd_dma.ext_ctrl) 930 if (enable_1510_mode || !lcd_dma.ext_ctrl)
927 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~(1 << 7), 931 return;
928 OMAP1610_DMA_LCD_CCR); 932
933 w = omap_readw(OMAP1610_DMA_LCD_CCR);
934 w &= ~(1 << 7);
935 omap_writew(w, OMAP1610_DMA_LCD_CCR);
936
937 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
938 w &= ~(1 << 8);
939 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
929} 940}
930 941
931/* 942/*
@@ -972,6 +983,25 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
972 (OMAP_DMA_CDSA_U(lch) << 16)); 983 (OMAP_DMA_CDSA_U(lch) << 16));
973} 984}
974 985
986int omap_dma_running(void)
987{
988 int lch;
989
990 /* Check if LCD DMA is running */
991 if (cpu_is_omap16xx())
992 if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN)
993 return 1;
994
995 for (lch = 0; lch < dma_chan_count; lch++) {
996 u16 w;
997
998 w = omap_readw(OMAP_DMA_CCR(lch));
999 if (w & OMAP_DMA_CCR_EN)
1000 return 1;
1001 }
1002 return 0;
1003}
1004
975static int __init omap_init_dma(void) 1005static int __init omap_init_dma(void)
976{ 1006{
977 int ch, r; 1007 int ch, r;