Backlight control signal

The ConnectCore 8M Mini Development Kit uses MCA_IO17 (PWM chip 0, channel 4) as the LVDS backlight.

See MCA I/O pads for a list of all available MCA IOs and their capabilities.

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 8M Mini kernel configuration file.

Besides these, you must also enable support for the MCA PWM. See MCA Pulse Width Modulation (PWM).

Device tree bindings and customization

The PWM backlight interface bindings is documented at Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml.

LVDS backlight

This device tree excerpt shows the two blocks that configure the backlight signal:

  • A backlight entry that uses the generic PWM backlight driver, defines a period for the signal and a table of predefined brightness levels.

  • The enabling of the PWM interface.

Since the PWM signal is provided by the MCA, no IOMUX configuration is needed.

ConnectCore 8M Mini Development Kit device tree
	lvds_backlight: lvds_backlight {
		compatible = "pwm-backlight";
		pwms = <&mca_pwm0 4 100000 0>;

		brightness-levels = < 0  1  2  3  4  5  6  7  8  9
				     10 11 12 13 14 15 16 17 18 19
				     20 21 22 23 24 25 26 27 28 29
				     30 31 32 33 34 35 36 37 38 39
				     40 41 42 43 44 45 46 47 48 49
				     50 51 52 53 54 55 56 57 58 59
				     60 61 62 63 64 65 66 67 68 69
				     70 71 72 73 74 75 76 77 78 79
				     80 81 82 83 84 85 86 87 88 89
				     90 91 92 93 94 95 96 97 98 99
				    100>;
		default-brightness-level = <80>;
		power-supply = <&reg_5v_board>;
		status = "okay";
	};

	[...]

	mca_cc8m: mca@63 {
		compatible = "digi,mca-kl17";
		reg = <0x63>;
		interrupt-parent = <&gpio2>;
		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
		interrupt-controller;
		#interrupt-cells = <2>;
		fw-update-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mca_cc8m>;

		[...]

		pwms {
			compatible = "digi,mca-pwm";
			#address-cells = <1>;
			#size-cells = <0>;

			mca_pwm0: pwm@0 {
				reg = <0>;
				pwm-channels = <6>;
				#pwm-cells = <3>;
			};
		};

	[...]

	};

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/lvds_backlight/max_brightness
100

The returned value is the index to the predefined values array in the device tree (starting at zero). The device tree backlight table has exactly 100 entries, so index 100 corresponds to value 100 (backlight fully on).

In practice, having a hundred values is like setting the duty cycle in percentage.

To set a certain brightness value, use another index to the predefined values array in the device tree:

# echo 20 > /sys/class/backlight/lvds_backlight/brightness

In this example, the value 20 sets a 20% brightness (or 20% duty cycle of the PWM signal).

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 8M Mini Development Kit and for the supported displays, the backlight is active at high level.