drm/bridge: analogix_dp: Don't create useless connectors
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 5 Mar 2018 08:57:41 +0000 (09:57 +0100)
committerAndrzej Hajda <a.hajda@samsung.com>
Wed, 7 Mar 2018 15:18:00 +0000 (16:18 +0100)
If there is another bridge after analogix_dp, then the connector object
should not be created. This fixes following timeouts on Exynos5420-based
Chromebook2 Peach-PIT board during boot:

exynos-dp 145b0000.dp-controller: AUX CH cmd reply timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!
exynos-dp 145b0000.dp-controller: AUX CH enable timeout!

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180305085741.18896-4-m.szyprowski@samsung.com
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
drivers/gpu/drm/exynos/exynos_dp.c
include/drm/bridge/analogix_dp.h

index b391d149db9118964c327dd32a1136074559757d..a693ab3078f0fd1e3bef19dbda9a716b38070bbb 100644 (file)
@@ -1012,27 +1012,30 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge)
 {
        struct analogix_dp_device *dp = bridge->driver_private;
        struct drm_encoder *encoder = dp->encoder;
-       struct drm_connector *connector = &dp->connector;
-       int ret;
+       struct drm_connector *connector = NULL;
+       int ret = 0;
 
        if (!bridge->encoder) {
                DRM_ERROR("Parent encoder object not found");
                return -ENODEV;
        }
 
-       connector->polled = DRM_CONNECTOR_POLL_HPD;
+       if (!dp->plat_data->skip_connector) {
+               connector = &dp->connector;
+               connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-       ret = drm_connector_init(dp->drm_dev, connector,
-                                &analogix_dp_connector_funcs,
-                                DRM_MODE_CONNECTOR_eDP);
-       if (ret) {
-               DRM_ERROR("Failed to initialize connector with drm\n");
-               return ret;
-       }
+               ret = drm_connector_init(dp->drm_dev, connector,
+                                        &analogix_dp_connector_funcs,
+                                        DRM_MODE_CONNECTOR_eDP);
+               if (ret) {
+                       DRM_ERROR("Failed to initialize connector with drm\n");
+                       return ret;
+               }
 
-       drm_connector_helper_add(connector,
-                                &analogix_dp_connector_helper_funcs);
-       drm_mode_connector_attach_encoder(connector, encoder);
+               drm_connector_helper_add(connector,
+                                        &analogix_dp_connector_helper_funcs);
+               drm_mode_connector_attach_encoder(connector, encoder);
+       }
 
        /*
         * NOTE: the connector registration is implemented in analogix
index 33319a858f3ab537a833cb7c42058d10e64376c3..964831dab1025f976e3c033cf17e0324cc5abc23 100644 (file)
@@ -244,6 +244,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
 
        /* The remote port can be either a panel or a bridge */
        dp->plat_data.panel = panel;
+       dp->plat_data.skip_connector = !!bridge;
        dp->ptn_bridge = bridge;
 
 out:
index 5518fc75dd6eff47bba2928eccc7b16a4d772705..711fff9b6803d511c5f7795f5801bfbe1076a01b 100644 (file)
@@ -31,6 +31,7 @@ struct analogix_dp_plat_data {
        struct drm_panel *panel;
        struct drm_encoder *encoder;
        struct drm_connector *connector;
+       bool skip_connector;
 
        int (*power_on)(struct analogix_dp_plat_data *);
        int (*power_off)(struct analogix_dp_plat_data *);