summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c')
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index 79914e2e44..0d990dc538 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -26,6 +26,7 @@
26#include "debug.h" 26#include "debug.h"
27#include "system.h" 27#include "system.h"
28#include "clock-target.h" 28#include "clock-target.h"
29#include "dbop-as3525.h"
29 30
30/* The controller is unknown, but some registers appear to be the same as the 31/* The controller is unknown, but some registers appear to be the same as the
31 HD66789R */ 32 HD66789R */
@@ -89,8 +90,6 @@ static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL;
89#define R_DISP_CONTROL_REV 0x0000 90#define R_DISP_CONTROL_REV 0x0000
90static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL; 91static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL;
91 92
92static volatile bool lcd_busy = false;
93
94static inline void lcd_delay(int x) 93static inline void lcd_delay(int x)
95{ 94{
96 do { 95 do {
@@ -435,8 +434,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
435 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); 434 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1);
436 yuv_src[2] = src[2] + (yuv_src[1] - src[1]); 435 yuv_src[2] = src[2] + (yuv_src[1] - src[1]);
437 436
438 lcd_busy = true;
439
440 lcd_write_reg(R_ENTRY_MODE, 437 lcd_write_reg(R_ENTRY_MODE,
441 display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL 438 display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL
442 ); 439 );
@@ -473,8 +470,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
473 } 470 }
474 while (--height > 0); 471 while (--height > 0);
475 } 472 }
476
477 lcd_busy = false;
478} 473}
479 474
480/* Update the display. 475/* Update the display.
@@ -484,8 +479,6 @@ void lcd_update(void)
484 if (!display_on) 479 if (!display_on)
485 return; 480 return;
486 481
487 lcd_busy = true;
488
489 lcd_write_reg(R_ENTRY_MODE, r_entry_mode); 482 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
490 483
491 /* Set start position and window */ 484 /* Set start position and window */
@@ -494,8 +487,6 @@ void lcd_update(void)
494 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 487 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
495 488
496 lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); 489 lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
497
498 lcd_busy = false;
499} 490}
500 491
501/* Update a fraction of the display. */ 492/* Update a fraction of the display. */
@@ -525,8 +516,6 @@ void lcd_update_rect(int x, int y, int width, int height)
525 if (y >= ymax) 516 if (y >= ymax)
526 return; /* nothing left to do */ 517 return; /* nothing left to do */
527 518
528 lcd_busy = true;
529
530 lcd_write_reg(R_ENTRY_MODE, r_entry_mode); 519 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
531 520
532 lcd_window(x, y, xmax, ymax); 521 lcd_window(x, y, xmax, ymax);
@@ -541,25 +530,4 @@ void lcd_update_rect(int x, int y, int width, int height)
541 ptr += LCD_WIDTH; 530 ptr += LCD_WIDTH;
542 } 531 }
543 while (--height >= 0); 532 while (--height >= 0);
544
545 lcd_busy = false;
546}
547
548/* writes one red pixel outside the visible area, needed for correct
549 * dbop reads */
550bool lcd_button_support(void)
551{
552 if (lcd_busy)
553 return false;
554
555 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
556
557 /* Set start position and window */
558 lcd_window(LCD_WIDTH+1, LCD_HEIGHT+1, LCD_WIDTH+2, LCD_HEIGHT+2);
559
560 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
561
562 lcd_write_value16(0xf<<12);
563
564 return true;
565} 533}