summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/agptek/lcd-agptek.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2018-06-14 10:03:07 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2018-06-14 10:03:07 +0200
commit5c015ada908d491fa2f9fa37b83e3fc9c56b4d86 (patch)
tree19ddc935411ec7a2e98827f96b314d9db4860898 /firmware/target/hosted/agptek/lcd-agptek.c
parent755b824596b68b712f94858a875da62f0d5fc50a (diff)
downloadrockbox-5c015ada908d491fa2f9fa37b83e3fc9c56b4d86.tar.gz
rockbox-5c015ada908d491fa2f9fa37b83e3fc9c56b4d86.zip
Agptek Rocker: Implement lcd_enable()
In theory this should slightly improve battery life. Change-Id: Iaf55beb7dbc20e7562017958aeb0386459d49a31
Diffstat (limited to 'firmware/target/hosted/agptek/lcd-agptek.c')
-rw-r--r--firmware/target/hosted/agptek/lcd-agptek.c25
1 files changed, 25 insertions, 0 deletions
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
34static int fd = -1; 35static int fd = -1;
@@ -75,6 +76,30 @@ void lcd_init_device(void)
75 } 76 }
76} 77}
77 78
79#ifdef HAVE_LCD_SHUTDOWN
80void lcd_shutdown(void)
81{
82 munmap(framebuffer, FRAMEBUFFER_SIZE);
83 close(fd);
84}
85#endif
86
87void 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
78static void redraw(void) 103static void redraw(void)
79{ 104{
80 ioctl(fd, FBIOPAN_DISPLAY, &vinfo); 105 ioctl(fd, FBIOPAN_DISPLAY, &vinfo);