summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2011-01-08 21:01:06 +0000
committerMichael Sparmann <theseven@rockbox.org>2011-01-08 21:01:06 +0000
commitdd6990d698c240fa0ca98ce0e9f719960ffcf480 (patch)
treef801ab4a362638802e87010cb7d0085a21d69804 /firmware
parent1b275d8ddb6407ef8965e81e4916949ca343d5f9 (diff)
Fix iPod Classic LCD problems
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29009 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c67
1 files changed, 33 insertions, 34 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
index 1de6a8e62f..bbb1c9c0d0 100644
--- a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
@@ -56,7 +56,7 @@ static inline void s5l_lcd_write_cmd_data(int cmd, int data)
LCD_WCMD = cmd;
while (LCD_STATUS & 0x10);
- LCD_WDATA = data;
+ LCD_WDATA = (data & 0xff) | ((data & 0x7f00) << 1);
}
static inline void s5l_lcd_write_cmd(unsigned short cmd)
@@ -103,34 +103,34 @@ void lcd_shutdown(void)
pmu_write(0x2b, 0); /* Kill the backlight, instantly. */
pmu_write(0x29, 0);
- if (lcd_type == 3)
- {
- s5l_lcd_write_cmd_data(0x7, 0x172);
- s5l_lcd_write_cmd_data(0x30, 0x3ff);
- sleep(HZ / 10);
- s5l_lcd_write_cmd_data(0x7, 0x120);
- s5l_lcd_write_cmd_data(0x30, 0x0);
- s5l_lcd_write_cmd_data(0x100, 0x780);
- s5l_lcd_write_cmd_data(0x7, 0x0);
- s5l_lcd_write_cmd_data(0x101, 0x260);
- s5l_lcd_write_cmd_data(0x102, 0xa9);
- sleep(HZ / 30);
- s5l_lcd_write_cmd_data(0x100, 0x700);
- s5l_lcd_write_cmd_data(0x100, 0x704);
- }
- else if (lcd_type == 1)
- {
- s5l_lcd_write_cmd(0x28);
- s5l_lcd_write_cmd(0x10);
- sleep(HZ / 10);
- }
- else
- {
- s5l_lcd_write_cmd(0x28);
- sleep(HZ / 20);
- s5l_lcd_write_cmd(0x10);
- sleep(HZ / 20);
- }
+ if (lcd_type & 2)
+ {
+ s5l_lcd_write_cmd_data(0x7, 0x172);
+ s5l_lcd_write_cmd_data(0x30, 0x3ff);
+ sleep(HZ / 10);
+ s5l_lcd_write_cmd_data(0x7, 0x120);
+ s5l_lcd_write_cmd_data(0x30, 0x0);
+ s5l_lcd_write_cmd_data(0x100, 0x780);
+ s5l_lcd_write_cmd_data(0x7, 0x0);
+ s5l_lcd_write_cmd_data(0x101, 0x260);
+ s5l_lcd_write_cmd_data(0x102, 0xa9);
+ sleep(HZ / 30);
+ s5l_lcd_write_cmd_data(0x100, 0x700);
+ s5l_lcd_write_cmd_data(0x100, 0x704);
+ }
+ else if (lcd_type == 1)
+ {
+ s5l_lcd_write_cmd(0x28);
+ s5l_lcd_write_cmd(0x10);
+ sleep(HZ / 10);
+ }
+ else
+ {
+ s5l_lcd_write_cmd(0x28);
+ sleep(HZ / 20);
+ s5l_lcd_write_cmd(0x10);
+ sleep(HZ / 20);
+ }
}
void lcd_sleep(void)
@@ -187,8 +187,8 @@ void lcd_update_rect(int x, int y, int width, int height)
s5l_lcd_write_cmd_data(R_VERT_ADDR_START_POS, y0);
s5l_lcd_write_cmd_data(R_VERT_ADDR_END_POS, y1);
- s5l_lcd_write_cmd_data(R_HORIZ_GRAM_ADDR_SET, (x1 << 8) | x0);
- s5l_lcd_write_cmd_data(R_VERT_GRAM_ADDR_SET, (y1 << 8) | y0);
+ s5l_lcd_write_cmd_data(R_HORIZ_GRAM_ADDR_SET, x0);
+ s5l_lcd_write_cmd_data(R_VERT_GRAM_ADDR_SET, y0);
s5l_lcd_write_cmd(R_WRITE_DATA_TO_GRAM);
} else {
@@ -253,10 +253,9 @@ void lcd_blit_yuv(unsigned char * const src[3],
s5l_lcd_write_cmd_data(R_VERT_ADDR_START_POS, y0);
s5l_lcd_write_cmd_data(R_VERT_ADDR_END_POS, y1);
- s5l_lcd_write_cmd_data(R_HORIZ_GRAM_ADDR_SET, (x1 << 8) | x0);
- s5l_lcd_write_cmd_data(R_VERT_GRAM_ADDR_SET, (y1 << 8) | y0);
+ s5l_lcd_write_cmd_data(R_HORIZ_GRAM_ADDR_SET, x0);
+ s5l_lcd_write_cmd_data(R_VERT_GRAM_ADDR_SET, y0);
- s5l_lcd_write_cmd(0);
s5l_lcd_write_cmd(R_WRITE_DATA_TO_GRAM);
} else {
s5l_lcd_write_cmd(R_COLUMN_ADDR_SET);