View Single Post
Old 09-30-2013, 04:20 PM   #110
yoq
Developer
yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.yoq ought to be getting tired of karma fortunes by now.
 
Posts: 77
Karma: 206176
Join Date: Apr 2013
Location: Europe
Device: Kobo Glo
Quote:
Originally Posted by sergeyvl12 View Post
Is it possible to get the current frontlight level?
The easiest way, (but rather cpu heavy) is to scan dmesg as every change is printed to the log.

But there are other options:
The kernel source for the backlight driver is at arch/arm/mach-mx5/mx50_ntx_io.c, but there is no ioctl to get the current level. It shouldn't be too hard to implement a new one, but how many users will want to change their kernel for that

A more hacky way: Since we are root, we can simply fetch the content of the last_FL_duty variable from kernel memory:
Code:
hexdump -s 0x803ba614 -n1 -v -e '"%d"' /dev/kmem
Of course, the address will be off as soon as a new kernel build is released. Does anyone know how often they do this? I know they did when they changed the toolchain, but other than that?

Last edited by yoq; 10-01-2013 at 01:23 PM. Reason: fixed command: -v to also show '0'
yoq is offline   Reply With Quote