cancel
Showing results for 
Search instead for 
Did you mean: 

deferred probing of lvds pwm backlight control

sanjaysb
Associate III

I'm trying to use pwm for backlight control in stm32mp257f-ev1, the same changes shown in below patch is implemented in both u-boot and kernel, i used u-boot pwm commands and it seems working but im getting this deferred probing issue in kernel logs and display turns of when entering kernel.

Im in midddle of board bring up hoping for a quick reply, thanks in advance.

This is the kernel log

[    0.268819] /soc@0/bus@42080000/display-controller@48010000: Fixed dependency cycle(s) with /soc@0/bus@42080000/lvds@48060000
[    0.295408] /soc@0/bus@42080000/lvds@48060000: Fixed dependency cycle(s) with /soc@0/bus@42080000/display-controller@48010000
[    0.308304] /soc@0/bus@42080000/display-controller@48010000: Fixed dependency cycle(s) with /soc@0/bus@42080000/lvds@48060000
[    0.338635] /soc@0/bus@42080000/lvds@48060000: Fixed dependency cycle(s) with /soc@0/bus@42080000/display-controller@48010000
[    0.352683] /soc@0/bus@42080000/display-controller@48010000: Fixed dependency cycle(s) with /soc@0/bus@42080000/lvds@48060000
[    0.394769] /soc@0/bus@42080000/display-controller@48010000: Fixed dependency cycle(s) with /soc@0/bus@42080000/lvds@48060000
[    0.403193] /soc@0/bus@42080000/lvds@48060000: Fixed dependency cycle(s) with /soc@0/bus@42080000/display-controller@48010000
[    0.440435] /soc@0/bus@42080000/lvds@48060000: Fixed dependency cycle(s) with /panel-lvds

[   23.741383] platform panel-lvds-backlight: deferred probe pending
[   23.749574] platform panel-lvds: deferred probe pending
[   23.753583] platform 48060000.lvds: deferred probe pending
[   23.770933] stm32mp_pm_domain power-domain-d1: sync_state() pending due to 48060000.lvds
 


FYR This is the changes i applied for uboot and kernel

diff --git a/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi b/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
index 136c17d14..f2bd870ce 100644
--- a/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
@@ -1107,4 +1107,19 @@ pins1 {
 				 <STM32_PINMUX('Z', 1, ANALOG)>; /* SPI8_MISO */
 		};
 	};
+
+	pwm17_ch1_pins_a: pwm17-ch1-0 {
+		pins {
+			pinmux = <STM32_PINMUX('B', 8, AF7)>; /* TIM17_CH1 - AF7 - check in datasheet, not in pinctrl-stm32mp257.c */
+			bias-pull-down;
+			drive-push-pull;
+			slew-rate = <0>;
+		};
+	};
+
+	pwm17_ch1_sleep_pins_a: pwm17-ch1-sleep-0 {
+		pins {
+			pinmux = <STM32_PINMUX('B', 8, ANALOG)>; /* TIM17_CH1 */
+		};
+	};
 };
diff --git a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
index d0f073899..6c09b4b3f 100644
--- a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
+++ b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
@@ -152,10 +152,22 @@ lvds_panel_in: endpoint {
 	};
 
 	panel_lvds_backlight: panel-lvds-backlight {
-		compatible = "gpio-backlight";
-		gpios = <&gpiob 8 GPIO_ACTIVE_HIGH>;
-		default-on;
-		default-brightness-level = <1>;
+		compatible = "pwm-backlight";
+		pwms = <&pwm17 0 1000000 0>; /* 1KHz period - TIM17 CH1*/
+		/* pwms = <&phandle channel-1, period_ns, polarity>
+		 * * PWM polarity flag (0 = normal polarity, 1 = inverted polarity)
+		 * * channel+1 can be found in drivers/pwm/pwm-stm32.c line-95
+		 */
+
+		brightness-levels = <0 16 22 30 40 55 75 102 138 188 255>;
+		default-brightness-level = <5>;
+
+		power-supply = <&scmi_v3v3>;
+
+		/* drivers/video/pwm_backlight.c
+		 * - refer this for the power-supply logic,
+		 * - we can safely omit the use in this node
+		 */
 		status = "okay";
 	};
 
@@ -852,13 +864,6 @@ brcmf: bcrmf@1 {
 	};
 };
 
-// &spi3 {
-// 	pinctrl-names = "default", "sleep";
-// 	pinctrl-0 = <&spi3_pins_a>;
-// 	pinctrl-1 = <&spi3_sleep_pins_a>;
-// 	status = "disabled";
-// };
-
 &spi8 {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&spi8_pins_a>;
@@ -965,3 +970,13 @@ dwc3_ep: endpoint {
 		};
 	};
 };
+
+&timers17 {
+	status = "okay";
+	pwm17: pwm { /* refer this node in arch/arm64/boot/dts/st/stm32mp251.dtsi */
+		pinctrl-0 = <&pwm17_ch1_pins_a>;
+		pinctrl-1 = <&pwm17_ch1_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+};

 
FYR this is the u-boot command i used for pwm control and is working in uboot but not in kernel

STM32MP> pwm
pwm - control pwm channels

Usage:
pwm invert <pwm_dev_num> <channel> <polarity> - invert polarity
pwm config <pwm_dev_num> <channel> <period_ns> <duty_ns> - config PWM
pwm enable <pwm_dev_num> <channel> - enable PWM output
pwm disable <pwm_dev_num> <channel> - disable PWM output
Note: All input values are in decimal
STM32MP> pwm --help
pwm - control pwm channels

Usage:
pwm invert <pwm_dev_num> <channel> <polarity> - invert polarity
pwm config <pwm_dev_num> <channel> <period_ns> <duty_ns> - config PWM
pwm enable <pwm_dev_num> <channel> - enable PWM output
pwm disable <pwm_dev_num> <channel> - disable PWM output
Note: All input values are in decimal
STM32MP> pwm pwm disable <INTERRUPT>
STM32MP> pwm disable pwm17 0
STM32MP> pwm enable pwm17 0 
STM32MP> pwm config pwm17 0 1000000 500000
STM32MP> pwm config pwm17 0 1000000 300000
STM32MP> pwm config pwm17 0 1000000 700000
STM32MP> pwm config pwm17 0 1000000 300000
STM32MP> pwm config pwm17 0 1000000 700000
STM32MP> pwm config pwm17 0 1000000 500000
STM32MP> pwm config pwm17 0 1000000 1000000
STM32MP> pwm config pwm17 0 1000000 2000000
error(-22)
STM32MP> pwm config pwm17 0 1000000 1000001
error(-22)
STM32MP> pwm config pwm17 0 1000000 10000  
STM32MP> pwm config pwm17 0 1000000 100000
STM32MP> pwm config pwm17 0 1000000 1000  
STM32MP> pwm config pwm17 0 1000000 100000
STM32MP> pwm config pwm17 0 1000000 1000000
STM32MP> pwm config pwm17 0 1000000 1000   
STM32MP> pwm config pwm17 0 1000000 10000
STM32MP> pwm config pwm17 0 1000000 15000
STM32MP> pwm config pwm17 0 1000000 10000
STM32MP> pwm config pwm17 0 1000000 15000
STM32MP> pwm config pwm17 0 1000000 1000 
STM32MP> 
 

 

0 REPLIES 0