mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
Agptek Rocker: Implement lcd_enable()
In theory this should slightly improve battery life. Change-Id: Iaf55beb7dbc20e7562017958aeb0386459d49a31
This commit is contained in:
parent
755b824596
commit
5c015ada90
4 changed files with 34 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue