I want to control the backlight value of a LCD monitor in a embedded linux device. Doing researches throughout the internet I found a couple of references saying that the file called backlight
inside the backlight's driver folder in sys/classes
holds the key: it's just a matter of changing the value inside (such as using the echo
command in Terminal) that one would get this results. References saying that includes this link, this and this one. In my specific case, the file is located inside /sys/devices/platform/pwm-backlight/backlight/pwm-backlight
and there all the relevant, mentioned files are located: actual_brightness, brightness, max_brightness.
Using the echo command, I did managed to control de backlight, but the problem is that this command is unstable. Sometimes I change the value inside the file and the backlight reacts accordingly; other times nothing happens. I couldn't find any particularity that would justify why sometimes it works and others don't, and that's why I'm here. What could be happening that makes this works sometimes and others not? Is there something lacking in programming or would it be a driver or even hardware problem? And what should I do to correct this instability?
It's worth mentioning that I did compile the Linux kernel in accordance to what seems needed (see this link). Given the instructions in this page, the driver being used is called "Generic PWM based Backlight Driver". I'm using a Texas Instruments OMAP L138 processor.
By the way, it's worth mentioning that a "counter" solution that doesn't involve changing that file is accepted (such as for example what is shown in this link).