diff options
Diffstat (limited to 'firmware/target/arm/imx233')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c index 5f54c72b5e..8f0efdf671 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | |||
@@ -40,6 +40,12 @@ static bool lcd_on; | |||
40 | #endif | 40 | #endif |
41 | static unsigned lcd_yuv_options = 0; | 41 | static unsigned lcd_yuv_options = 0; |
42 | static int lcd_dcp_channel = -1; | 42 | static int lcd_dcp_channel = -1; |
43 | #ifdef HAVE_LCD_INVERT | ||
44 | static int lcd_reg_0x61_val = 1; /* used to invert display */ | ||
45 | #endif | ||
46 | #ifdef HAVE_LCD_FLIP | ||
47 | static int lcd_reg_3_val = 0x1030; /* controls to flip display */ | ||
48 | #endif | ||
43 | 49 | ||
44 | static enum lcd_kind_t | 50 | static enum lcd_kind_t |
45 | { | 51 | { |
@@ -367,6 +373,16 @@ static void lcd_init_seq_9325(void) | |||
367 | _end_seq() | 373 | _end_seq() |
368 | } | 374 | } |
369 | 375 | ||
376 | static void lcd_sync_settings(void) | ||
377 | { | ||
378 | #ifdef HAVE_LCD_INVERT | ||
379 | lcd_write_reg(0x61, lcd_reg_0x61_val); | ||
380 | #endif | ||
381 | #ifdef HAVE_LCD_FLIP | ||
382 | lcd_write_reg(3, lcd_reg_3_val); | ||
383 | #endif | ||
384 | } | ||
385 | |||
370 | void lcd_init_device(void) | 386 | void lcd_init_device(void) |
371 | { | 387 | { |
372 | lcd_dcp_channel = imx233_dcp_acquire_channel(TIMEOUT_NOBLOCK); | 388 | lcd_dcp_channel = imx233_dcp_acquire_channel(TIMEOUT_NOBLOCK); |
@@ -398,6 +414,8 @@ void lcd_init_device(void) | |||
398 | lcd_init_seq_7783(); break; | 414 | lcd_init_seq_7783(); break; |
399 | } | 415 | } |
400 | 416 | ||
417 | lcd_sync_settings(); | ||
418 | |||
401 | #ifdef HAVE_LCD_ENABLE | 419 | #ifdef HAVE_LCD_ENABLE |
402 | lcd_on = true; | 420 | lcd_on = true; |
403 | #endif | 421 | #endif |
@@ -502,22 +520,36 @@ void lcd_enable(bool enable) | |||
502 | } | 520 | } |
503 | if(!enable) | 521 | if(!enable) |
504 | common_lcd_enable(false); | 522 | common_lcd_enable(false); |
523 | else | ||
524 | { | ||
525 | lcd_sync_settings(); | ||
526 | } | ||
505 | } | 527 | } |
506 | #endif | 528 | #endif |
507 | 529 | ||
508 | #ifdef HAVE_LCD_INVERT | 530 | #ifdef HAVE_LCD_INVERT |
509 | void lcd_set_invert_display(bool yesno) | 531 | void lcd_set_invert_display(bool yesno) |
510 | { | 532 | { |
533 | lcd_reg_0x61_val = yesno ? 0 : 1; | ||
534 | #ifdef HAVE_LCD_ENABLE | ||
535 | if(!lcd_on) | ||
536 | return; | ||
537 | #endif | ||
511 | /* same for both kinds */ | 538 | /* same for both kinds */ |
512 | lcd_write_reg(0x61, yesno ? 0 : 1); | 539 | lcd_write_reg(0x61, lcd_reg_0x61_val); |
513 | } | 540 | } |
514 | #endif | 541 | #endif |
515 | 542 | ||
516 | #ifdef HAVE_LCD_FLIP | 543 | #ifdef HAVE_LCD_FLIP |
517 | void lcd_set_flip(bool yesno) | 544 | void lcd_set_flip(bool yesno) |
518 | { | 545 | { |
546 | lcd_reg_3_val = yesno ? 0x1000 : 0x1030; | ||
547 | #ifdef HAVE_LCD_ENABLE | ||
548 | if(!lcd_on) | ||
549 | return; | ||
550 | #endif | ||
519 | /* same for both kinds */ | 551 | /* same for both kinds */ |
520 | lcd_write_reg(3, yesno ? 0x1000 : 0x1030); | 552 | lcd_write_reg(3, lcd_reg_3_val); |
521 | } | 553 | } |
522 | #endif | 554 | #endif |
523 | 555 | ||