From: Leo Li <sunpeng...@amd.com>

Set the connector's kernel device as the parent for the aux kernel
device. This allows udev rules to access connector attributes when
creating symlinks to aux devices.

To do so, the connector needs to be registered beforehand. Therefore,
shift aux registration to be after connector registration.

Cc: Enric Balletbo i Serra <enric.balle...@collabora.com>
Cc: Nicolas Boichat <drink...@chromium.org>
Signed-off-by: Leo Li <sunpeng...@amd.com>
---
 drivers/gpu/drm/bridge/analogix-anx78xx.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c 
b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index f8433c9..9fc8b4c 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -1018,17 +1018,6 @@ static int anx78xx_bridge_attach(struct drm_bridge 
*bridge)
                return -ENODEV;
        }
 
-       /* Register aux channel */
-       anx78xx->aux.name = "DP-AUX";
-       anx78xx->aux.dev = &anx78xx->client->dev;
-       anx78xx->aux.transfer = anx78xx_aux_transfer;
-
-       err = drm_dp_aux_register(&anx78xx->aux);
-       if (err < 0) {
-               DRM_ERROR("Failed to register aux channel: %d\n", err);
-               return err;
-       }
-
        err = drm_connector_init(bridge->dev, &anx78xx->connector,
                                 &anx78xx_connector_funcs,
                                 DRM_MODE_CONNECTOR_DisplayPort);
@@ -1048,6 +1037,17 @@ static int anx78xx_bridge_attach(struct drm_bridge 
*bridge)
 
        anx78xx->connector.polled = DRM_CONNECTOR_POLL_HPD;
 
+       /* Register aux channel */
+       anx78xx->aux.name = "DP-AUX";
+       anx78xx->aux.dev = &anx78xx->connector.kdev;
+       anx78xx->aux.transfer = anx78xx_aux_transfer;
+
+       err = drm_dp_aux_register(&anx78xx->aux);
+       if (err < 0) {
+               DRM_ERROR("Failed to register aux channel: %d\n", err);
+               return err;
+       }
+
        err = drm_connector_attach_encoder(&anx78xx->connector,
                                           bridge->encoder);
        if (err) {
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to