From 3d6f4474dc0288a41f31f75962331d2ac31995b5 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Tue, 30 Mar 2021 16:10:16 +0800 Subject: [PATCH] drm/rockchip: vop2: Add vop2_standby This is for mipi dsi on rk356x: there is a hold signal from mipi dsi to vop. Mipi dsi may trigger the hold signal when send dsi command or switch between video mode and command mode. vop may run into an unexpected situation if this hold signal is rise when vop is running. So when mipi dsi switch between video mode or command mode, or send a dsi command, it should set vop in stanby state. Change-Id: I80e456d3416518436045ae8e0eec215c22b111a3 Signed-off-by: Andy Yan --- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 + drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h index ad721fccc6aa..335254d23c31 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h @@ -956,6 +956,7 @@ static inline int interpolate(int x1, int y1, int x2, int y2, int x) return y1 + (y2 - y1) * (x - x1) / (x2 - x1); } +extern void vop2_standby(struct drm_crtc *crtc, bool standby); extern const struct component_ops vop_component_ops; extern const struct component_ops vop2_component_ops; #endif /* _ROCKCHIP_DRM_VOP_H */ diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 78dd63f70c3a..fb859b8673b3 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -653,6 +653,20 @@ static uint64_t vop2_soc_id_fixup(uint64_t soc_id) } } +void vop2_standby(struct drm_crtc *crtc, bool standby) +{ + struct vop2_video_port *vp = to_vop2_video_port(crtc); + struct vop2 *vop2 = vp->vop2; + + if (standby) { + VOP_MODULE_SET(vop2, vp, standby, 1); + mdelay(20); + } else { + VOP_MODULE_SET(vop2, vp, standby, 0); + } +} +EXPORT_SYMBOL(vop2_standby); + static inline const struct vop2_win_regs *vop2_get_win_regs(struct vop2_win *win, const struct vop_reg *reg) {