diff options
-rw-r--r-- | firmware/SOURCES | 1 | ||||
-rw-r--r-- | firmware/export/config/agptekrocker.h | 4 | ||||
-rw-r--r-- | firmware/target/hosted/agptek/lcd-agptek.c | 25 | ||||
-rw-r--r-- | firmware/target/hosted/agptek/lcd-target.h | 6 |
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 | |||
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | #if defined(AGPTEK_ROCKER) && !defined(SIMULATOR) | 116 | #if defined(AGPTEK_ROCKER) && !defined(SIMULATOR) |
117 | drivers/lcd-memframe.c | ||
117 | target/hosted/backtrace-glibc.c | 118 | target/hosted/backtrace-glibc.c |
118 | target/hosted/kernel-unix.c | 119 | target/hosted/kernel-unix.c |
119 | target/hosted/filesystem-unix.c | 120 | 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 @@ | |||
23 | /* define this if you have a colour LCD */ | 23 | /* define this if you have a colour LCD */ |
24 | #define HAVE_LCD_COLOR | 24 | #define HAVE_LCD_COLOR |
25 | 25 | ||
26 | #define HAVE_LCD_ENABLE | ||
27 | |||
26 | /* Define this if the LCD can shut down */ | 28 | /* Define this if the LCD can shut down */ |
27 | //#define HAVE_LCD_SHUTDOWN | 29 | #define HAVE_LCD_SHUTDOWN |
28 | 30 | ||
29 | /* define this if you want album art for this target */ | 31 | /* define this if you want album art for this target */ |
30 | #define HAVE_ALBUMART | 32 | #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 @@ | |||
29 | #include "lcd.h" | 29 | #include "lcd.h" |
30 | #include "lcd-target.h" | 30 | #include "lcd-target.h" |
31 | #include "backlight-target.h" | 31 | #include "backlight-target.h" |
32 | #include "sysfs.h" | ||
32 | #include "panic.h" | 33 | #include "panic.h" |
33 | 34 | ||
34 | static int fd = -1; | 35 | static int fd = -1; |
@@ -75,6 +76,30 @@ void lcd_init_device(void) | |||
75 | } | 76 | } |
76 | } | 77 | } |
77 | 78 | ||
79 | #ifdef HAVE_LCD_SHUTDOWN | ||
80 | void lcd_shutdown(void) | ||
81 | { | ||
82 | munmap(framebuffer, FRAMEBUFFER_SIZE); | ||
83 | close(fd); | ||
84 | } | ||
85 | #endif | ||
86 | |||
87 | void lcd_enable(bool on) | ||
88 | { | ||
89 | const char * const sysfs_fb_blank = "/sys/class/graphics/fb0/blank"; | ||
90 | |||
91 | if (lcd_active() != on) | ||
92 | { | ||
93 | sysfs_set_int(sysfs_fb_blank, on ? 0 : 1); | ||
94 | lcd_set_active(on); | ||
95 | |||
96 | if (on) | ||
97 | { | ||
98 | send_event(LCD_EVENT_ACTIVATION, NULL); | ||
99 | } | ||
100 | } | ||
101 | } | ||
102 | |||
78 | static void redraw(void) | 103 | static void redraw(void) |
79 | { | 104 | { |
80 | ioctl(fd, FBIOPAN_DISPLAY, &vinfo); | 105 | 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 @@ | |||
21 | #ifndef __LCD_TARGET_H__ | 21 | #ifndef __LCD_TARGET_H__ |
22 | #define __LCD_TARGET_H__ | 22 | #define __LCD_TARGET_H__ |
23 | 23 | ||
24 | extern fb_data *framebuffer; /* see lcd-nwz.c */ | 24 | /* Agptek needs special ioctl() to redraw updated framebuffer content */ |
25 | #define LCD_OPTIMIZED_UPDATE | ||
26 | #define LCD_OPTIMIZED_UPDATE_RECT | ||
27 | |||
28 | extern fb_data *framebuffer; /* see lcd-agptek.c */ | ||
25 | #define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col)) | 29 | #define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col)) |
26 | #endif /* __LCD_TARGET_H__ */ | 30 | #endif /* __LCD_TARGET_H__ */ |