aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2015-09-08 19:08:43 +0100
committerRyan Harkin <ryan.harkin@linaro.org>2017-07-13 21:00:28 +0100
commite27543e885fbd1cea22604653e9942f587697ef4 (patch)
tree5cf886afbd236b5e781f6e5149e29f84c23720b4
parent1714e2a9840dbad9e824c58c28a6ddda3b48af25 (diff)
drm: hdlcd: Make sure hardware is in a safe reset state at startup
If hardware is already initialised (e.g. by UEFI) then that seems to cause us problems. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/gpu/drm/arm/hdlcd_drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 6a61902e5795..51cbd540e5b7 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -67,6 +67,12 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
(version & HDLCD_VERSION_MAJOR_MASK) >> 8,
version & HDLCD_VERSION_MINOR_MASK);
+ /* Make sure hardware is in a safe reset state */
+ hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0);
+ hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, 0);
+ hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR,~0);
+ hdlcd_write(hdlcd, HDLCD_REG_INT_RAWSTAT, 0);
+
/* Get the optional framebuffer memory resource */
ret = of_reserved_mem_device_init(drm->dev);
if (ret && ret != -ENODEV)