Skip to contentSkip to conversation

drm: bridge: dw-hdmi: Add hooks for suspend/resume

PATCH Superseded Douglas Anderson 4 participants 10 messages May 2, 2019 – May 16, 2019

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm: bridge: dw-hdmi: Add hooks for suspend/resume

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +21 -0
index db761329a1e3..4b38bfd43e59 100644
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+	initialize_hdmi_ih_mutes(hdmi);
+
+	dw_hdmi_setup_i2c(hdmi);
+	if (hdmi->i2c)
+		dw_hdmi_i2c_init(hdmi);
+
+	if (hdmi->phy.ops->setup_hpd)
+		hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);
+
 MODULE_AUTHOR("Sascha Hauer <[email protected]>");
 MODULE_AUTHOR("Andy Yan <[email protected]>");
 MODULE_AUTHOR("Yakir Yang <[email protected]>");
include/drm/bridge/dw_hdmi.h +3 -0
index 66e70770cce5..c4132e9a5ae3 100644
@@ -154,6 +154,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
 			     struct drm_encoder *encoder,
 			     const struct dw_hdmi_plat_data *plat_data);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi);
+int dw_hdmi_resume(struct dw_hdmi *hdmi);
+
 void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
 
 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
#1 lore raw

PATCH 2/2 drm/rockchip: dw_hdmi: Handle suspend/resume

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's call the core dw-hdmi's suspend/resume functions to restore things.

NOTE: in downstream Chrome OS (based on kernel 3.14) we used the "late/early" versions of suspend/resume because we found that the VOP was sometimes resuming before dw_hdmi and then calling into us before we were fully resumed. For now I have gone back to the normal suspend/resume because I can't reproduce the problems.

---

 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +20 -0
index 4cdc9f86c2e5..deb0e8c30c03 100644
@@ -542,11 +542,31 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int __maybe_unused dw_hdmi_rockchip_suspend(struct device *dev)
+{
+	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+
+	return dw_hdmi_suspend(hdmi->hdmi);
+}
+
+static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev)
+{
+	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+
+	return dw_hdmi_resume(hdmi->hdmi);
+}
+
+const struct dev_pm_ops dw_hdmi_rockchip_pm = {
+	SET_SYSTEM_SLEEP_PM_OPS(dw_hdmi_rockchip_suspend,
+				dw_hdmi_rockchip_resume)
+};
+
 struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
 	.probe  = dw_hdmi_rockchip_probe,
 	.remove = dw_hdmi_rockchip_remove,
 	.driver = {
 		.name = "dwhdmi-rockchip",
+		.pm = &dw_hdmi_rockchip_pm,
 		.of_match_table = dw_hdmi_rockchip_dt_ids,
 	},
 };
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
#4 lore raw
In reply to Douglas Anderson

Hi

From: Douglas Anderson <[email protected]>
Date: Thu, May 2, 2019 at 3:38 PM
To: Heiko Stuebner, Sandy Huang, Andrzej Hajda, Laurent Pinchart
Cc: <[email protected]>, Neil Armstrong, <[email protected]>, Sean Paul, Douglas Anderson, Zheng Yang, Sam Ravnborg, <[email protected]>, <[email protected]>, Ville Syrjälä, David Airlie, Jernej Skrabec, Daniel Vetter

Quoted 17 lines

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

Quoted 6 lines

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)

Did anyone have any thoughts on this patch series? Thanks! :-)

-Doug
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to Douglas Anderson
Quoted 42 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
index db761329a1e3..4b38bfd43e59 100644
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+	initialize_hdmi_ih_mutes(hdmi);
+

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2802

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
+	dw_hdmi_setup_i2c(hdmi);
+	if (hdmi->i2c)
+		dw_hdmi_i2c_init(hdmi);
+
+	if (hdmi->phy.ops->setup_hpd)
+		hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);

Both patches look good to me, I'd probably prefer to just smash them together, but meh.

If no one more authoritative chimes in, I'll apply them to -misc in a few days.

Sean

