summaryrefslogtreecommitdiff
path: root/firmware/target/arm/samsung/yh820/lcd-yh820.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/samsung/yh820/lcd-yh820.c')
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-yh820.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/firmware/target/arm/samsung/yh820/lcd-yh820.c b/firmware/target/arm/samsung/yh820/lcd-yh820.c
index d6bb2a196b..f4b55ab917 100644
--- a/firmware/target/arm/samsung/yh820/lcd-yh820.c
+++ b/firmware/target/arm/samsung/yh820/lcd-yh820.c
@@ -25,6 +25,9 @@
25#include "lcd.h" 25#include "lcd.h"
26#include "kernel.h" 26#include "kernel.h"
27#include "system.h" 27#include "system.h"
28#ifdef HAVE_LCD_SHUTDOWN
29#include "backlight-target.h" /* included for backlight_hw_off() prototype */
30#endif
28 31
29/* Display status */ 32/* Display status */
30static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; 33static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
@@ -235,6 +238,28 @@ void lcd_enable(bool yesno)
235} 238}
236#endif 239#endif
237 240
241#ifdef HAVE_LCD_SLEEP
242void lcd_sleep(void)
243{
244 if (is_lcd_enabled)
245 {
246 is_lcd_enabled = false;
247 lcd_send_command(R_STANDBY_ON);
248 }
249}
250
251void lcd_awake(void)
252{
253 if (!is_lcd_enabled)
254 {
255 is_lcd_enabled = true;
256 lcd_send_command(R_STANDBY_OFF);
257 lcd_send_command(R_DISPLAY_ON);
258 send_event(LCD_EVENT_ACTIVATION, NULL);
259 }
260}
261#endif
262
238#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 263#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
239bool lcd_active(void) 264bool lcd_active(void)
240{ 265{
@@ -242,6 +267,17 @@ bool lcd_active(void)
242} 267}
243#endif 268#endif
244 269
270#if defined(HAVE_LCD_SHUTDOWN)
271void lcd_shutdown(void)
272{
273 backlight_hw_off();
274#ifndef HAVE_LCD_ENABLE
275 /* already done by backlight_hw_off() */
276 lcd_send_command(R_STANDBY_ON);
277#endif
278}
279#endif
280
245#ifdef HAVE_LCD_FLIP 281#ifdef HAVE_LCD_FLIP
246/* turn the display upside down (call lcd_update() afterwards) */ 282/* turn the display upside down (call lcd_update() afterwards) */
247/* Note: since the lcd is rotated, this will flip horiz instead of vert */ 283/* Note: since the lcd is rotated, this will flip horiz instead of vert */
@@ -338,6 +374,11 @@ void lcd_update(void)
338void lcd_update_rect(int x, int y, int width, int height) 374void lcd_update_rect(int x, int y, int width, int height)
339{ 375{
340 const fb_data *addr; 376 const fb_data *addr;
377
378#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
379 if (!is_lcd_enabled)
380 return;
381#endif
341 382
342 if (x + width >= LCD_WIDTH) 383 if (x + width >= LCD_WIDTH)
343 width = LCD_WIDTH - x; 384 width = LCD_WIDTH - x;