drm/vc4: hdmi: Add reset callback 82/243882/1
authorMaxime Ripard <maxime@cerno.tech>
Tue, 25 Aug 2020 06:53:28 +0000 (15:53 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Fri, 11 Sep 2020 01:44:50 +0000 (10:44 +0900)
The BCM2711 and BCM283x HDMI controllers use a slightly different reset
sequence, so let's add a callback to reset the controller.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a34bcb493da07eae58ed704f65e72ce0748e8952.1599120059.git-series.maxime@cerno.tech
[hoegeun.kwon: Apply the missing code, needed to troubleshoot page flip
timed out issue.]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: If0383cb9b5f8ba5d3f309bfeab3e3c74272d8723

drivers/gpu/drm/vc4/vc4_hdmi.c

index da9fce5..77c05ae 100644 (file)
@@ -97,6 +97,12 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
 
 static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi)
 {
+       HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_SW_RST);
+       udelay(1);
+       HDMI_WRITE(HDMI_M_CTL, 0);
+
+       HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_ENABLE);
+
        HDMI_WRITE(HDMI_SW_RESET_CONTROL,
                   VC4_HDMI_SW_RESET_HDMI |
                   VC4_HDMI_SW_RESET_FORMAT_DETECT);
@@ -1757,14 +1763,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
                vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW;
        }
 
-       /* HDMI core must be enabled. */
-       if (!(HDMI_READ(HDMI_M_CTL) & VC4_HD_M_ENABLE)) {
-               HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_SW_RST);
-               udelay(1);
-               HDMI_WRITE(HDMI_M_CTL, 0);
-
-               HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_ENABLE);
-       }
        pm_runtime_enable(dev);
 
        drm_encoder_init(drm, encoder, &vc4_hdmi_encoder_funcs,