Skip to contentSkip to conversation

spi: rockchip: Convert to late and early system PM callbacks

PATCH Superseded Jeffy Chen 2 participants 4 messages Oct 13, 2017

Subsystems (3)
lore
Share & tools
lore

Jeffy Chen

author
#0 lore raw

PATCH 1/2 spi: rockchip: Convert to late and early system PM callbacks

Currently we are suspending the spi master in it's ->suspend callback, which is racy as some other drivers may still want to transmit messages on the bus(e.g. spi based pwm backlight).

Convert to late and early system PM callbacks to avoid the race.

---

 drivers/spi/spi-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-rockchip.c +1 -1
index fdcf3076681b..ae539c735ea6 100644
@@ -914,7 +914,7 @@ static int rockchip_spi_runtime_resume(struct device *dev)
 #endif /* CONFIG_PM */
 
 static const struct dev_pm_ops rockchip_spi_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
 	SET_RUNTIME_PM_OPS(rockchip_spi_runtime_suspend,
 			   rockchip_spi_runtime_resume, NULL)
 };
Signature · 1 line
2.11.0
author
#1 lore raw

PATCH 2/2 arm64: dts: rockchip: Enable edp disaplay on kevin

Add edp panel and enable related nodes on kevin.

---

 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 29 +++++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 16 +++++++++++++
 2 files changed, 45 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts +29 -0
index a3d3cea7dc4f..bc67b19f0af5 100644
@@ -93,6 +93,18 @@
 		pwm-delay-us = <10000>;
 	};
 
+	edp_panel: edp-panel {
+		compatible = "sharp,lq123p1jx31", "simple-panel";
+		backlight = <&backlight>;
+		power-supply = <&pp3300_disp>;
+
+		ports {
+			panel_in_edp: endpoint {
+				remote-endpoint = <&edp_out_panel>;
+			};
+		};
+	};
+
 	thermistor_ppvar_bigcpu: thermistor-ppvar-bigcpu {
 		compatible = "murata,ncp15wb473";
 		pullup-uv = <1800000>;
@@ -264,6 +276,23 @@ ap_i2c_dig: &i2c2 {
 	};
 };
 
+&edp {
+	status = "okay";
+
+	ports {
+		edp_out: port at 1 {
+			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			edp_out_panel: endpoint at 0 {
+				reg = <0>;
+				remote-endpoint = <&panel_in_edp>;
+			};
+		};
+	};
+};
+
 &ppvar_bigcpu_pwm {
 	regulator-min-microvolt = <798674>;
 	regulator-max-microvolt = <1302172>;
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +16 -0
index 5772c52fbfd3..470105d651c2 100644
@@ -927,6 +927,22 @@ ap_i2c_audio: &i2c8 {
 	dr_mode = "host";
 };
 
+&vopb {
+	status = "okay";
+};
+
+&vopb_mmu {
+	status = "okay";
+};
+
+&vopl {
+	status = "okay";
+};
+
+&vopl_mmu {
+	status = "okay";
+};
+
 #include <arm/cros-ec-keyboard.dtsi>
 #include <arm/cros-ec-sbs.dtsi>
 
Signature · 1 line
2.11.0
maintainer
#2 lore raw
In reply to Jeffy Chen
Quoted 3 lines · Jeffy Chen

Currently we are suspending the spi master in it's ->suspend callback, which is racy as some other drivers may still want to transmit messages on the bus(e.g. spi based pwm backlight).

I'm missing patch 2/2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171013/e0813609/attachment.sig>

author
#3 lore raw

Hi Mark,

Quoted 7 lines · Mark Brown
Quoted 3 lines · Jeffy Chen

Currently we are suspending the spi master in it's ->suspend callback, which is racy as some other drivers may still want to transmit messages on the bus(e.g. spi based pwm backlight).

I'm missing patch 2/2.

Sorry, i'll resend them...

This patch is to defer suspend_spi_master to late suspend.

Since we put display-subsystem dt node above spi dt node, which makes spi suspend been called before display driver. Then the display driver would fail to set pwm backlight through spi in it's suspend/resume.