diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-08-19 10:26:17 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-08-19 10:26:17 +0000 |
| commit | 22efb0192f5425079e1a6715a45ba645363012fb (patch) | |
| tree | 8ae5efbf79f425ec70872430ca77c24740dc266a /lib/gdi/lcd.cpp | |
| parent | cd1ef2a9024596a6f5938b701e8a8ac623e40ee6 (diff) | |
| download | enigma2-22efb0192f5425079e1a6715a45ba645363012fb.tar.gz enigma2-22efb0192f5425079e1a6715a45ba645363012fb.zip | |
add support for /proc/stb/fp/oled_brightness
Diffstat (limited to 'lib/gdi/lcd.cpp')
| -rw-r--r-- | lib/gdi/lcd.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
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); } |
