From patchwork Thu May 16 15:18:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10946815 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 9665B112C for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86B4B28821 for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AEFF28B6D; Thu, 16 May 2019 15:27:08 +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 0A36728821 for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0882A897B5; Thu, 16 May 2019 15:27:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710063.outbound.protection.outlook.com [40.107.71.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 720CF8979D; Thu, 16 May 2019 15:27:00 +0000 (UTC) Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by CY4PR1201MB0056.namprd12.prod.outlook.com (2603:10b6:910:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Thu, 16 May 2019 15:26:59 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:58 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:58 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:54 -0500 From: To: , Subject: [PATCH 6/7] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent Date: Thu, 16 May 2019 11:18:02 -0400 Message-ID: <1558019883-12397-7-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(376002)(39860400002)(346002)(136003)(396003)(2980300002)(428003)(189003)(199004)(53936002)(6666004)(126002)(54906003)(11346002)(70206006)(486006)(446003)(110136005)(86152003)(476003)(8676002)(2616005)(70586007)(53416004)(336012)(86362001)(5660300002)(426003)(50466002)(2876002)(356004)(2906002)(26005)(50226002)(5024004)(14444005)(7696005)(76176011)(8936002)(36756003)(51416003)(16586007)(77096007)(81166006)(186003)(316002)(68736007)(4326008)(48376002)(478600001)(47776003)(72206003)(305945005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0056; 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: c63b203a-e209-43af-f641-08d6da12efb6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:CY4PR1201MB0056; X-MS-TrafficTypeDiagnostic: CY4PR1201MB0056: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: bGNP/Y24zC9/iGmc3EGN+urS6oaqfQaGM+MdphrlIMOX/oeYbmte5B+X261wtb6OYu9uHyzge4EqkEZUumi7j4kJpcEplwB/J7GPmd84P9DpbVwP7Fzeo6XZyWd6B9R5GKnz/u6Uytmkh8srnZCm5WxKuA7RcCg7lsvwYzbkt5zq8hzlfNrm5si1WKWJy8okPxF6oQ/p1iDpe3ZlcS2fz6YrhDPe52zZhCTHjyICm68uuOOPIMzmrGm4PD89axBBdaX5bhiqtaLoaD41js1PSojh54QreoW9xMfJzThjjQf1nkaXw9EDUeHWepUh5mjdAQhHSV+3+PVCxlSlaHdJasXd0XO/CsQlnmkagB3f+Yo/U2Dd5/mli5FERGhLfPyqlDMnB/L0O93XVX31h7S9FPmw3XeDwwcG/LhERC17krc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:58.3964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c63b203a-e209-43af-f641-08d6da12efb6 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: CY4PR1201MB0056 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tZQfKr8LtoKi4xxeY8s7qTQKLwEeZSQ34NAZ3EqshaU=; b=AHX3OiOYmgl1EN0gqr3RI4qhP965KTPslPNZ5EVPgusU0WTnBUnjIrgn7mv7zBXagovXf908n3otDN1pVJWh8GVu7X4yz8bS1OeF9NBT0s+byapO4eIYiY3YR796SlKfVzw/J8BrRIBEV1UEtaHvbb2M2YcSZjiA+3DPb6kIu1w= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; collabora.com; dkim=none (message not signed) header.d=none; collabora.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 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) {