diff options
author | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-18 14:11:41 +0000 |
---|---|---|
committer | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-18 14:11:41 +0000 |
commit | 2813d50acfe1980d625d4a0dcffa6275de5f87f8 (patch) | |
tree | bd627edcd25ae5df02def107618f7b32ba3da1ee /firmware/target/arm/lcd-c200_c200v2.c | |
parent | 926aae8161b8781885b33e342aec2a5183fd404a (diff) | |
download | rockbox-2813d50acfe1980d625d4a0dcffa6275de5f87f8.tar.gz rockbox-2813d50acfe1980d625d4a0dcffa6275de5f87f8.zip |
C200v2 lcd controller still gets stuck sometimes, do a full controller init in lcd_enable()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26920 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/lcd-c200_c200v2.c')
-rw-r--r-- | firmware/target/arm/lcd-c200_c200v2.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c index 062ed08d62..5393352fd1 100644 --- a/firmware/target/arm/lcd-c200_c200v2.c +++ b/firmware/target/arm/lcd-c200_c200v2.c | |||
@@ -182,14 +182,9 @@ static inline void as3525_dbop_init(void) | |||
182 | 182 | ||
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | /* LCD init */ | 185 | static void lcd_reset(void) |
186 | void lcd_init_device(void) | ||
187 | { | 186 | { |
188 | #if defined(SANSA_C200) | 187 | #if defined(SANSA_C200V2) |
189 | c200v1_lcd_init(); | ||
190 | #elif defined(SANSA_C200V2) | ||
191 | as3525_dbop_init(); | ||
192 | |||
193 | /* reset lcd */ | 188 | /* reset lcd */ |
194 | GPIOB_DIR |= (1<<6); | 189 | GPIOB_DIR |= (1<<6); |
195 | GPIOB_PIN(6) = 0; /* pull reset low */ | 190 | GPIOB_PIN(6) = 0; /* pull reset low */ |
@@ -197,7 +192,6 @@ void lcd_init_device(void) | |||
197 | GPIOB_PIN(6) = 1<<6; /* release reset */ | 192 | GPIOB_PIN(6) = 1<<6; /* release reset */ |
198 | lcd_delay(20); | 193 | lcd_delay(20); |
199 | #endif | 194 | #endif |
200 | |||
201 | lcd_send_command(R_STANDBY_OFF, 0); | 195 | lcd_send_command(R_STANDBY_OFF, 0); |
202 | lcd_delay(20); | 196 | lcd_delay(20); |
203 | 197 | ||
@@ -249,6 +243,17 @@ void lcd_init_device(void) | |||
249 | lcd_send_command(R_DISPLAY_ON, 0); | 243 | lcd_send_command(R_DISPLAY_ON, 0); |
250 | } | 244 | } |
251 | 245 | ||
246 | /* LCD init */ | ||
247 | void lcd_init_device(void) | ||
248 | { | ||
249 | #if defined(SANSA_C200) | ||
250 | c200v1_lcd_init(); | ||
251 | #elif defined(SANSA_C200V2) | ||
252 | as3525_dbop_init(); | ||
253 | #endif | ||
254 | lcd_reset(); | ||
255 | } | ||
256 | |||
252 | /*** hardware configuration ***/ | 257 | /*** hardware configuration ***/ |
253 | int lcd_default_contrast(void) | 258 | int lcd_default_contrast(void) |
254 | { | 259 | { |
@@ -277,8 +282,13 @@ void lcd_enable(bool yesno) | |||
277 | 282 | ||
278 | if ((is_lcd_enabled = yesno)) | 283 | if ((is_lcd_enabled = yesno)) |
279 | { | 284 | { |
285 | #ifdef SANSA_C200V2 | ||
286 | /* lcd sometimes gets stuck, do full init here */ | ||
287 | lcd_reset(); | ||
288 | #else | ||
280 | lcd_send_command(R_STANDBY_OFF, 0); | 289 | lcd_send_command(R_STANDBY_OFF, 0); |
281 | lcd_send_command(R_DISPLAY_ON, 0); | 290 | lcd_send_command(R_DISPLAY_ON, 0); |
291 | #endif | ||
282 | send_event(LCD_EVENT_ACTIVATION, NULL); | 292 | send_event(LCD_EVENT_ACTIVATION, NULL); |
283 | } | 293 | } |
284 | else | 294 | else |