OMAP1: Fix non-working LCD on OMAP310

This patch fixes bug introduced in revision:

f8e9e98454606e43b728269de21db349f57861c7
omap1: DMA: move LCD related code from plat-omap to mach-omap1

The code introduced by this patch didn't consider any other CPUs but OMAP1510,
which rendered OMAP310 -- which has the same LCD controller -- non-working. Use
cpu_is_omap15xx() instead of cpu_is_omap1510() to squash this issue.

Bug found on Palm Zire 71 hardware.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by Marek Vasut and committed by Tony Lindgren 719078a6 daf7aabc

+12 -12
+12 -12
arch/arm/mach-omap1/lcd_dma.c
··· 37 * On OMAP1510, internal LCD controller will start the transfer 38 * when it gets enabled, so assume DMA running if LCD enabled. 39 */ 40 - if (cpu_is_omap1510()) 41 if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN) 42 return 1; 43 ··· 95 96 void omap_set_lcd_dma_b1_rotation(int rotate) 97 { 98 - if (cpu_is_omap1510()) { 99 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n"); 100 BUG(); 101 return; ··· 106 107 void omap_set_lcd_dma_b1_mirror(int mirror) 108 { 109 - if (cpu_is_omap1510()) { 110 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n"); 111 BUG(); 112 } ··· 116 117 void omap_set_lcd_dma_b1_vxres(unsigned long vxres) 118 { 119 - if (cpu_is_omap1510()) { 120 printk(KERN_ERR "DMA virtual resulotion is not supported " 121 "in 1510 mode\n"); 122 BUG(); ··· 127 128 void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale) 129 { 130 - if (cpu_is_omap1510()) { 131 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n"); 132 BUG(); 133 } ··· 177 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); 178 /* 1510 DMA requires the bottom address to be 2 more 179 * than the actual last memory access location. */ 180 - if (cpu_is_omap1510() && 181 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32) 182 bottom += 2; 183 ei = PIXSTEP(0, 0, 1, 0); ··· 241 return; /* Suppress warning about uninitialized vars */ 242 } 243 244 - if (cpu_is_omap1510()) { 245 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U); 246 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L); 247 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U); ··· 343 BUG(); 344 return; 345 } 346 - if (!cpu_is_omap1510()) 347 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1, 348 OMAP1610_DMA_LCD_CCR); 349 lcd_dma.reserved = 0; ··· 360 * connected. Otherwise the OMAP internal controller will 361 * start the transfer when it gets enabled. 362 */ 363 - if (cpu_is_omap1510() || !lcd_dma.ext_ctrl) 364 return; 365 366 w = omap_readw(OMAP1610_DMA_LCD_CTRL); ··· 378 void omap_setup_lcd_dma(void) 379 { 380 BUG_ON(lcd_dma.active); 381 - if (!cpu_is_omap1510()) { 382 /* Set some reasonable defaults */ 383 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR); 384 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP); 385 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL); 386 } 387 set_b1_regs(); 388 - if (!cpu_is_omap1510()) { 389 u16 w; 390 391 w = omap_readw(OMAP1610_DMA_LCD_CCR); ··· 407 u16 w; 408 409 lcd_dma.active = 0; 410 - if (cpu_is_omap1510() || !lcd_dma.ext_ctrl) 411 return; 412 413 w = omap_readw(OMAP1610_DMA_LCD_CCR);
··· 37 * On OMAP1510, internal LCD controller will start the transfer 38 * when it gets enabled, so assume DMA running if LCD enabled. 39 */ 40 + if (cpu_is_omap15xx()) 41 if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN) 42 return 1; 43 ··· 95 96 void omap_set_lcd_dma_b1_rotation(int rotate) 97 { 98 + if (cpu_is_omap15xx()) { 99 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n"); 100 BUG(); 101 return; ··· 106 107 void omap_set_lcd_dma_b1_mirror(int mirror) 108 { 109 + if (cpu_is_omap15xx()) { 110 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n"); 111 BUG(); 112 } ··· 116 117 void omap_set_lcd_dma_b1_vxres(unsigned long vxres) 118 { 119 + if (cpu_is_omap15xx()) { 120 printk(KERN_ERR "DMA virtual resulotion is not supported " 121 "in 1510 mode\n"); 122 BUG(); ··· 127 128 void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale) 129 { 130 + if (cpu_is_omap15xx()) { 131 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n"); 132 BUG(); 133 } ··· 177 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); 178 /* 1510 DMA requires the bottom address to be 2 more 179 * than the actual last memory access location. */ 180 + if (cpu_is_omap15xx() && 181 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32) 182 bottom += 2; 183 ei = PIXSTEP(0, 0, 1, 0); ··· 241 return; /* Suppress warning about uninitialized vars */ 242 } 243 244 + if (cpu_is_omap15xx()) { 245 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U); 246 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L); 247 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U); ··· 343 BUG(); 344 return; 345 } 346 + if (!cpu_is_omap15xx()) 347 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1, 348 OMAP1610_DMA_LCD_CCR); 349 lcd_dma.reserved = 0; ··· 360 * connected. Otherwise the OMAP internal controller will 361 * start the transfer when it gets enabled. 362 */ 363 + if (cpu_is_omap15xx() || !lcd_dma.ext_ctrl) 364 return; 365 366 w = omap_readw(OMAP1610_DMA_LCD_CTRL); ··· 378 void omap_setup_lcd_dma(void) 379 { 380 BUG_ON(lcd_dma.active); 381 + if (!cpu_is_omap15xx()) { 382 /* Set some reasonable defaults */ 383 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR); 384 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP); 385 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL); 386 } 387 set_b1_regs(); 388 + if (!cpu_is_omap15xx()) { 389 u16 w; 390 391 w = omap_readw(OMAP1610_DMA_LCD_CCR); ··· 407 u16 w; 408 409 lcd_dma.active = 0; 410 + if (cpu_is_omap15xx() || !lcd_dma.ext_ctrl) 411 return; 412 413 w = omap_readw(OMAP1610_DMA_LCD_CCR);