summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-03-05 00:21:56 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-03-05 00:21:56 +0000
commit562b9de7cbf3affed3979a8884c31b716734b03c (patch)
tree283d01b5a54e285ea1f0df49c1f13066bdfd8ac5
parent6ef63a53737ba772ea4ffddcb16d6a3979644f79 (diff)
downloadrockbox-562b9de7cbf3affed3979a8884c31b716734b03c.tar.gz
rockbox-562b9de7cbf3affed3979a8884c31b716734b03c.zip
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
-rw-r--r--bootloader/telechips.c7
-rw-r--r--firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c27
2 files changed, 19 insertions, 15 deletions
diff --git a/bootloader/telechips.c b/bootloader/telechips.c
index e1b80f9be6..dcb0c48d6c 100644
--- a/bootloader/telechips.c
+++ b/bootloader/telechips.c
@@ -62,8 +62,8 @@ void* main(void)
62#endif 62#endif
63 63
64 power_init(); 64 power_init();
65 lcd_init();
66 system_init(); 65 system_init();
66 lcd_init();
67 67
68#if defined(COWON_D2) 68#if defined(COWON_D2)
69 kernel_init(); 69 kernel_init();
@@ -74,13 +74,8 @@ void* main(void)
74 backlight_init(); 74 backlight_init();
75 75
76 font_init(); 76 font_init();
77
78 lcd_setfont(FONT_SYSFIXED); 77 lcd_setfont(FONT_SYSFIXED);
79 78
80#if defined(COWON_D2)
81 lcd_enable(true);
82#endif
83
84 _backlight_on(); 79 _backlight_on();
85 80
86#if defined(COWON_D2) 81#if defined(COWON_D2)
diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
index 181c58669e..7514f93886 100644
--- a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
@@ -222,12 +222,14 @@ void lcd_enable(bool on)
222 222
223 if (on) 223 if (on)
224 { 224 {
225 lcd_display_on(); /* Turn on display */ 225 LCDC_CTRL |= 1; /* controller enable */
226 lcd_update(); /* Resync display */ 226 GPIOA_SET = (1<<6); /* backlight enable - not visible otherwise */
227 lcd_update(); /* Resync display */
227 } 228 }
228 else 229 else
229 { 230 {
230 lcd_display_off(); /* Turn off display */ 231 LCDC_CTRL &= ~1; /* controller disable */
232 GPIOA_CLEAR = (1<<6); /* backlight off */
231 } 233 }
232} 234}
233 235
@@ -236,6 +238,7 @@ bool lcd_enabled(void)
236 return display_on; 238 return display_on;
237} 239}
238 240
241/* TODO: implement lcd_sleep() and separate out the power on/off functions */
239 242
240void lcd_init_device(void) 243void lcd_init_device(void)
241{ 244{
@@ -264,22 +267,28 @@ void lcd_init_device(void)
264 267
265 LCDC_I1BASE = (unsigned int)lcd_framebuffer; /* dirty, dirty hack */ 268 LCDC_I1BASE = (unsigned int)lcd_framebuffer; /* dirty, dirty hack */
266 LCDC_I1SIZE = (LCD_HEIGHT<<16) | LCD_WIDTH; /* image 1 size */ 269 LCDC_I1SIZE = (LCD_HEIGHT<<16) | LCD_WIDTH; /* image 1 size */
267 //LCDC_I1POS = (0<<16) | 0; /* position */ 270 LCDC_I1POS = (0<<16) | 0; /* position */
268 //LCDC_I1OFF = 0; /* address offset */ 271 LCDC_I1OFF = 0; /* address offset */
269 //LCDC_I1SCALE = 0; /* scaling */ 272 LCDC_I1SCALE = 0; /* scaling */
270 LCDC_I1CTRL = 5; /* 565bpp (7 = 888bpp) */ 273 LCDC_I1CTRL = 5; /* 565bpp (7 = 888bpp) */
271 //LCDC_CTRL &= ~(1<<28); 274 LCDC_CTRL &= ~(1<<28);
272 275
273 LCDC_CLKDIV = (LCDC_CLKDIV &~ 0xFF00FF) | (1<<16) | 2; /* and this means? */ 276 LCDC_CLKDIV = (LCDC_CLKDIV &~ 0xFF00FF) | (1<<16) | 2; /* and this means? */
274 277
275 /* set and clear various flags - not investigated yet */ 278 /* set and clear various flags - not investigated yet */
276 //LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */ 279 LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */
277 LCDC_CTRL |= 0x02800144; /* set bits 2,6,8,25,23 */ 280 LCDC_CTRL |= 0x02800144; /* set bits 2,6,8,25,23 */
278 LCDC_CTRL = (LCDC_CTRL &~ 0xF0000) | 0x20000; 281 LCDC_CTRL = (LCDC_CTRL &~ 0xF0000) | 0x20000;
279 //LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000; 282 LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000;
280 283
281 /* enable LCD controller */ 284 /* enable LCD controller */
282 LCDC_CTRL |= 1; 285 LCDC_CTRL |= 1;
286
287 /* enable LTV250QV panel */
288 lcd_display_on();
289
290 /* turn on the backlight, without it the LCD is not visible at all */
291 GPIOA_SET = (1<<6);
283} 292}
284 293
285 294