My lcd backlight need pwm control, so I config pwm4, backlight in dts:
lvds_backlight: lvds_backlight {
compatible = "pwm-backlight";
pwms = <&pwm4 0 100000 0>;
status = "okay";
enable-gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>;
brightness-levels = < 0 1 2 3 4 5 6 7 8 9
.......
};
&pwm4 {
#pwm-cells = <3>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm4>;
status = "okay";
};
I also open the driver: pwm-imx.c pwm-backlight.c in Config file
But it got stuck in the driver:
Solved! Go to Solution.
Hi @sclu,
I hope you are doing well.
system hang-up is caused due to clock not being enabled for the PWM module.
PWM support for i.MX8M Processors is not available in the uboot version before v2022.04.
PWM DM support & register support is added using the below commits in v2023.04.
arch: mach-imx: imx8m: add pwm_regs struct in imx-regs
arch: mach-imx: imx8m: add pwm ctrl registers fields defines
One can refer to the below-mentioned link to add pwm support in imx8m.
https://cuteparrot.pixnet.net/blog/post/229123814-%5Bnxp%5D%5Bimx8mm%5Dhow-to-enable-pwm1-on-uboot
Thanks & Regards,
Dhruvit Vasavada
Hi @sclu,
Hi @sclu,
I hope you are doing well.
system hang-up is caused due to clock not being enabled for the PWM module.
PWM support for i.MX8M Processors is not available in the uboot version before v2022.04.
PWM DM support & register support is added using the below commits in v2023.04.
arch: mach-imx: imx8m: add pwm_regs struct in imx-regs
arch: mach-imx: imx8m: add pwm ctrl registers fields defines
One can refer to the below-mentioned link to add pwm support in imx8m.
https://cuteparrot.pixnet.net/blog/post/229123814-%5Bnxp%5D%5Bimx8mm%5Dhow-to-enable-pwm1-on-uboot
Thanks & Regards,
Dhruvit Vasavada