]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - drivers/gpu/drm/omapdrm/omap_connector.c
drm/omap: Notify all devices in the pipeline of output disconnection
[thirdparty/kernel/stable.git] / drivers / gpu / drm / omapdrm / omap_connector.c
index 6f219f61a78389a3b6d08b74584527990c6d5aae..e01e4cf61ae1a378004e9d1455393d958f1231e1 100644 (file)
@@ -35,18 +35,22 @@ struct omap_connector {
 };
 
 static void omap_connector_hpd_notify(struct drm_connector *connector,
-                                     struct omap_dss_device *src,
                                      enum drm_connector_status status)
 {
-       if (status == connector_status_disconnected) {
-               /*
-                * If the source is an HDMI encoder, notify it of disconnection.
-                * This is required to let the HDMI encoder reset any internal
-                * state related to connection status, such as the CEC address.
-                */
-               if (src && src->type == OMAP_DISPLAY_TYPE_HDMI &&
-                   src->ops->hdmi.lost_hotplug)
-                       src->ops->hdmi.lost_hotplug(src);
+       struct omap_connector *omap_connector = to_omap_connector(connector);
+       struct omap_dss_device *dssdev;
+
+       if (status != connector_status_disconnected)
+               return;
+
+       /*
+        * Notify all devics in the pipeline of disconnection. This is required
+        * to let the HDMI encoders reset their internal state related to
+        * connection status, such as the CEC address.
+        */
+       for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) {
+               if (dssdev->ops && dssdev->ops->hdmi.lost_hotplug)
+                       dssdev->ops->hdmi.lost_hotplug(dssdev);
        }
 }
 
@@ -66,7 +70,7 @@ static void omap_connector_hpd_cb(void *cb_data,
        if (old_status == status)
                return;
 
-       omap_connector_hpd_notify(connector, omap_connector->hpd, status);
+       omap_connector_hpd_notify(connector, status);
 
        drm_kms_helper_hotplug_event(dev);
 }
@@ -127,7 +131,7 @@ static enum drm_connector_status omap_connector_detect(
                       ? connector_status_connected
                       : connector_status_disconnected;
 
-               omap_connector_hpd_notify(connector, dssdev->src, status);
+               omap_connector_hpd_notify(connector, status);
        } else {
                switch (connector->connector_type) {
                case DRM_MODE_CONNECTOR_DPI: