summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c')
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
index d10396cfd4..f9d5e5ace1 100644
--- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
+++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
@@ -28,6 +28,7 @@
28#include "debug.h" 28#include "debug.h"
29#include "system.h" 29#include "system.h"
30#include "clock-target.h" 30#include "clock-target.h"
31#include "dbop-as3525.h"
31 32
32/* The controller is unknown, but some registers appear to be the same as the 33/* The controller is unknown, but some registers appear to be the same as the
33 HD66789R */ 34 HD66789R */
@@ -92,7 +93,6 @@ static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL;
92static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL; 93static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL;
93 94
94static const int xoffset = 20; 95static const int xoffset = 20;
95static volatile bool lcd_busy = false;
96 96
97static inline void lcd_delay(int x) 97static inline void lcd_delay(int x)
98{ 98{
@@ -379,8 +379,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
379 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); 379 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1);
380 yuv_src[2] = src[2] + (yuv_src[1] - src[1]); 380 yuv_src[2] = src[2] + (yuv_src[1] - src[1]);
381 381
382 lcd_busy = true;
383
384#ifdef HAVE_LCD_FLIP 382#ifdef HAVE_LCD_FLIP
385 lcd_write_reg(R_ENTRY_MODE, 383 lcd_write_reg(R_ENTRY_MODE,
386 display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL 384 display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL
@@ -423,8 +421,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
423 } 421 }
424 while (--height > 0); 422 while (--height > 0);
425 } 423 }
426
427 lcd_busy = false;
428} 424}
429 425
430/* Update the display. 426/* Update the display.
@@ -434,8 +430,6 @@ void lcd_update(void)
434 if (!display_on) 430 if (!display_on)
435 return; 431 return;
436 432
437 lcd_busy = true;
438
439 lcd_write_reg(R_ENTRY_MODE, r_entry_mode); 433 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
440 434
441 lcd_window_x(0, LCD_WIDTH - 1); 435 lcd_window_x(0, LCD_WIDTH - 1);
@@ -444,8 +438,6 @@ void lcd_update(void)
444 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 438 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
445 439
446 lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); 440 lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
447
448 lcd_busy = false;
449} 441}
450 442
451/* Update a fraction of the display. */ 443/* Update a fraction of the display. */
@@ -475,8 +467,6 @@ void lcd_update_rect(int x, int y, int width, int height)
475 if (y >= ymax) 467 if (y >= ymax)
476 return; /* nothing left to do */ 468 return; /* nothing left to do */
477 469
478 lcd_busy = true;
479
480 lcd_write_reg(R_ENTRY_MODE, r_entry_mode); 470 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
481 471
482 lcd_window_x(x, xmax); 472 lcd_window_x(x, xmax);
@@ -493,26 +483,4 @@ void lcd_update_rect(int x, int y, int width, int height)
493 ptr += LCD_WIDTH; 483 ptr += LCD_WIDTH;
494 } 484 }
495 while (--height >= 0); 485 while (--height >= 0);
496
497 lcd_busy = false;
498}
499
500/* writes one red pixel outside the visible area, needed for correct
501 * dbop reads */
502bool lcd_button_support(void)
503{
504 if (lcd_busy)
505 return false;
506
507 lcd_write_reg(R_ENTRY_MODE, r_entry_mode);
508
509 /* Set start position and window */
510 lcd_window_x(-1, 0);
511 lcd_window_y(-1, 0);
512
513 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
514
515 lcd_write_value16(0xf<<12);
516
517 return true;
518} 486}