Index: firmware/export/config-ipodcolor.h =================================================================== --- firmware/export/config-ipodcolor.h (revision 20348) +++ firmware/export/config-ipodcolor.h (working copy) @@ -173,4 +173,6 @@ #define IPOD_ACCESSORY_PROTOCOL #define HAVE_SERIAL +#define HAVE_LCD_SHUTDOWN + #endif Index: firmware/target/arm/ipod/lcd-color_nano.c =================================================================== --- firmware/target/arm/ipod/lcd-color_nano.c (revision 20348) +++ firmware/target/arm/ipod/lcd-color_nano.c (working copy) @@ -39,7 +39,7 @@ #define LCD_CNTL_VERT_RAM_ADDR_POS 0x45 /*** globals ***/ -int lcd_type = 1; /* 0 = "old" Color/Photo, 1 = "new" Color & Nano */ +int lcd_type = 1; /* 0 = "old" Color/Photo, 1 and 3 = simillar to HD66789R */ static inline void lcd_wait_write(void) { @@ -91,18 +91,9 @@ if (IPOD_HW_REVISION == 0x60000) { lcd_type = 0; } else { - int gpio_a01, gpio_a04; - - /* A01 */ - gpio_a01 = (GPIOA_INPUT_VAL & 0x2) >> 1; - /* A04 */ - gpio_a04 = (GPIOA_INPUT_VAL & 0x10) >> 4; - - if (((gpio_a01 << 1) | gpio_a04) == 0 || ((gpio_a01 << 1) | gpio_a04) == 2) { + lcd_type = (GPIOA_INPUT_VAL & 0x2) | ((GPIOA_INPUT_VAL & 0x10) >> 4); + if (lcd_type == 2) lcd_type = 0; - } else { - lcd_type = 1; - } } if (lcd_type == 0) { lcd_cmd_data(0xef, 0x0); @@ -440,3 +431,45 @@ { lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); } + +#if defined(HAVE_LCD_SHUTDOWN) && CONFIG_LCD == LCD_IPODCOLOR +void lcd_shutdown(void) +{ + if (lcd_type == 0) { + lcd_cmd_data(0xEF, 0); + lcd_cmd_data(0x80, 0); + udelay(1000); + lcd_cmd_data(1, 1); + } + else if (lcd_type == 1) { + lcd_cmd_data(7, 0x236); + sleep(HZ*40/1000); + lcd_cmd_data(7, 0x226); + sleep(HZ*40/1000); + lcd_cmd_data(7, 0x204); + lcd_cmd_data(0x10, 0x7574); + sleep(HZ*200/1000); + lcd_cmd_data(0x10, 0x7504); + sleep(HZ*50/1000); + lcd_cmd_data(0x10, 0x501); + } + else if (lcd_type == 3) { + lcd_cmd_data(7, 0x4016); + sleep(HZ*20/1000); + lcd_cmd_data(0x59, 0x11); + sleep(HZ*20/1000); + lcd_cmd_data(0x59, 3); + sleep(HZ*20/1000); + lcd_cmd_data(0x59, 2); + sleep(HZ*20/1000); + lcd_cmd_data(0x10, 0x6360); + sleep(HZ*200/1000); + lcd_cmd_data(0x10, 0x6300); + sleep(HZ*50/1000); + lcd_cmd_data(0x10, 0x300); + lcd_cmd_data(0x59, 0); + lcd_cmd_data(7, 0x4004); + lcd_cmd_data(0x10, 0x301); + } +} +#endif