diff options
Diffstat (limited to 'firmware/target/arm/philips')
-rw-r--r-- | firmware/target/arm/philips/hdd6330/lcd-hdd6330.c | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c index 53c0be1d6e..4549f09d2a 100644 --- a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c +++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c | |||
@@ -24,6 +24,16 @@ | |||
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | #include "system.h" | 25 | #include "system.h" |
26 | 26 | ||
27 | /* register defines for Philips LCD 220x176x16 - model: LPH9165-2 */ | ||
28 | #define LCD_REG_UNKNOWN_00 0x00 | ||
29 | #define LCD_REG_UNKNOWN_01 0x01 | ||
30 | #define LCD_REG_UNKNOWN_05 0x05 | ||
31 | #define LCD_REG_WRITE_DATA_2_GRAM 0x06 | ||
32 | #define LCD_REG_HORIZ_ADDR_START 0x08 | ||
33 | #define LCD_REG_HORIZ_ADDR_END 0x09 | ||
34 | #define LCD_REG_VERT_ADDR_START 0x0a | ||
35 | #define LCD_REG_VERT_ADDR_END 0x0b | ||
36 | |||
27 | /* Display status */ | 37 | /* Display status */ |
28 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 38 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
29 | 39 | ||
@@ -50,7 +60,12 @@ static void lcd_send_reg(unsigned reg) | |||
50 | 60 | ||
51 | void lcd_init_device(void) | 61 | void lcd_init_device(void) |
52 | { | 62 | { |
53 | /* init handled by the OF bootloader */ | 63 | lcd_send_reg(LCD_REG_UNKNOWN_00); |
64 | lcd_send_data(0x00); | ||
65 | lcd_send_reg(LCD_REG_UNKNOWN_01); | ||
66 | lcd_send_data(0x48); | ||
67 | lcd_send_reg(LCD_REG_UNKNOWN_05); | ||
68 | lcd_send_data(0x0f); | ||
54 | } | 69 | } |
55 | 70 | ||
56 | /*** hardware configuration ***/ | 71 | /*** hardware configuration ***/ |
@@ -66,7 +81,9 @@ void lcd_set_contrast(int val) | |||
66 | 81 | ||
67 | void lcd_set_invert_display(bool yesno) | 82 | void lcd_set_invert_display(bool yesno) |
68 | { | 83 | { |
69 | (void)yesno; | 84 | int invert = (yesno) ? 0x40 : 0x00; |
85 | lcd_send_reg(LCD_REG_UNKNOWN_00); | ||
86 | lcd_send_data(invert); | ||
70 | } | 87 | } |
71 | 88 | ||
72 | /* turn the display upside down (call lcd_update() afterwards) */ | 89 | /* turn the display upside down (call lcd_update() afterwards) */ |
@@ -107,25 +124,19 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
107 | 124 | ||
108 | width = (width + 1) & ~1; | 125 | width = (width + 1) & ~1; |
109 | 126 | ||
110 | lcd_send_reg(0x01); | 127 | lcd_send_reg(LCD_REG_HORIZ_ADDR_START); |
111 | lcd_send_data(0x48); | ||
112 | |||
113 | lcd_send_reg(0x05); | ||
114 | lcd_send_data(0x0f); | ||
115 | |||
116 | lcd_send_reg(0x08); | ||
117 | lcd_send_data(y); | 128 | lcd_send_data(y); |
118 | 129 | ||
119 | lcd_send_reg(0x09); | 130 | lcd_send_reg(LCD_REG_HORIZ_ADDR_END); |
120 | lcd_send_data(y + height - 1); | 131 | lcd_send_data(y + height - 1); |
121 | 132 | ||
122 | lcd_send_reg(0x0a); | 133 | lcd_send_reg(LCD_REG_VERT_ADDR_START); |
123 | lcd_send_data(x + 16); | 134 | lcd_send_data(x + 16); |
124 | 135 | ||
125 | lcd_send_reg(0x0b); | 136 | lcd_send_reg(LCD_REG_VERT_ADDR_END); |
126 | lcd_send_data(x + width - 1 + 16); | 137 | lcd_send_data(x + width - 1 + 16); |
127 | 138 | ||
128 | lcd_send_reg(0x06); | 139 | lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); |
129 | 140 | ||
130 | const int stride_div_csub_x = stride/CSUB_X; | 141 | const int stride_div_csub_x = stride/CSUB_X; |
131 | 142 | ||
@@ -205,25 +216,19 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
205 | if ((width <= 0) || (height <= 0)) | 216 | if ((width <= 0) || (height <= 0)) |
206 | return; /* Nothing left to do. */ | 217 | return; /* Nothing left to do. */ |
207 | 218 | ||
208 | lcd_send_reg(0x01); | 219 | lcd_send_reg(LCD_REG_HORIZ_ADDR_START); |
209 | lcd_send_data(0x48); | ||
210 | |||
211 | lcd_send_reg(0x05); | ||
212 | lcd_send_data(0x0f); | ||
213 | |||
214 | lcd_send_reg(0x08); | ||
215 | lcd_send_data(y); | 220 | lcd_send_data(y); |
216 | 221 | ||
217 | lcd_send_reg(0x09); | 222 | lcd_send_reg(LCD_REG_HORIZ_ADDR_END); |
218 | lcd_send_data(y + height - 1); | 223 | lcd_send_data(y + height - 1); |
219 | 224 | ||
220 | lcd_send_reg(0x0a); | 225 | lcd_send_reg(LCD_REG_VERT_ADDR_START); |
221 | lcd_send_data(x + 16); | 226 | lcd_send_data(x + 16); |
222 | 227 | ||
223 | lcd_send_reg(0x0b); | 228 | lcd_send_reg(LCD_REG_VERT_ADDR_END); |
224 | lcd_send_data(x + width - 1 + 16); | 229 | lcd_send_data(x + width - 1 + 16); |
225 | 230 | ||
226 | lcd_send_reg(0x06); | 231 | lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); |
227 | 232 | ||
228 | addr = (unsigned long*)&lcd_framebuffer[y][x]; | 233 | addr = (unsigned long*)&lcd_framebuffer[y][x]; |
229 | 234 | ||