PWM signal is at default High state

Hello Community,
We are using Apalis IMX8QP/QM in Dunfell Kernel version. I am attaching patch file here.
dunfell_patch.txt (5.4 KB)

We are facing an issue regarding backlight pwm, our backlight node is this
&backlight {
default-brightness-level = <4>;
brightness-levels = <0 45 63 88 119 158 203 255>;
pwms = <&pwm_lvds1 0 200000 PWM_POLARITY_INVERTED>;
status = “okay”;
};

While booting PWM signal is going high for around 3 seconds, then it is going low for 2 to 3 seconds, then we are getting pwm on that signal.

Actually we need PWM signal like this,

but we are getting intailly high, we are suspecting that the signal is going to high during u-boot time.
How can we stop it from going high while booting.

Hi @Muthyam,

Thanks for posting to Toradex Community.

Regarding your query, you can control pin from u-boot in couple of ways either one can modify u-boot using source code or from u-boot command line please check below link

Let me know if you have any queries.
Best Regards
Ritesh Kumar

Hello @ritesh.tx ,
where the pin control files and uboot dtsi are located in the Yocto image.

Hello @ritesh.tx ,
And we wanted to add some delay to the PWM signal, currently PWM is starting right after kernel loading. We wanted to add some delay here, for that what are changes that we need to make in PWM node in dtsi file.

Thank You.

Hi @Muthyam ,

Currently pwm is used by backlight driver. I am not sure if any such function of delay is presented by driver.
But I think if you disable backlight by default and enable as per your application need that should be workable in your case.
Please check below link.

Please note one you disable backlight you will need to enable using some script and systemd service to autorun script.

Best Regards
Ritesh Kumar

Hello @ritesh.tx ,

Currently we have set the default brightness as “default-brightness-level = <7>;” in backlight node(in dtsi), in our watchdog script we added " echo 4 > /sys/class/backlight/backlight/brightness ", which controlled by a service . Enable signal we are controlling using a GPIO(configured as gpio output, active high in kernel dtsi ). But we are getting 5 seconds delay from Enable signal to PWM signal. Actually we wanted to reduce that delay to 1 sec, to get that control we need some function.

Thanks & Regards,
Muthyam D.