diff options
author | Hsin-Yi Wang <hsinyi@chromium.org> | 2022-06-30 03:05:46 +0800 |
---|---|---|
committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2022-07-04 21:42:43 +0800 |
commit | 0f15d785ff2d59884f6271bb4ba4522596f218c7 (patch) | |
tree | c6544a1617125c74752eec3efcbc3d0cdce4abd7 /drivers/gpu/drm/mediatek/mtk_drm_drv.c | |
parent | 2545e12da4281f859c7b41b9681db15668e7f44d (diff) |
drm/mediatek: Ensure bridge disable happends before suspend
Make sure bridge_disable will be called before suspend by calling
drm_mode_config_helper_suspend() in .prepare callback.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220629190545.478113-1-hsinyi@chromium.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_drv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 0551e1a8c941..e659dc84d7e5 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -826,8 +826,7 @@ static int mtk_drm_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int mtk_drm_sys_suspend(struct device *dev) +static int mtk_drm_sys_prepare(struct device *dev) { struct mtk_drm_private *private = dev_get_drvdata(dev); struct drm_device *drm = private->drm; @@ -838,20 +837,21 @@ static int mtk_drm_sys_suspend(struct device *dev) return ret; } -static int mtk_drm_sys_resume(struct device *dev) +static void mtk_drm_sys_complete(struct device *dev) { struct mtk_drm_private *private = dev_get_drvdata(dev); struct drm_device *drm = private->drm; int ret; ret = drm_mode_config_helper_resume(drm); - - return ret; + if (ret) + dev_err(dev, "Failed to resume\n"); } -#endif -static SIMPLE_DEV_PM_OPS(mtk_drm_pm_ops, mtk_drm_sys_suspend, - mtk_drm_sys_resume); +static const struct dev_pm_ops mtk_drm_pm_ops = { + .prepare = mtk_drm_sys_prepare, + .complete = mtk_drm_sys_complete, +}; static struct platform_driver mtk_drm_platform_driver = { .probe = mtk_drm_probe, |