From 9207775bc721220b6430b153a21cfe4a57d30c0d Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Wed, 21 Dec 2022 18:54:25 +0900 Subject: [PATCH] drm/vc4: hdmi: Fix hotplug extcon uevent to works There is a problem that extcon uevent does not work hdmi hotplug, so fixed to works. Change-Id: Ic22bfd25c6ebf951832c6687b68dfcda286a833d Signed-off-by: Hoegeun Kwon --- drivers/gpu/drm/vc4/vc4_hdmi.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 04791b3..5a20e7b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -409,7 +409,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 @@ -443,15 +442,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, @@ -488,6 +478,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; } -- 2.7.4