drm/vc4: hdmi: Fix hotplug extcon uevent to works
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 21 Dec 2022 09:54:25 +0000 (18:54 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 09:35:26 +0000 (18:35 +0900)
There is a problem that extcon uevent does not work hdmi hotplug, so
fixed to works.

Change-Id: Ic22bfd25c6ebf951832c6687b68dfcda286a833d
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/gpu/drm/vc4/vc4_hdmi.c

index 8c0c0b5..1fd1eda 100644 (file)
@@ -413,7 +413,6 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
 {
        struct drm_connector *connector = &vc4_hdmi->connector;
        struct edid *edid;
-       int ret;
 
        /*
         * NOTE: This function should really be called with
@@ -447,15 +446,6 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
        kfree(edid);
 
        vc4_hdmi_reset_link(connector, ctx);
-
-#ifdef CONFIG_EXTCON
-       if (ret != vc4_hdmi->status) {
-               extcon_set_state_sync(vc4_hdmi->edev, EXTCON_DISP_HDMI,
-                                     (status == connector_status_connected ?
-                                     true : false));
-               vc4_hdmi->status = ret;
-       }
-#endif
 }
 
 static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
@@ -492,6 +482,15 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
        vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status);
        pm_runtime_put(&vc4_hdmi->pdev->dev);
 
+#ifdef CONFIG_EXTCON
+       if (status != vc4_hdmi->status) {
+               extcon_set_state_sync(vc4_hdmi->edev, EXTCON_DISP_HDMI,
+                                     (status == connector_status_connected ?
+                                     true : false));
+               vc4_hdmi->status = status;
+       }
+#endif
+
        return status;
 }