linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks
@ 2017-10-13 10:01 Jeffy Chen
  2017-10-13 10:01 ` [PATCH 2/2] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
  2017-10-13 10:17 ` [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Jeffy Chen @ 2017-10-13 10:01 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 drivers/spi/spi-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index fdcf3076681b..ae539c735ea6 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -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)
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] arm64: dts: rockchip: Enable edp disaplay on kevin
  2017-10-13 10:01 [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen
@ 2017-10-13 10:01 ` Jeffy Chen
  2017-10-13 10:17 ` [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffy Chen @ 2017-10-13 10:01 UTC (permalink / raw)
  To: linux-arm-kernel

Add edp panel and enable related nodes on kevin.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 29 +++++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 16 +++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
index a3d3cea7dc4f..bc67b19f0af5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
@@ -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>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 5772c52fbfd3..470105d651c2 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -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>
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks
  2017-10-13 10:01 [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen
  2017-10-13 10:01 ` [PATCH 2/2] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
@ 2017-10-13 10:17 ` Mark Brown
  2017-10-13 10:47   ` jeffy
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2017-10-13 10:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 13, 2017 at 06:01:15PM +0800, Jeffy Chen wrote:
> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks
  2017-10-13 10:17 ` [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Mark Brown
@ 2017-10-13 10:47   ` jeffy
  0 siblings, 0 replies; 4+ messages in thread
From: jeffy @ 2017-10-13 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mark,

On 10/13/2017 06:17 PM, Mark Brown wrote:
> On Fri, Oct 13, 2017 at 06:01:15PM +0800, Jeffy Chen wrote:
>> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-13 10:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 10:01 [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen
2017-10-13 10:01 ` [PATCH 2/2] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
2017-10-13 10:17 ` [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Mark Brown
2017-10-13 10:47   ` jeffy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).