diff --git a/sys/arch/arm/rockchip/rk_vop.c b/sys/arch/arm/rockchip/rk_vop.c index c80cda0921cb..7d9aa98d5823 100644 --- a/sys/arch/arm/rockchip/rk_vop.c +++ b/sys/arch/arm/rockchip/rk_vop.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $ */ +/* $NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $"); #include #include @@ -265,6 +265,27 @@ static const struct drm_crtc_funcs rk_vop_crtc_funcs = { static void rk_vop_dpms(struct drm_crtc *crtc, int mode) { + struct rk_vop_crtc *mixer_crtc = to_rk_vop_crtc(crtc); + struct rk_vop_softc * const sc = mixer_crtc->sc; + uint32_t val; + + val = RD4(sc, VOP_SYS_CTRL); + + switch (mode) { + case DRM_MODE_DPMS_ON: + val &= ~VOP_STANDBY_EN; + break; + case DRM_MODE_DPMS_STANDBY: + case DRM_MODE_DPMS_SUSPEND: + case DRM_MODE_DPMS_OFF: + val |= VOP_STANDBY_EN; + break; + } + + WR4(sc, VOP_SYS_CTRL, val); + + /* Commit settings */ + WR4(sc, VOP_REG_CFG_DONE, REG_LOAD_EN); } static bool