Quoted 21 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1 -0
+
 MODULE_AUTHOR("Sascha Hauer <[email protected]>");
 MODULE_AUTHOR("Andy Yan <[email protected]>");
 MODULE_AUTHOR("Yakir Yang <[email protected]>");
include/drm/bridge/dw_hdmi.h +3 -0
index 66e70770cce5..c4132e9a5ae3 100644
@@ -154,6 +154,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
 			     struct drm_encoder *encoder,
 			     const struct dw_hdmi_plat_data *plat_data);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi);
+int dw_hdmi_resume(struct dw_hdmi *hdmi);
+
 void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
 
 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
#6 lore raw

Hi,

Quoted 57 lines · Sean Paul
Quoted 42 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
index db761329a1e3..4b38bfd43e59 100644
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+     initialize_hdmi_ih_mutes(hdmi);
+

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2802

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
+     dw_hdmi_setup_i2c(hdmi);
+     if (hdmi->i2c)
+             dw_hdmi_i2c_init(hdmi);
+
+     if (hdmi->phy.ops->setup_hpd)
+             hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);

Both patches look good to me, I'd probably prefer to just smash them together, but meh.

Quoted 1 line

If no one more authoritative chimes in, I'll apply them to -misc in a few days.

Sure. I can smash them and re-post or you can smash them for me or we can keep them as-is. I originally separated because I wasn't sure if they'd eventually go through different trees. Just let me know! :-)

-Doug

#7 lore raw
Quoted 61 lines · Doug Anderson

Hi,

Quoted 57 lines · Sean Paul
Quoted 42 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
index db761329a1e3..4b38bfd43e59 100644
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+     initialize_hdmi_ih_mutes(hdmi);
+

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2802

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
+     dw_hdmi_setup_i2c(hdmi);
+     if (hdmi->i2c)
+             dw_hdmi_i2c_init(hdmi);
+
+     if (hdmi->phy.ops->setup_hpd)
+             hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);

Both patches look good to me, I'd probably prefer to just smash them together, but meh.

Quoted 5 lines
Quoted 1 line

If no one more authoritative chimes in, I'll apply them to -misc in a few days.

Sure. I can smash them and re-post or you can smash them for me or we can keep them as-is. I originally separated because I wasn't sure if they'd eventually go through different trees. Just let me know! :-)

Definitely no need to repost. It's entirely possible Andrzej or Heiko prefer to have the dw-hdmi stuff broken out anyways. My opinion is of little value here :)

Sean

Quoted 2 lines

-Doug

Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
maintainer
#8 lore raw

Am Mittwoch, 15. Mai 2019, 20:05:03 CEST schrieb Sean Paul:

Quoted 62 lines · Doug Anderson
Quoted 61 lines

Hi,

Quoted 57 lines · Sean Paul
Quoted 42 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
index db761329a1e3..4b38bfd43e59 100644
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+     initialize_hdmi_ih_mutes(hdmi);
+

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2802

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +10 -0
+     dw_hdmi_setup_i2c(hdmi);
+     if (hdmi->i2c)
+             dw_hdmi_i2c_init(hdmi);
+
+     if (hdmi->phy.ops->setup_hpd)
+             hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+     return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);

Both patches look good to me, I'd probably prefer to just smash them together, but meh.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

If no one more authoritative chimes in, I'll apply them to -misc in a few days.

Sure. I can smash them and re-post or you can smash them for me or we can keep them as-is. I originally separated because I wasn't sure if they'd eventually go through different trees. Just let me know! :-)

Definitely no need to repost. It's entirely possible Andrzej or Heiko prefer to have the dw-hdmi stuff broken out anyways. My opinion is of little value here :)

I guess my own preference is to keep them as they are now - so separate. It makes it easier to see what gets done and also keeps the boundary on where to split pretty clear.

Heiko

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume

In reply to Douglas Anderson

Am Freitag, 3. Mai 2019, 00:38:08 CEST schrieb Douglas Anderson:

Quoted 11 lines

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's call the core dw-hdmi's suspend/resume functions to restore things.

Quoted 7 lines

