Display - Brightness and Backlight

BL_ON

bl_power brightness BL_ON
1 don't care 0
0 0 0
0 1..max_brightness 1

Note that the Apalis/Colibri iMX6 V2.7 Beta 1 and earlier did not control BL_ON at all.

boot2qt / meta-ujet / recipes-kernel / linux / linux-toradex-4.1-2.0.x / apalis-imx6 / fix-ixora-dts.patch

154 -#endif
155 -        brightness-levels = <0 4 8 16 32 64 128 255>;
156 -        default-brightness-level = <6>;
157 -        status = "okay";

PWM

The files bl_power and brightness in /sys/class/backlight/backlight/ control the PWM signal.

The device tree contains the backlight configuration. This includes a mapping of brightness values to duty cycles with the value 0 generating a duty cycle of 0% and the value in max_brightness generating a duty cycle of 100%. Also the PWM frequency and polarity can be configured.

The following queries the number of brightness steps, sets the duty cycle to brightest and then to its darkest.

# cat /sys/class/backlight/backlight/max_brightness
7
# echo 7 > /sys/class/backlight/backlight/brightness
# echo 1 > /sys/class/backlight/backlight/brightness
0 Off
1 brightest
2 normal bright
3 normal bright
4 normal bright
5 normal bright
6 darkest
7 Off

The following can be used to switch the duty cycle to 0% and back to the level determined by what is in the brightness file.

# echo 1 > /sys/class/backlight/backlight/bl_power
# echo 0 > /sys/class/backlight/backlight/bl_power
BL_POWER Meaning
0 ON
1 OFF

The device tree also allows to define the PWM polarity to adapt to displays with inverted brightness.

e.g.

diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
index 7c5e69e..c230ab5 100644
--- a/arch/arm/boot/dts/vf-colibri.dtsi
+++ b/arch/arm/boot/dts/vf-colibri.dtsi
@@ -14,7 +14,7 @@

        bl: backlight {
                compatible = "pwm-backlight";
-               pwms = <&pwm0 0 5000000 0>;
+               pwms = <&pwm0 0 5000000 1>;
                status = "disabled";
        };
 };
actual_brightness 6
bl_power 0 or 1
brightness 1 to 7
max_brightness 7

References


PWM (Linux) https://developer.toradex.com/knowledge-base/pwm-(linux\

Backlight (Linux) https://developer.toradex.com/knowledge-base/backlight-(linux\

results for ""

    No results matching ""