diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-31 17:57:28 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-06-09 13:45:28 -0600 |
commit | f418676e9ab8b7ec5496fc83fe8ab2b92b26a58e (patch) | |
tree | c928090a09acab8989513ddbf037cf2d2692e9a4 /drivers/video | |
parent | 6f06ef57bb9031e322752343f7cf8f2408904452 (diff) | |
download | u-boot-f418676e9ab8b7ec5496fc83fe8ab2b92b26a58e.tar.gz u-boot-f418676e9ab8b7ec5496fc83fe8ab2b92b26a58e.tar.bz2 u-boot-f418676e9ab8b7ec5496fc83fe8ab2b92b26a58e.zip |
rockchip: video: Add remove() methods
Add remove() methods for EDP and VOP so that U-Boot can shut down the
video on exit. This avoids leaving DMA running while booting Linux which
can cause problems if Linux uses the frame buffer for something else.
It also makes it clear what is needed to shut down video.
While we are here, make rkvop_enable() static.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Squashed in 'rockchip: video: fix taking the VOP device out of standby':
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/rockchip/rk3288_vop.c | 14 | ||||
-rw-r--r-- | drivers/video/rockchip/rk_edp.c | 16 |
2 files changed, 29 insertions, 1 deletions
diff --git a/drivers/video/rockchip/rk3288_vop.c b/drivers/video/rockchip/rk3288_vop.c index e3e1ec728c..3a5740a6cb 100644 --- a/drivers/video/rockchip/rk3288_vop.c +++ b/drivers/video/rockchip/rk3288_vop.c @@ -70,6 +70,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(®s->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 +104,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), }; diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c index 4e2030e8e4..1527f96eca 100644 --- a/drivers/video/rockchip/rk_edp.c +++ b/drivers/video/rockchip/rk_edp.c @@ -1004,7 +1004,20 @@ static int rk_edp_ofdata_to_platdata(struct udevice *dev) return 0; } -int rk_edp_probe(struct udevice *dev) +static int rk_edp_remove(struct udevice *dev) +{ + struct rk_edp_priv *priv = dev_get_priv(dev); + struct rk3288_edp *regs = priv->regs; + + setbits_le32(®s->video_ctl_1, VIDEO_MUTE); + clrbits_le32(®s->video_ctl_1, VIDEO_EN); + clrbits_le32(®s->sys_ctl_3, F_HPD | HPD_CTRL); + setbits_le32(®s->func_en_1, SW_FUNC_EN_N); + + return 0; +} + +static int rk_edp_probe(struct udevice *dev) { struct display_plat *uc_plat = dev_get_uclass_platdata(dev); struct rk_edp_priv *priv = dev_get_priv(dev); @@ -1080,5 +1093,6 @@ U_BOOT_DRIVER(dp_rockchip) = { .ops = &dp_rockchip_ops, .ofdata_to_platdata = rk_edp_ofdata_to_platdata, .probe = rk_edp_probe, + .remove = rk_edp_remove, .priv_auto_alloc_size = sizeof(struct rk_edp_priv), }; |