From 5c16ba4c4d5c0caf68d47e6ffb6f5a2f5923fed0 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 17 Mar 2009 04:46:11 +0000 Subject: [PATCH] Fix very last yellows. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20337 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/iriver/h10/lcd-h10_20gb.c | 7 +- firmware/target/coldfire/iaudio/x5/lcd-x5.c | 105 +++++++++--------- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c index 547999aed3..4e6aebadd2 100644 --- a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c +++ b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c @@ -39,7 +39,9 @@ static int lcd_contrast; static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; /* Forward declarations */ +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) static void lcd_display_off(void); +#endif /* register defines for the Renesas HD66773R */ #define R_START_OSC 0x00 @@ -314,7 +316,7 @@ void lcd_sleep(void) } #endif -#if defined(HAVE_LCD_ENABLE) +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) static void lcd_display_off(void) { display_on = false; @@ -337,6 +339,9 @@ static void lcd_display_off(void) /* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */ lcd_write_reg(R_DISP_CONTROL, 0x0000); } +#endif + +#if defined(HAVE_LCD_ENABLE) static void lcd_display_on(void) { /* Be sure power is on first */ diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c index 190b87547d..98eb5deb94 100644 --- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c @@ -52,9 +52,6 @@ static unsigned short r_gate_scan_start_pos = 0x0002; static unsigned short r_drv_output_control = 0x0313; static unsigned short r_horiz_ram_addr_pos = 0x7f00; -/* Forward declarations */ -static void lcd_display_off(void); - /* A15(0x8000) && CS1->CS, A1(0x0002)->RS */ #define LCD_CMD *(volatile unsigned short *)0xf0008000 #define LCD_DATA *(volatile unsigned short *)0xf0008002 @@ -267,6 +264,58 @@ static void lcd_power_on(void) power_on = true; } +static void lcd_display_on(void) +{ + /* Be sure power is on first */ + if (!power_on) + lcd_power_on(); + + /** Display ON Sequence **/ + /* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=01 */ + lcd_write_reg(R_DISP_CONTROL, 0x0001); + + sleep(HZ/25); /* Wait 2 frames or more */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=01 */ + lcd_write_reg(R_DISP_CONTROL, 0x0021 | r_disp_control_rev); + /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=11 */ + lcd_write_reg(R_DISP_CONTROL, 0x0023 | r_disp_control_rev); + + sleep(HZ/25); /* Wait 2 frames or more */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=11 */ + lcd_write_reg(R_DISP_CONTROL, 0x0033 | r_disp_control_rev); + + display_on = true; +} + +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) +static void lcd_display_off(void) +{ + display_on = false; + + /** Display OFF sequence **/ + /* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */ + + /* EQ1-0=00 already */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=10 */ + lcd_write_reg(R_DISP_CONTROL, 0x0032 | r_disp_control_rev); + + sleep(HZ/25); /* Wait 2 frames or more */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=10 */ + lcd_write_reg(R_DISP_CONTROL, 0x0022 | r_disp_control_rev); + + sleep(HZ/25); /* Wait 2 frames or more */ + + /* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */ + lcd_write_reg(R_DISP_CONTROL, 0x0000); +} +#endif + #if defined(HAVE_LCD_SLEEP) static void lcd_power_off(void) { @@ -307,56 +356,6 @@ void lcd_sleep(void) } #endif -static void lcd_display_on(void) -{ - /* Be sure power is on first */ - if (!power_on) - lcd_power_on(); - - /** Display ON Sequence **/ - /* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=01 */ - lcd_write_reg(R_DISP_CONTROL, 0x0001); - - sleep(HZ/25); /* Wait 2 frames or more */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=01 */ - lcd_write_reg(R_DISP_CONTROL, 0x0021 | r_disp_control_rev); - /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=11 */ - lcd_write_reg(R_DISP_CONTROL, 0x0023 | r_disp_control_rev); - - sleep(HZ/25); /* Wait 2 frames or more */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=11 */ - lcd_write_reg(R_DISP_CONTROL, 0x0033 | r_disp_control_rev); - - display_on = true; -} - -static void lcd_display_off(void) -{ - display_on = false; - - /** Display OFF sequence **/ - /* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */ - - /* EQ1-0=00 already */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=10 */ - lcd_write_reg(R_DISP_CONTROL, 0x0032 | r_disp_control_rev); - - sleep(HZ/25); /* Wait 2 frames or more */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=10 */ - lcd_write_reg(R_DISP_CONTROL, 0x0022 | r_disp_control_rev); - - sleep(HZ/25); /* Wait 2 frames or more */ - - /* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */ - lcd_write_reg(R_DISP_CONTROL, 0x0000); -} - /* LCD init */ void lcd_init_device(void) {