drm/rockchip: Add hdmi shutdown interface

When system shutdown, shutdown interface will be called.
Hdmi should be disabled when system shutdown.

Change-Id: I09ec1d7d3801bf8a8277c91072fa09bd1b430809
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao
2018-11-30 16:29:41 +08:00
committed by Tao Huang
parent 37fda45520
commit c4bac4aa0b
2 changed files with 23 additions and 1 deletions

View File

@@ -3532,9 +3532,22 @@ static void dw_hdmi_reg_initial(struct dw_hdmi *hdmi)
void dw_hdmi_suspend(struct dw_hdmi *hdmi)
{
mutex_lock(&hdmi->mutex);
/*
* When system shutdown, hdmi should be disabled.
* When system suspend, dw_hdmi_bridge_disable will disable hdmi first.
* To prevent duplicate operation, we should determine whether hdmi
* has been disabled.
*/
if (!hdmi->disabled) {
hdmi->disabled = true;
dw_hdmi_update_power(hdmi);
dw_hdmi_update_phy_mask(hdmi);
}
mutex_unlock(&hdmi->mutex);
if (hdmi->irq)
disable_irq(hdmi->irq);
mutex_unlock(&hdmi->mutex);
pinctrl_pm_select_sleep_state(hdmi->dev);
}
EXPORT_SYMBOL_GPL(dw_hdmi_suspend);

View File

@@ -683,6 +683,14 @@ static int dw_hdmi_rockchip_probe(struct platform_device *pdev)
return component_add(&pdev->dev, &dw_hdmi_rockchip_ops);
}
static void dw_hdmi_rockchip_shutdown(struct platform_device *pdev)
{
struct rockchip_hdmi *hdmi = dev_get_drvdata(&pdev->dev);
dw_hdmi_suspend(hdmi->hdmi);
pm_runtime_put_sync(&pdev->dev);
}
static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
{
component_del(&pdev->dev, &dw_hdmi_rockchip_ops);
@@ -719,6 +727,7 @@ static const struct dev_pm_ops dw_hdmi_rockchip_pm = {
struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
.probe = dw_hdmi_rockchip_probe,
.remove = dw_hdmi_rockchip_remove,
.shutdown = dw_hdmi_rockchip_shutdown,
.driver = {
.name = "dwhdmi-rockchip",
.pm = &dw_hdmi_rockchip_pm,