summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-03-13 19:36:58 +0000
committerJens Arnold <amiconn@rockbox.org>2008-03-13 19:36:58 +0000
commit3c561f2cf999b2d805084aabeb4d5feac6fa3893 (patch)
tree71c4d1eabf3124719b539780b7bac94800e214cc
parentbf3c96c50267ef26a2155502b4841e0074cd12a8 (diff)
downloadrockbox-3c561f2cf999b2d805084aabeb4d5feac6fa3893.tar.gz
rockbox-3c561f2cf999b2d805084aabeb4d5feac6fa3893.zip
Make the LCD remote work in the Iriver H1x0 and H300 bootloaders as well (untested). * Only try the initial remote LCD init if the remote is plugged, and do it in main builds as well, giving slightly earlier remote LCD output when booting. * Fix delays in the X5/M5 remote LCD init. * Remove an unnecessary check in the X5/M5 remote LCD driver and the M3 LCD driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16655 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/iaudio/lcd-remote-iaudio.c12
-rw-r--r--firmware/target/coldfire/iaudio/m3/lcd-m3.c8
-rw-r--r--firmware/target/coldfire/iriver/lcd-remote-iriver.c58
3 files changed, 42 insertions, 36 deletions
diff --git a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
index 3c14bb61a0..5a03dc6180 100644
--- a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
+++ b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
@@ -324,7 +324,7 @@ void lcd_remote_on(void)
324{ 324{
325 CS_HI; 325 CS_HI;
326 CLK_HI; 326 CLK_HI;
327 sleep(10); 327 sleep(HZ/100);
328 328
329 lcd_remote_write_command(LCD_SET_DUTY_RATIO); 329 lcd_remote_write_command(LCD_SET_DUTY_RATIO);
330 lcd_remote_write_command(0x70); /* 1/128 */ 330 lcd_remote_write_command(0x70); /* 1/128 */
@@ -339,7 +339,7 @@ void lcd_remote_on(void)
339 339
340 lcd_remote_write_command(LCD_CONTROL_POWER | 7); /* All circuits ON */ 340 lcd_remote_write_command(LCD_CONTROL_POWER | 7); /* All circuits ON */
341 341
342 sleep(30); 342 sleep(3*HZ/100);
343 343
344 lcd_remote_write_command_ex(LCD_SET_GRAY | 0, 0x00); 344 lcd_remote_write_command_ex(LCD_SET_GRAY | 0, 0x00);
345 lcd_remote_write_command_ex(LCD_SET_GRAY | 1, 0x00); 345 lcd_remote_write_command_ex(LCD_SET_GRAY | 1, 0x00);
@@ -371,7 +371,7 @@ void lcd_remote_off(void)
371void lcd_remote_poweroff(void) 371void lcd_remote_poweroff(void)
372{ 372{
373 /* Set power save -> Power OFF (VDD - VSS) .. that's it */ 373 /* Set power save -> Power OFF (VDD - VSS) .. that's it */
374 if (remote_initialized && remote_detect()) 374 if (remote_initialized)
375 lcd_remote_write_command(LCD_SET_POWER_SAVE | 1); 375 lcd_remote_write_command(LCD_SET_POWER_SAVE | 1);
376} 376}
377 377
@@ -430,9 +430,9 @@ void lcd_remote_init_device(void)
430 or_l(0x01000000, &GPIO_FUNCTION); 430 or_l(0x01000000, &GPIO_FUNCTION);
431 431
432 lcd_remote_clear_display(); 432 lcd_remote_clear_display();
433#ifdef BOOTLOADER 433 if (remote_detect())
434 lcd_remote_on(); 434 lcd_remote_on();
435#else 435#ifndef BOOTLOADER
436 tick_add_task(remote_tick); 436 tick_add_task(remote_tick);
437#endif 437#endif
438} 438}
diff --git a/firmware/target/coldfire/iaudio/m3/lcd-m3.c b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
index d54e0596ab..b8c410b321 100644
--- a/firmware/target/coldfire/iaudio/m3/lcd-m3.c
+++ b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
@@ -362,7 +362,7 @@ void lcd_off(void)
362void lcd_poweroff(void) 362void lcd_poweroff(void)
363{ 363{
364 /* Set power save -> Power OFF (VDD - VSS) .. that's it */ 364 /* Set power save -> Power OFF (VDD - VSS) .. that's it */
365 if (initialized && remote_detect()) 365 if (initialized)
366 lcd_write_command(LCD_SET_POWER_SAVE | 1); 366 lcd_write_command(LCD_SET_POWER_SAVE | 1);
367} 367}
368 368
@@ -421,9 +421,9 @@ void lcd_init_device(void)
421 or_l(0x40000000, &GPIO_FUNCTION); 421 or_l(0x40000000, &GPIO_FUNCTION);
422 422
423 lcd_clear_display(); 423 lcd_clear_display();
424#ifdef BOOTLOADER 424 if (remote_detect())
425 lcd_on(); 425 lcd_on();
426#else 426#ifndef BOOTLOADER
427 tick_add_task(lcd_tick); 427 tick_add_task(lcd_tick);
428#endif 428#endif
429} 429}
diff --git a/firmware/target/coldfire/iriver/lcd-remote-iriver.c b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
index 29dbfad3db..cab7cc4104 100644
--- a/firmware/target/coldfire/iriver/lcd-remote-iriver.c
+++ b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
@@ -72,7 +72,6 @@ static bool cached_invert = false;
72static bool cached_flip = false; 72static bool cached_flip = false;
73static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING; 73static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING;
74 74
75static void remote_tick(void);
76 75
77#ifdef HAVE_REMOTE_LCD_TICKING 76#ifdef HAVE_REMOTE_LCD_TICKING
78static inline void _byte_delay(int delay) 77static inline void _byte_delay(int delay)
@@ -414,31 +413,6 @@ int remote_type(void)
414 return _remote_type; 413 return _remote_type;
415} 414}
416 415
417void lcd_remote_init_device(void)
418{
419#ifdef IRIVER_H300_SERIES
420 or_l(0x10010000, &GPIO_FUNCTION); /* GPIO16: RS
421 GPIO28: CLK */
422
423 or_l(0x00040006, &GPIO1_FUNCTION); /* GPO33: Backlight
424 GPIO34: CS
425 GPIO50: Data */
426 or_l(0x10010000, &GPIO_ENABLE);
427 or_l(0x00040006, &GPIO1_ENABLE);
428#else
429 or_l(0x10010800, &GPIO_FUNCTION); /* GPIO11: Backlight
430 GPIO16: RS
431 GPIO28: CLK */
432
433 or_l(0x00040004, &GPIO1_FUNCTION); /* GPIO34: CS
434 GPIO50: Data */
435 or_l(0x10010800, &GPIO_ENABLE);
436 or_l(0x00040004, &GPIO1_ENABLE);
437#endif
438 lcd_remote_clear_display();
439 tick_add_task(remote_tick);
440}
441
442void lcd_remote_on(void) 416void lcd_remote_on(void)
443{ 417{
444 CS_HI; 418 CS_HI;
@@ -475,6 +449,7 @@ void lcd_remote_off(void)
475 CS_HI; 449 CS_HI;
476} 450}
477 451
452#ifndef BOOTLOADER
478/* Monitor remote hotswap */ 453/* Monitor remote hotswap */
479static void remote_tick(void) 454static void remote_tick(void)
480{ 455{
@@ -549,6 +524,37 @@ static void remote_tick(void)
549 if (cs_countdown == 0) 524 if (cs_countdown == 0)
550 CS_HI; 525 CS_HI;
551} 526}
527#endif
528
529void lcd_remote_init_device(void)
530{
531#ifdef IRIVER_H300_SERIES
532 or_l(0x10010000, &GPIO_FUNCTION); /* GPIO16: RS
533 GPIO28: CLK */
534
535 or_l(0x00040006, &GPIO1_FUNCTION); /* GPO33: Backlight
536 GPIO34: CS
537 GPIO50: Data */
538 or_l(0x10010000, &GPIO_ENABLE);
539 or_l(0x00040006, &GPIO1_ENABLE);
540#else
541 or_l(0x10010800, &GPIO_FUNCTION); /* GPIO11: Backlight
542 GPIO16: RS
543 GPIO28: CLK */
544
545 or_l(0x00040004, &GPIO1_FUNCTION); /* GPIO34: CS
546 GPIO50: Data */
547 or_l(0x10010800, &GPIO_ENABLE);
548 or_l(0x00040004, &GPIO1_ENABLE);
549#endif
550
551 lcd_remote_clear_display();
552 if (remote_detect())
553 lcd_remote_on();
554#ifndef BOOTLOADER
555 tick_add_task(remote_tick);
556#endif
557}
552 558
553/* Update the display. 559/* Update the display.
554 This must be called after all other LCD functions that change the display. */ 560 This must be called after all other LCD functions that change the display. */