NOTE: in downstream Chrome OS (based on kernel 3.14) we used the "late/early" versions of suspend/resume because we found that the VOP was sometimes resuming before dw_hdmi and then calling into us before we were fully resumed. For now I have gone back to the normal suspend/resume because I can't reproduce the problems.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

reviewer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume

In reply to Douglas Anderson

Hi Douglas,

Thank you for the patch.

Quoted 8 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Quoted 8 lines

Let's call the core dw-hdmi's suspend/resume functions to restore things.

NOTE: in downstream Chrome OS (based on kernel 3.14) we used the "late/early" versions of suspend/resume because we found that the VOP was sometimes resuming before dw_hdmi and then calling into us before we were fully resumed. For now I have gone back to the normal suspend/resume because I can't reproduce the problems.

Should this be solved with device links if needed ?

Quoted 19 lines

---

 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +5 -0
index 4cdc9f86c2e5..deb0e8c30c03 100644
@@ -542,11 +542,31 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int __maybe_unused dw_hdmi_rockchip_suspend(struct device *dev)
+{
+	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+
+	return dw_hdmi_suspend(hdmi->hdmi);

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c static int dw_hdmi_rockchip_remove(struct platform_device *pdev) · line 559

Quoted 10 lines
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +10 -0
+}
+
+static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev)
+{
+	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+
+	return dw_hdmi_resume(hdmi->hdmi);
+}
+
+const struct dev_pm_ops dw_hdmi_rockchip_pm = {

Missing static keyword ?

Apart from this,

Quoted 13 lines
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +5 -0
+	SET_SYSTEM_SLEEP_PM_OPS(dw_hdmi_rockchip_suspend,
+				dw_hdmi_rockchip_resume)
+};
+
 struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
 	.probe  = dw_hdmi_rockchip_probe,
 	.remove = dw_hdmi_rockchip_remove,
 	.driver = {
 		.name = "dwhdmi-rockchip",
+		.pm = &dw_hdmi_rockchip_pm,
 		.of_match_table = dw_hdmi_rockchip_dt_ids,
 	},
 };
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw
In reply to Douglas Anderson

Hi Douglas,

Thank you for the patch.

Quoted 29 lines · Douglas Anderson

On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle:

1. You lose the ability to detect an HDMI device being plugged in.

2. If you're using the i2c bus built in to dw_hdmi then it stops working.

Let's add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit.

NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it.

---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++
 include/drm/bridge/dw_hdmi.h              |  3 +++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +0 -0
index db761329a1e3..4b38bfd43e59 100644

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2788

Quoted 9 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +6 -0
@@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi)
+{
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_suspend);
+

As this is empty, should we leave it out ? It adds a bit of bloat to the kernel for no real reason, and we can add it later if required.

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c void dw_hdmi_unbind(struct dw_hdmi *hdmi) · line 2800

Quoted 12 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +12 -0
+int dw_hdmi_resume(struct dw_hdmi *hdmi)
+{
+	initialize_hdmi_ih_mutes(hdmi);
+
+	dw_hdmi_setup_i2c(hdmi);
+	if (hdmi->i2c)
+		dw_hdmi_i2c_init(hdmi);
+
+	if (hdmi->phy.ops->setup_hpd)
+		hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
+
+	return 0;

How about refactoring the probe function to extract hardware initialisation to a separate function, and calling it from here ?

Quoted 20 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +3 -0
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_resume);
+
 MODULE_AUTHOR("Sascha Hauer <[email protected]>");
 MODULE_AUTHOR("Andy Yan <[email protected]>");
 MODULE_AUTHOR("Yakir Yang <[email protected]>");
include/drm/bridge/dw_hdmi.h +3 -0
index 66e70770cce5..c4132e9a5ae3 100644
@@ -154,6 +154,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
 			     struct drm_encoder *encoder,
 			     const struct dw_hdmi_plat_data *plat_data);
 
+int dw_hdmi_suspend(struct dw_hdmi *hdmi);
+int dw_hdmi_resume(struct dw_hdmi *hdmi);
+
 void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
 
 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
Signature · 3 lines
Regards,

Laurent Pinchart