return ret;
 }
 
+
+static void register_backlight_device(struct amdgpu_display_manager *dm,
+                                     struct dc_link *link)
+{
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) ||\
+       defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+
+       if ((link->connector_signal & (SIGNAL_TYPE_EDP | SIGNAL_TYPE_LVDS)) &&
+           link->type != dc_connection_none) {
+               /* Event if registration failed, we should continue with
+                * DM initialization because not having a backlight control
+                * is better then a black screen.
+                */
+               amdgpu_dm_register_backlight_device(dm);
+
+               if (dm->backlight_dev)
+                       dm->backlight_link = link;
+       }
+#endif
+}
+
+
 /* In this architecture, the association
  * connector -> encoder -> crtc
  * id not really requried. The crtc and connector will hold the
 
        /* loops over all connectors on the board */
        for (i = 0; i < link_cnt; i++) {
+               struct dc_link *link = NULL;
 
                if (i > AMDGPU_DM_MAX_DISPLAY_INDEX) {
                        DRM_ERROR(
                        goto fail;
                }
 
-               if (dc_link_detect(dc_get_link_at_index(dm->dc, i),
-                               DETECT_REASON_BOOT))
+               link = dc_get_link_at_index(dm->dc, i);
+
+               if (dc_link_detect(link, DETECT_REASON_BOOT)) {
                        amdgpu_dm_update_connector_after_detect(aconnector);
+                       register_backlight_device(dm, link);
+               }
+
+
        }
 
        /* Software is initialized. Now we can register interrupt handlers. */
 #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) ||\
        defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
 
-       if (link->connector_signal & (SIGNAL_TYPE_EDP | SIGNAL_TYPE_LVDS)) {
+       if ((link->connector_signal & (SIGNAL_TYPE_EDP | SIGNAL_TYPE_LVDS)) &&
+           link->type != dc_connection_none) {
                amdgpu_dm_register_backlight_device(dm);
 
                if (dm->backlight_dev) {
        return i2c;
 }
 
+
 /* Note: this function assumes that dc_link_detect() was called for the
  * dc_link which will be represented by this aconnector.
  */
                || connector_type == DRM_MODE_CONNECTOR_eDP)
                amdgpu_dm_initialize_dp_connector(dm, aconnector);
 
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) ||\
-       defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
-
-       /* NOTE: this currently will create backlight device even if a panel
-        * is not connected to the eDP/LVDS connector.
-        *
-        * This is less than ideal but we don't have sink information at this
-        * stage since detection happens after. We can't do detection earlier
-        * since MST detection needs connectors to be created first.
-        */
-       if (link->connector_signal & (SIGNAL_TYPE_EDP | SIGNAL_TYPE_LVDS)) {
-               /* Event if registration failed, we should continue with
-                * DM initialization because not having a backlight control
-                * is better then a black screen.
-                */
-               amdgpu_dm_register_backlight_device(dm);
-
-               if (dm->backlight_dev)
-                       dm->backlight_link = link;
-       }
-#endif
-
 out_free:
        if (res) {
                kfree(i2c);