From patchwork Thu Jul 4 19:05:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03B2C14C0 for ; Thu, 4 Jul 2019 19:06:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E876128A78 for ; Thu, 4 Jul 2019 19:06:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC8DB28A7E; Thu, 4 Jul 2019 19:06:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B29E528A78 for ; Thu, 4 Jul 2019 19:06:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4576E3C9; Thu, 4 Jul 2019 19:06:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680055.outbound.protection.outlook.com [40.107.68.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04AEA6E3C7; Thu, 4 Jul 2019 19:06:30 +0000 (UTC) Received: from BN8PR12CA0009.namprd12.prod.outlook.com (2603:10b6:408:60::22) by CY4PR12MB1191.namprd12.prod.outlook.com (2603:10b6:903:44::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:29 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN8PR12CA0009.outlook.office365.com (2603:10b6:408:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17 via Frontend Transport; Thu, 4 Jul 2019 19:06:28 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:27 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:22 -0500 From: To: , Subject: [PATCH 05/10] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent Date: Thu, 4 Jul 2019 15:05:14 -0400 Message-ID: <20190704190519.29525-6-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(376002)(136003)(39860400002)(2980300002)(428003)(189003)(199004)(50226002)(446003)(2876002)(2616005)(426003)(11346002)(51416003)(86362001)(1076003)(476003)(186003)(81156014)(49486002)(14444005)(8936002)(8676002)(76176011)(50466002)(6666004)(81166006)(305945005)(356004)(77096007)(5024004)(336012)(26005)(2870700001)(70206006)(48376002)(5660300002)(316002)(36756003)(4326008)(47776003)(2906002)(68736007)(70586007)(486006)(53936002)(54906003)(110136005)(126002)(72206003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1191; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 106e3f1d-e4c9-458b-6d1a-08d700b2b772 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:CY4PR12MB1191; X-MS-TrafficTypeDiagnostic: CY4PR12MB1191: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ihkacEUJIJaFxaV9wpVH+LNs2msrm0noz7n1RiXlGJFXpHwi+gG1lZsYkstplYwK041oB2VEswxaAT64kni4nye2LN0Y5PKAsYSZBLhTV/FhoXqPziYmfe4hdRcdQLrCztFwv8buGGFbmQRpW04IPXa2h9b1z+am16+l9NNNiWpEwt69WTJ0JNMsnywr5uVyS97X9iICaqmUsCifGQ83sTSfJH0ipzD3TleKQyFwvEoHMkYFQDx4aRkkVAy8rXNr5j2SnNJ1X2p6U1eGtjhW6O5b/Sn29FElKZA3g5qV7J/zTowFWXdaQja2OBLkvSAUzW0UzbwGiCf9HI8/zCrNHpPHiv3ww9sqC6ORFHZ5koAWd5x45TQjwiWO3tZOgJgM2X5DhxVYwZtlOjQEO+G/ECNC5n61gBfekgYNymCaq90= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:27.4432 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 106e3f1d-e4c9-458b-6d1a-08d700b2b772 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1191 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d+1U3k9GYsWrEV/m0WSElHM9u8VbSWfg9n36hVgrw/U=; b=IBJd3ntV5f/fDAs2iGaqvPM4v6s8OpzEwPCbLxlc2Kn5yJaPbDy99JD8isZA9KvRcySL0RLB0XCn0P9BbxB+1/XEpv+3gSCNMUTRQ95LgQHX6jA9MlFdjzbQ4jVBBUBBVcGfavLO1MNjkrie83ZEHCZKESQ4Xlezd6gN1Sci9Hs= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Enric Balletbo i Serra , Nicolas Boichat Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li 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 Cc: Nicolas Boichat Signed-off-by: Leo Li --- 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 3c7cc5af735c..c2800cd3e2ee 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -1008,17 +1008,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); @@ -1038,6 +1027,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) {