IMX6ULL Backlight PWMB control

Instead of using PWMA (pwm4) to control the backlight i want to use PWMB (pwm5)

I changed the tree

&bl {
	brightness-levels = <0 45 63 88 119 158 203 255>;
	default-brightness-level = <4>;
	power-supply = <&reg_3v3>;
	pwms = <&pwm5 0 6666667 PWM_POLARITY_INVERTED>;
	status = "okay";
};

Once updated, in the folder /sys/class/backlight/ there are no folder/files

Under the PWM(Linux) page on the website it mentions that

Toradex Name NXP/Freescale Name sysfs path Note

PWM_A PWM4 /sys/class/pwm/pwmchip0/ Used for backlight control (/sys/class/backlight /backlight/)
PWM_B PWM5 /sys/class/pwm/pwmchip1/ -
PWM_C PWM6 /sys/class/pwm/pwmchip2/ -
PWM_D PWM7 /sys/class/pwm/pwmchip3/ -

Is it not possible to use PWMB instead of PWMA ?

I noticed that in ‘imx6ull-colibri.dtsi’ under bl : backlight it defines ‘pinctrl-names, pinctrl-0 and enable-gpios’ which i do not need as i am only using the PWM output control.

Whilst searching for a solution i found these extra lines mention in backlight

          mclk = <24000000>;
          mclk_source = <0>;
          cvbs = <1>;

This solved the issue of the pwm not operating

hi @adrian

Could you share you complete changes to make PWMB work ( `git diff^ )?

Thanks and best regards,
Jaski

Hi,

So this is what i now have in my dtsi file

&bl {
	brightness-levels = <0 4 8 16 32 64 128 255>;
	default-brightness-level = <6>;
	power-supply = <&reg_3v3>;
	pwms = <&pwm4 0 5000000 1>;
    mclk = <24000000>;
    mclk_source = <0>;
    cvbs = <1>;
	status = "okay";
};

I cannot see in the other dtsi files any mention of the mclk definition BUT this does make it work. Maybe the backlight code is hard coded to get pwmA (default) working

Hi adrian

you reference to the pwm5 node, is this node enabled? What do you mean with build 3.2?

You should not have to put that mclk stuff in there, that should work without this.

Best Regards,
Philippe