Backlight
Backlight control signal
The ConnectCore 6UL SBC Pro uses signal NAND_DQS of the SOM as the LCD backlight. This line is routed to the parallel LCD and LVDS connectors and can be configured as PWM5 allowing to adjust the backlight brightness.
Kernel configuration
You can manage the backlight support through the following kernel configuration options:
- Low-level backlight controls (CONFIG_BACKLIGHT_CLASS_DEVICE)
- Generic PWM-based backlight driver (CONFIG_BACKLIGHT_PWM)
These options are enabled as built-in on the default ConnectCore 6UL kernel configuration file.
Besides these, you must also enable PWM support.
Device tree bindings and customization
The PWM backlight interface bindings is documented at Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt.
PWM5 as backlight on ConnectCore 6UL SBC Pro
This device tree excerpt shows the three blocks that configure the backlight signal:
- A backlight entry that uses the generic PWM backlight driver, defines a period for the signal and predefined brightness levels between 0 (constant 0V) and 255 (constant 3.3V).
- The PWM5 signal from the i.MX6UL, with the clocks it is sourced from.
- The IOMUX of NAND_DQS pad, to behave as PWM5.
ConnectCore 6UL SBC Pro device tree
/ { lcd_backlight: backlight { compatible = "pwm-backlight"; pwms = <&pwm5 0 50000>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; }; }; /* LCD backlight */ &pwm5 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm5>; clocks = <&clks IMX6UL_CLK_PWM5>, <&clks IMX6UL_CLK_PWM5>; }; &iomuxc { pinctrl-names = "default"; imx6ul-ccimx6ul { pinctrl_pwm5: pwm5grp { fsl,pins = < MX6UL_PAD_NAND_DQS__PWM5_OUT 0x110b0 >; }; }; };
Using the backlight
Backlight PWM control is managed through backlight sysfs entries.
To read the maximum allowed brightness level of the backlight:
~# cat /sys/class/backlight/backlight/max-brightness 7
The returned value is the index to the predefined values array in the device tree (starting at zero). In the example, the 7 equates to the last component in the array (255).
To set a certain brightness value use another index to the predefined values array in the device tree:
~# echo 4 > /sys/class/backlight/backlight/brightness
In this example, index 4 equates to 32.
The polarity of the backlight signal may be different among displays. In some displays the backlight may be active at high level, while in others the backlight is active at low level. On the ConnectCore 6UL SBC Pro and for the two supported displays (Fusion 10" and Fusion 7"), the backlight is active at high level.