From 137948804b52bd4533f5cef2f70bd4957f32b91a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 4 Mar 2012 17:48:41 +0100 Subject: [PATCH] libtriple: implement option to keep LCD backlight on in standby Based on an idea by Kim Danielmeier, keep the backlight on if TRIPLE_LCDBACKLIGHT environment variable is set. --- libtriple/README.libtriple | 5 ++++- libtriple/pwrmngr.cpp | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libtriple/README.libtriple b/libtriple/README.libtriple index 89f65b7..c13dbf8 100644 --- a/libtriple/README.libtriple +++ b/libtriple/README.libtriple @@ -8,7 +8,10 @@ environment variables, which are described here: TRIPLE_NOSCART=1 - makes neutrino *not* do any voltage switching on SCART pin 8, probably not useful for anyone but me -TRIPLE_DEBUG=... - controls various debugging levels in libtriple +TRIPLE_LCDBACKLIGHT=1 - makes the LCD backlight stay on in standby, + may disturb others + +HAL_DEBUG=... - controls various debugging levels in libtriple valid values for the different component: audio 0x01 video 0x02 diff --git a/libtriple/pwrmngr.cpp b/libtriple/pwrmngr.cpp index f16297e..e526246 100644 --- a/libtriple/pwrmngr.cpp +++ b/libtriple/pwrmngr.cpp @@ -1,4 +1,5 @@ #include +#include #include "pwrmngr.h" #include "lt_debug.h" @@ -9,8 +10,10 @@ #include #include +#include #define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PWRMNGR, this, args) +#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PWRMNGR, this, args) void cCpuFreqManager::Up(void) { lt_debug("%s\n", __FUNCTION__); } void cCpuFreqManager::Down(void) { lt_debug("%s\n", __FUNCTION__); } void cCpuFreqManager::Reset(void) { lt_debug("%s\n", __FUNCTION__); } @@ -55,6 +58,16 @@ bool cCpuFreqManager::SetCpuFreq(unsigned long f) { ioctl(fd, IOC_AVS_SET_VOLUME, 31); /* mute AVS to avoid ugly noise */ ioctl(fd, IOC_AVS_STANDBY_ENTER); + if (getenv("TRIPLE_LCDBACKLIGHT")) + { + lt_info("%s: TRIPLE_LCDBACKLIGHT is set: keeping LCD backlight on\n", __func__); + close(fd); + fd = open("/dev/stb/tdlcd", O_RDONLY); + if (fd < 0) + lt_info("%s: open tdlcd error: %m\n", __func__); + else + ioctl(fd, IOC_LCD_BACKLIGHT_ON); + } } else {