1
0
Fork 0
forked from len0rd/rockbox

D2: Make lcd_init_device() actually turn on the LCD, in preparation for booting the main image. Previously this required an explicit lcd_enable(true).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16523 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rob Purchase 2008-03-05 00:21:56 +00:00
parent 6ef63a5373
commit 562b9de7cb
2 changed files with 19 additions and 15 deletions

View file

@ -62,8 +62,8 @@ void* main(void)
#endif
power_init();
lcd_init();
system_init();
lcd_init();
#if defined(COWON_D2)
kernel_init();
@ -74,13 +74,8 @@ void* main(void)
backlight_init();
font_init();
lcd_setfont(FONT_SYSFIXED);
#if defined(COWON_D2)
lcd_enable(true);
#endif
_backlight_on();
#if defined(COWON_D2)

View file

@ -222,12 +222,14 @@ void lcd_enable(bool on)
if (on)
{
lcd_display_on(); /* Turn on display */
lcd_update(); /* Resync display */
LCDC_CTRL |= 1; /* controller enable */
GPIOA_SET = (1<<6); /* backlight enable - not visible otherwise */
lcd_update(); /* Resync display */
}
else
{
lcd_display_off(); /* Turn off display */
LCDC_CTRL &= ~1; /* controller disable */
GPIOA_CLEAR = (1<<6); /* backlight off */
}
}
@ -236,6 +238,7 @@ bool lcd_enabled(void)
return display_on;
}
/* TODO: implement lcd_sleep() and separate out the power on/off functions */
void lcd_init_device(void)
{
@ -264,22 +267,28 @@ void lcd_init_device(void)
LCDC_I1BASE = (unsigned int)lcd_framebuffer; /* dirty, dirty hack */
LCDC_I1SIZE = (LCD_HEIGHT<<16) | LCD_WIDTH; /* image 1 size */
//LCDC_I1POS = (0<<16) | 0; /* position */
//LCDC_I1OFF = 0; /* address offset */
//LCDC_I1SCALE = 0; /* scaling */
LCDC_I1POS = (0<<16) | 0; /* position */
LCDC_I1OFF = 0; /* address offset */
LCDC_I1SCALE = 0; /* scaling */
LCDC_I1CTRL = 5; /* 565bpp (7 = 888bpp) */
//LCDC_CTRL &= ~(1<<28);
LCDC_CTRL &= ~(1<<28);
LCDC_CLKDIV = (LCDC_CLKDIV &~ 0xFF00FF) | (1<<16) | 2; /* and this means? */
/* set and clear various flags - not investigated yet */
//LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */
LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */
LCDC_CTRL |= 0x02800144; /* set bits 2,6,8,25,23 */
LCDC_CTRL = (LCDC_CTRL &~ 0xF0000) | 0x20000;
//LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000;
LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000;
/* enable LCD controller */
LCDC_CTRL |= 1;
/* enable LTV250QV panel */
lcd_display_on();
/* turn on the backlight, without it the LCD is not visible at all */
GPIOA_SET = (1<<6);
}