handle hooglands silly tablet kernel. :)

SVN revision: 61140
This commit is contained in:
Carsten Haitzler 2011-07-08 02:17:44 +00:00
parent 6c82102d68
commit 9882ed594f
1 changed files with 12 additions and 0 deletions

View File

@ -149,6 +149,18 @@ main(int argc,
}
closedir(dirp);
}
if (maxlevel <= 0)
{
struct stat st;
snprintf(file, sizeof(file), "/sys/class/leds/lcd-backlight/brightness");
if (stat(file, &st) >= 0)
{
maxstr = read_file("/sys/devices/leds/lcd-backlight/max_brightness");
maxlevel = 255;
if (maxstr) maxlevel = atoi(maxstr);
}
}
if (maxlevel > 0)
{
curlevel = ((maxlevel * level) + (500 / maxlevel)) / 1000;