summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/export/config/agptekrocker.h4
-rw-r--r--firmware/target/hosted/agptek/lcd-agptek.c25
-rw-r--r--firmware/target/hosted/agptek/lcd-target.h6
4 files changed, 34 insertions, 2 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 6fb744f524..d2c27b71f0 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -114,6 +114,7 @@ target/hosted/sonynwz/nwz-db.c
#endif
#if defined(AGPTEK_ROCKER) && !defined(SIMULATOR)
+drivers/lcd-memframe.c
target/hosted/backtrace-glibc.c
target/hosted/kernel-unix.c
target/hosted/filesystem-unix.c
diff --git a/firmware/export/config/agptekrocker.h b/firmware/export/config/agptekrocker.h
index 1c15117f9b..74742bd56a 100644
--- a/firmware/export/config/agptekrocker.h
+++ b/firmware/export/config/agptekrocker.h
@@ -23,8 +23,10 @@
/* define this if you have a colour LCD */
#define HAVE_LCD_COLOR
+#define HAVE_LCD_ENABLE
+
/* Define this if the LCD can shut down */
-//#define HAVE_LCD_SHUTDOWN
+#define HAVE_LCD_SHUTDOWN
/* define this if you want album art for this target */
#define HAVE_ALBUMART
diff --git a/firmware/target/hosted/agptek/lcd-agptek.c b/firmware/target/hosted/agptek/lcd-agptek.c
index abf89ea9e3..ff5a8146a2 100644
--- a/firmware/target/hosted/agptek/lcd-agptek.c
+++ b/firmware/target/hosted/agptek/lcd-agptek.c
@@ -29,6 +29,7 @@
#include "lcd.h"
#include "lcd-target.h"
#include "backlight-target.h"
+#include "sysfs.h"
#include "panic.h"
static int fd = -1;
@@ -75,6 +76,30 @@ void lcd_init_device(void)
}
}
+#ifdef HAVE_LCD_SHUTDOWN
+void lcd_shutdown(void)
+{
+ munmap(framebuffer, FRAMEBUFFER_SIZE);
+ close(fd);
+}
+#endif
+
+void lcd_enable(bool on)
+{
+ const char * const sysfs_fb_blank = "/sys/class/graphics/fb0/blank";
+
+ if (lcd_active() != on)
+ {
+ sysfs_set_int(sysfs_fb_blank, on ? 0 : 1);
+ lcd_set_active(on);
+
+ if (on)
+ {
+ send_event(LCD_EVENT_ACTIVATION, NULL);
+ }
+ }
+}
+
static void redraw(void)
{
ioctl(fd, FBIOPAN_DISPLAY, &vinfo);
diff --git a/firmware/target/hosted/agptek/lcd-target.h b/firmware/target/hosted/agptek/lcd-target.h
index 346644bdfc..b6fcfdb98f 100644
--- a/firmware/target/hosted/agptek/lcd-target.h
+++ b/firmware/target/hosted/agptek/lcd-target.h
@@ -21,6 +21,10 @@
#ifndef __LCD_TARGET_H__
#define __LCD_TARGET_H__
-extern fb_data *framebuffer; /* see lcd-nwz.c */
+/* Agptek needs special ioctl() to redraw updated framebuffer content */
+#define LCD_OPTIMIZED_UPDATE
+#define LCD_OPTIMIZED_UPDATE_RECT
+
+extern fb_data *framebuffer; /* see lcd-agptek.c */
#define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col))
#endif /* __LCD_TARGET_H__ */