From patchwork Fri Jun 24 09:00:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 9199539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4795607D3 for ; Sun, 26 Jun 2016 15:27:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B50A82849E for ; Sun, 26 Jun 2016 15:27:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA12128544; Sun, 26 Jun 2016 15:27:52 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48C142849E for ; Sun, 26 Jun 2016 15:27:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68A9E6E1CF; Sun, 26 Jun 2016 15:27:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 918 seconds by postgrey-1.35 at gabe; Fri, 24 Jun 2016 09:26:44 UTC Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0075.outbound.protection.outlook.com [157.56.110.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBD566EA83 for ; Fri, 24 Jun 2016 09:26:44 +0000 (UTC) Received: from BN3PR0301CA0035.namprd03.prod.outlook.com (10.160.180.173) by CY1PR0301MB0603.namprd03.prod.outlook.com (10.160.142.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Fri, 24 Jun 2016 09:11:23 +0000 Received: from BN1AFFO11FD040.protection.gbl (2a01:111:f400:7c10::173) by BN3PR0301CA0035.outlook.office365.com (2a01:111:e400:4000::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Fri, 24 Jun 2016 09:11:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD040.mail.protection.outlook.com (10.58.52.251) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Fri, 24 Jun 2016 09:11:22 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u5O9BGmg005935; Fri, 24 Jun 2016 02:11:18 -0700 From: Meng Yi To: Subject: [PATCH 1/2] drm:fsl-dcu: rework codes to support of_graph dt binding for panel Date: Fri, 24 Jun 2016 17:00:44 +0800 Message-ID: <1466758845-30958-1-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131112330825990706; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(97736004)(110136002)(356003)(7846002)(189998001)(586003)(50226002)(8676002)(5890100001)(92566002)(47776003)(33646002)(229853001)(8666005)(305945005)(2351001)(81166006)(11100500001)(81156014)(5003940100001)(36756003)(106466001)(2906002)(77096005)(19580395003)(19580405001)(68736007)(85426001)(8936002)(4326007)(86362001)(87936001)(104016004)(48376002)(6806005)(50986999)(50466002)(105606002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0603; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD040; 1:8HOuMG2SYMKETxPpFei/0fp9MCrAxDovAbCfylrdkjlpOVV1Ve0IgG6ntjm9lHDdp/sLZCWf7LNHsjcehX3pMZ0cJFV2OhzRG+1RSrl7RYbODgkiz1LjvoaLAW8HlpzEE+TzyNxqYvngGfaqrseKyKBY6Wop1WKKmMs06UsIzV3srjw/SZvXYcuk+Ppiaw6xCF5yu8WqxjPL2IdSg1BmMsGqs5fZm/BzfkIYBgvH0HrwB3l1FqGR/yyxnubjU2ZUy30lOaXkDS7npw9lkWU3DwbKTW6Xphad09/84p9BW7+GnYrUq2r4MLawhTBIvCPbUDP9fYf8XptcfiEDZlUJiDF9a/rZQWCFdJH8Ebi4uQmPIJVpSKPcLGcey9OtJNdzuJ+FBF+YOPkMT9ojIvlqOHR+PrxSR6gmSe2HnHb4cEL5icIzsD3j8wm9eL4bOQcBThtZDI2fTASprtlnyHS/m9lIXjpTJJlqJGLXqIfTjnBhPlW3H1+3p5r/aT+RUbogCsaVEhiUgWUIFe5iwT2nRpq5iXqqNk35XKf78J6jKJTPCMPnqYCVGBV8uCbq+R/u7hcCEjxQ8bYPv4wWiRiM6YMAPisHQr1hcALhbcmALoyKrX2rCtFFpIxtFjfW4rxGxVDuef/7Jrv235GI8jXW9NleuTl6aCRJ/9PWjv0CFQ2w5CsTixB2KNqhxXug+Ekb MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 563f0881-42ed-4d77-20d1-08d39c0f8303 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0603; 2:+XEGxpw2L8BqqGJ+mjqr6WvHpEfRH4vwPBU7uyAAzTqnXRgDhdSprtsBFT+JyMXBc/J+wcMJbFU51kobvzTsV0zMlpJMTAYUQ+CFTWStYgqr/kJyiT1TQ5/+JlLelQjoLujeMM55lVBYZoDXJoYmyU2V1pf79UDNvjQZEDDFIlqjxf/syC54GQmX94DWvrFw; 3:cfIpgcvecQaScy0494pHAjh/G2XWKDOTfPTqAgfmEPvy4YttAqoST/tNA0kvbbzHSsVLooW1KtGWZmvFnfUhNl1ZDfdiqCa8OdWu9kEhvVLQnira3Zn20zyUVF3NMSZXarbpNf5F1vx7w8dvUQsFTm6fMS2cNJNqC6hxvanJ69i7IN6v4PMlakIU0oGgu00ufTM8UVDuMUVgdtYXNG/aWeUznFsC+x8pVkp2BN4BVHo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0603; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0603; 25:HLDXHowntuO4BfHRFB7rmESFNu1rKBcP7ZWJ6TMvNqCcYXsDVkSBVCZ94R9CUQnLnlrJIwmqJ+AgSRqrixmjod3/MpV3KaiAU6bw9JZWDlJmU89e8esxyOQsYTC4FoHirfxlFtyI3A0OWs4oEdzKDiFGKUqtFcTkFPXWDFCtJhPZNSKX30cuJwyzOh2olOfPRTp+F+SgXvkYVIMPPMgtXBpN2FYibAzt1/r1S4dYZ/3MkPt1wwsVwwJFqEfoCszz79/WQeRoXb9kQ8+0vNDlz4xafNGA1VOvk7KZPIt07niE3XB/a150Xky+ik2c5c4UlrFg/8s8QM6OG9ByCnc896u15DYJ8kXvdumipIW1yMrJjW3u2dKXZkBg2Qrn5bwZdUWVUg9Nue3RUmGECdOOliEWnCjbqSK/8kRAZOpqqncH/37s7RzKQ2FVJMDM86iou6851VoQA++h3fSDieNnG3GIIKnDXzGSgpcdP30xf9nh0nbv3iHcXA84eqB1eXtvBfloBAa+PLdd1VSi8JyLd8su6ePThCBAEEVNtoc+nUrUNpGybDrdA0aC56KpunVEIZZMt6ht9Ydr75s+bgvzoQb/VT767vf0jH0L2Mw2aTc5ll9vrmfo9GGPfdBv/jggkHhg6+nDfqtH+jEbVF4GEZYgiYjDyl0Euxv3ILPK6ofD7/5JIqIeVZZ6x82UsYpbL7S50w7QRthyRi7CdWsLC8Ba4xuOiF5WlrWJ3KMuDnow/QiPoJKRwfJ9ASG8DqHh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB0603; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0603; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0603; 4:fCZcO1JGTnoejr8S7Nra74+ftcOGX45cZ84R8gy62WQt1x+wZtQFpScQ+TEJSEuzA+SnfuJhQDmJCvSqmOnjpk4I5jJADdFbZ++xF3DLYuS2r9DXakfLwJvwTzwzXiOQcmpfOhTcH+9sf4LOJ6Iblnl/VY9nuDhm3BMjLhg+VUxxB1GSYDS+6/dqg5+CMu19e84zmQsU8tn8kWBO5z5SK19iY4WUKA56bDPBI8730cxE40ivWIRe88T7SnahkwVBDEiQk5JeO8bsqq0EEdbJewfD5iCbHF+uV72sRKbebU2aLUTEYfz6OiPAhRlY0iNEGSEYyRBzKzftkSz2bHWAwr2qDO03b52cPJPd+rrz8pGNhapASL310FI4yHLGwS954JVnHln+2BatgHsj51pqrwTWabMqdTQla0bbaKJt/+lpOmkayVt0n3hy9IGUq1+oVE85MPPInyW+DUBbLGxW7QNADp7pyFoQNK77utYGr9C7Vhc8OS6r4/VgYyhKIdEG5yqE9AaPbHXOk3Tf5F0rdA== X-Forefront-PRVS: 0983EAD6B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0603; 23:5O7AwBqrMzkh6Vy8cEsP4IwBUl/8YRUe6osOyLH?= =?us-ascii?Q?297SanuADKLmDTDVi788FgIk45oxd2xyQQqabrsnPzz9kDOlXY/3UI/iCkw7?= =?us-ascii?Q?hbcaSUETuQVv88j84oGIa+ndwB0xiq9eIk0VJILWr966xqKsAW4ep9NHws04?= =?us-ascii?Q?fos7pk9E5JC7dAEUNroR4eEqZjgPKj0Ufjgo8QCvvLQ5/d6IYZKRb1p06DFr?= =?us-ascii?Q?FImk1RXm4glr+NbF4QHe74SAd8Y4TamBcGKKHTqB1OVm78MNMYzCDr1eSRT2?= =?us-ascii?Q?jCVT7T73nibXPAd1UxNc987q0/DXONCv8z6U9PHJZ/ZwjwAexpC54Ur7EVNb?= =?us-ascii?Q?yR3np5zR/KUWcAvly9VzSXaB9ALQImQwRmL/NUbMFGxsc5PpUW/ayw/knrgX?= =?us-ascii?Q?ljo/WK/wHunJUY+ijdARyAkq8tDZ7ORG/tomyphKGePtMRd2+8Ic2XlKCArZ?= =?us-ascii?Q?ZEthHW4HixM+9iU8MbsH9vdvIJHiRZQWO/HLmYmTSkabUDqmDqBaA07LHTbM?= =?us-ascii?Q?Jpo9/ZjloAPeJTppprZRaZ5X7iO//OSq6uO+W/GqNUKw/CrlfTnN6os+fMdW?= =?us-ascii?Q?o/ADh0Y0caPPPuzQjZgnCwnFNeQLsKl+IJUQiZocj1qlbAiGiiwRy6elROdj?= =?us-ascii?Q?I10VgzvI06KKL+EeEKXyrfQSB9wz4fFdcqfTFBk/DL/SDqUMmDzQhtWpLY5l?= =?us-ascii?Q?A27f7Wo+/u/wTFTDXlgWUeyrsPhRNonQpWREBzxVNSUVCuFTw8NhC0DthEyE?= =?us-ascii?Q?7inftIOEh0r/T/4vpu7rfBZugzYLBWrJRkhsSt4I5/iJkormxBvY4XLZc8rX?= =?us-ascii?Q?mMclRxxAuobP5zwYCE9N/R0WU9k3h/SKJtSXbxxjaEt2ZeOidTH0YcseKjbw?= =?us-ascii?Q?NrTi3yyCmYzFcib1neJtKyS/M5wIxZg+ql7cAa9IWFXQfgZACj6WGAbRM6BM?= =?us-ascii?Q?h5iDriz1qCw5G13mNXEnx2rgUXRgF5WGNoAaxWXvo07CgxWlfkP0O2dstSB/?= =?us-ascii?Q?GTuOOno5fMj4ItTYdGtwVP5Ujbm8hmg4w27znx1b/gEw0AaxVay7+FS9cfNB?= =?us-ascii?Q?4CZ3MscdQ1Lzkz2rRYU8Mh3ffliMwuNqIN4xduX8BmnELA3JNW/jcp+sLmI0?= =?us-ascii?Q?ZcQsc1Gu+94wdbueo+MoTWmOcsWZ7pg4/?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0603; 6:UZ7Q/SS7mddI+rx7gAHEVRHWho/p6WEIIioKJdOKjgAxcZ1yOBRxT8UMfeBJlNWjn+utfGOmsZUHBfY9E1Rxz8rqcy5m0fFbSpfF2mYOWZcl1VH0fudxIvmgzVaNfVTjko1djY73bC+gl8pfv0tEmW+vFrIti8TpKrgHzzNzpTx2Cdld6zFyiaWzB2w728VeT7mEJ7P5urF8v66/7+af5LXTe8PgOmpv4quTFLiSLT4SSUqrG7blKhgJO1tGs1eKFzK/JWvMztb0EJEB3T7gO25r3THVGkfWpfjc5X8GXpUo039ZcySXLKvuPR7ikGDv; 5:HHi1evXK/1vYg8VWPIjibPivgh81djMGf3Y+vOy6SFxBJdPO8iMcKYh9H1mWsn7y4jaI8XQEbqD7tL40zgU/61elgyQ7s+jUVaQLNjuoFn87WEDEIfqcaCjXHfxKZwBzSDdfc97vn9XK2Bo3xZfrnw9QEau+pJxaHUm9ifcVAVo=; 24:z77A26/iVPiBBw2LhiiRydkhwEc/T1mNiEqNVSvHxoWPW52J6+tibRjw9dHq4AYL9m1q0ZHHS4rI3x3swd/9zKHV/qaA7+0jY/7lXr2E4Cs=; 7:j1o2Oxh10q3doIRPbbGSTLNszYKwCKJJ0DQBHk8VG4xwpozfoBZgzNBY2RfmJVaog85uljrqxYwRHKBxxHxRkSJW4fNe4jThFg8PBE9YpZuaSTGGhbx5PjKomiHh535m2cR9Na3fN34FSZp2Izzd73pErciGJtPVJgL6aF9MSjgoVLC55sMwGoFYKBeNnAu8KvgUjq9ZZ6TdVxwoFWZS5gK2MvTgbJodZ9rfXSlT4ZKSYUNvFCqqTwaA3Rw+sOgWQ8G8RQe1aiAxBL7kM4drDA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 09:11:22.4118 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0603 X-Mailman-Approved-At: Sun, 26 Jun 2016 15:26:56 +0000 Cc: jianwei.wang.chn@gmail.com, Meng Yi , emil.l.velikov@gmail.com, dri-devel@lists.freedesktop.org, alexander.stein@systec-electronic.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch rework the output code to add of_graph dt binding support for panel device and also keeps the backward compatibility Signed-off-by: Meng Yi --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h | 3 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 76 ++++++++++++++++++++-------- 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c index c564ec6..b48ffa7 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c @@ -43,7 +43,7 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev) if (ret) goto fail_encoder; - ret = fsl_dcu_drm_connector_create(fsl_dev, &fsl_dev->encoder); + ret = fsl_dcu_create_outputs(fsl_dev); if (ret) goto fail_connector; diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h index 7093109..5a7b88e 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h @@ -25,9 +25,8 @@ to_fsl_dcu_connector(struct drm_connector *con) : NULL; } -int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, - struct drm_encoder *encoder); int fsl_dcu_drm_encoder_create(struct fsl_dcu_drm_device *fsl_dev, struct drm_crtc *crtc); +int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev); #endif /* __FSL_DCU_DRM_CONNECTOR_H__ */ diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c index 98c998d..57a030b 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "fsl_dcu_drm_drv.h" #include "fsl_tcon.h" @@ -141,15 +142,15 @@ static const struct drm_connector_helper_funcs connector_helper_funcs = { .mode_valid = fsl_dcu_drm_connector_mode_valid, }; -int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, - struct drm_encoder *encoder) +static int fsl_dcu_attach_panel(struct fsl_dcu_drm_device *fsl_dev, + struct drm_panel *panel) { + struct drm_encoder *encoder = &fsl_dev->encoder; struct drm_connector *connector = &fsl_dev->connector.base; struct drm_mode_config *mode_config = &fsl_dev->drm->mode_config; - struct device_node *panel_node; int ret; - fsl_dev->connector.encoder = encoder; + fsl_dev->connector.encoder = &fsl_dev->encoder; ret = drm_connector_init(fsl_dev->drm, connector, &fsl_dcu_drm_connector_funcs, @@ -170,21 +171,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, mode_config->dpms_property, DRM_MODE_DPMS_OFF); - panel_node = of_parse_phandle(fsl_dev->np, "fsl,panel", 0); - if (!panel_node) { - dev_err(fsl_dev->dev, "fsl,panel property not found\n"); - ret = -ENODEV; - goto err_sysfs; - } - - fsl_dev->connector.panel = of_drm_find_panel(panel_node); - if (!fsl_dev->connector.panel) { - ret = -EPROBE_DEFER; - goto err_panel; - } - of_node_put(panel_node); - - ret = drm_panel_attach(fsl_dev->connector.panel, connector); + ret = drm_panel_attach(panel, connector); if (ret) { dev_err(fsl_dev->dev, "failed to attach panel\n"); goto err_sysfs; @@ -192,11 +179,58 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, return 0; -err_panel: - of_node_put(panel_node); err_sysfs: drm_connector_unregister(connector); err_cleanup: drm_connector_cleanup(connector); return ret; } + +static int fsl_dcu_attach_endpoint(struct fsl_dcu_drm_device *fsl_dev, + const struct of_endpoint *ep) +{ + struct device_node *np; + int ret; + + np = of_graph_get_remote_port_parent(ep->local_node); + + fsl_dev->connector.panel = of_drm_find_panel(np); + if (fsl_dev->connector.panel) { + of_node_put(np); + ret = fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel); + if (ret) + return -EPROBE_DEFER; + } + + return 0; +} + +int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev) +{ + struct of_endpoint ep; + struct device_node *ep_node, *panel_node; + int ret; + struct device_node *parent = fsl_dev->dev->of_node; + + /*This is for the backward compatibility*/ + panel_node = of_parse_phandle(fsl_dev->np, "fsl,panel", 0); + if (panel_node) { + fsl_dev->connector.panel = of_drm_find_panel(panel_node); + of_node_put(panel_node); + fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel); + return 0; + } + + ep_node = of_graph_get_next_endpoint(parent, NULL); + if (!ep_node) + return -ENODEV; + + ret = of_graph_parse_endpoint(ep_node, &ep); + if (ret) { + of_node_put(ep_node); + return -ENODEV; + } + fsl_dcu_attach_endpoint(fsl_dev, &ep); + + return 0; +}