[U-Boot,v1,1/7] video: stm32: stm32_ltdc: add reset

Message ID 1518535713-787-2-git-send-email-yannick.fertre@st.com
State Superseded
Delegated to: Anatolij Gustschin
Headers show
Series
  • splash screen on the stm32f746 disco board
Related show

Commit Message

Yannick FERTRE Feb. 13, 2018, 3:28 p.m.
Add reset of LTDC display controller.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
---
 drivers/video/stm32/stm32_ltdc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch

diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
index b417ac2..d8784f1 100644
--- a/drivers/video/stm32/stm32_ltdc.c
+++ b/drivers/video/stm32/stm32_ltdc.c
@@ -11,6 +11,7 @@ 
 #include <clk.h>
 #include <dm.h>
 #include <panel.h>
+#include <reset.h>
 #include <video.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
@@ -302,6 +303,7 @@  static int stm32_ltdc_probe(struct udevice *dev)
 	struct stm32_ltdc_priv *priv = dev_get_priv(dev);
 	struct udevice *panel;
 	struct clk pclk, pxclk;
+	struct reset_ctl rst;
 	int ret;
 
 	priv->regs = (void *)dev_read_addr(dev);
@@ -316,6 +318,15 @@  static int stm32_ltdc_probe(struct udevice *dev)
 		return ret;
 	}
 
+	ret = reset_get_by_index(dev, 0, &rst);
+	if (ret) {
+		debug("%s: missing ltdc hardware reset\n", __func__);
+		return -ENODEV;
+	}
+
+	/* Reset */
+	reset_deassert(&rst);
+
 	ret = panel_enable_backlight(panel);
 	if (ret) {
 		debug("%s: panel %s enable backlight error %d\n",