From: Andreas Monzner Date: Tue, 19 Aug 2008 10:26:17 +0000 (+0000) Subject: add support for /proc/stb/fp/oled_brightness X-Git-Tag: 2.6.0~937 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/22efb0192f5425079e1a6715a45ba645363012fb add support for /proc/stb/fp/oled_brightness --- diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp index ac273c61..5fe1c3ad 100644 --- a/lib/gdi/lcd.cpp +++ b/lib/gdi/lcd.cpp @@ -95,18 +95,27 @@ int eDBoxLCD::setLCDContrast(int contrast) int eDBoxLCD::setLCDBrightness(int brightness) { - int fp; - if((fp=open("/dev/dbox/fp0", O_RDWR))<=0) + eDebug("setLCDBrightness %d", brightness); + FILE *f=fopen("/proc/stb/fp/oled_brightness", "w"); + if (f) { - eDebug("[LCD] can't open /dev/dbox/fp0"); - return(-1); + if (fprintf(f, "%d", brightness) == 0) + eDebug("write /proc/stb/fp/oled_brightness failed!! (%m)"); + fclose(f); } - - if(ioctl(fp, FP_IOCTL_LCD_DIMM, &brightness)) + else { - eDebug("[LCD] can't set lcd brightness"); + int fp; + if((fp=open("/dev/dbox/fp0", O_RDWR))<=0) + { + eDebug("[LCD] can't open /dev/dbox/fp0"); + return(-1); + } + + if(ioctl(fp, FP_IOCTL_LCD_DIMM, &brightness)<=0) + eDebug("[LCD] can't set lcd brightness (%m)"); + close(fp); } - close(fp); return(0); }