I.mx7 backlight pwm

Hello!

I have the follwing problem with the backlight of the colibri imx7s module:
The backlight can be successfully controlled via PWM using the command

echo X > /sys/class/pwm/pwmchip1/pwm0/duty_cycle

Where X is the duty cycle of the PWM signal.
It is not possible to control the backlight through the

/sys/class/backlight/backlight/brightness

command, which is in my opinion due to a missing configuration in the device tree.

During bootup I want to display a splash screen, In U-Boot it is already working but as soon as the kernel is starting, the screen becomes totally black (backlight off). I assume, that the linux splash screen is already shown, but due to the switched off backlight it is not visible. The reason for this assumption is, that shortly before the application is fully started, the backlight switches on and I can see the splash screen for about one second before the application screen is shown.

I assume that the backlight is not switched on, because the backlight sysFS is not correctly linked.

I tried to accomplish this with the following entry in the used dts file:

&bl {
  compatible = "pwm-backlight";
  pwms = <&pwm1 0 5000000 0>;
  status = "okay";
};  

But this did not work. Maybe the configuration is wrong or do I need to make a setting somewhere else?

Thank you for your help in advance!

Have you checked this article? In case of future question please provide exact version of OS image you are using. The Linux 4.14 is too ambiguous.

Hello alex.tx

Yes, I read the article, but it did not help for my implementation.
In the meantime I found out, that the address of

/sys/class/pwm/pwmchip1/pwm0

is linked to pwm4 in the dts file. So I changed the dts setting to

&bl { 
		compatible = "pwm-backlight";
		pwms = <&pwm4 0 5000000 0>;
		status = "okay";
};

and now the splash screen is shown right from the start.

Thank you for sharing the solution.