Merge tag 'u-boot-rockchip-20200130' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / drivers / video / rockchip / rk3288_vop.c
index e3e1ec728c01435550d8575bbf135137be267084..0f91dab1f255f4bb897085c3b9337d7176e2b1b7 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
  * Copyright (c) 2015 Google, Inc
  * Copyright 2014 Rockchip Inc.
- *
- * SPDX-License-Identifier: GPL-2.0+
  */
 
 #include <common.h>
 #include <regmap.h>
 #include <syscon.h>
 #include <video.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rk_vop.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -70,6 +69,19 @@ static int rk3288_vop_probe(struct udevice *dev)
        return rk_vop_probe(dev);
 }
 
+static int rk_vop_remove(struct udevice *dev)
+{
+       struct rk_vop_priv *priv = dev_get_priv(dev);
+        struct rk3288_vop *regs = priv->regs;
+
+       setbits_le32(&regs->sys_ctrl, V_STANDBY_EN(1));
+
+       /* wait frame complete (60Hz) to enter standby */
+       mdelay(17);
+
+       return 0;
+}
+
 struct rkvop_driverdata rk3288_driverdata = {
        .features = VOP_FEATURE_OUTPUT_10BIT,
        .set_pin_polarity = rk3288_set_pin_polarity,
@@ -91,5 +103,6 @@ U_BOOT_DRIVER(rk_vop) = {
        .ops    = &rk3288_vop_ops,
        .bind   = rk_vop_bind,
        .probe  = rk3288_vop_probe,
+        .remove = rk_vop_remove,
        .priv_auto_alloc_size   = sizeof(struct rk_vop_priv),
 };