From patchwork Tue Jun 28 09:32:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 9202469 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 20CB16075F for ; Tue, 28 Jun 2016 10:05:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1077A28559 for ; Tue, 28 Jun 2016 10:05:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05517285E6; Tue, 28 Jun 2016 10:05:07 +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 9589B28559 for ; Tue, 28 Jun 2016 10:05:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 818246E545; Tue, 28 Jun 2016 10:04:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0074.outbound.protection.outlook.com [65.55.169.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2C2A6E537 for ; Tue, 28 Jun 2016 09:42:44 +0000 (UTC) Received: from BN3PR0301CA0046.namprd03.prod.outlook.com (10.160.152.142) by CY1PR0301MB0860.namprd03.prod.outlook.com (10.160.163.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Tue, 28 Jun 2016 09:42:42 +0000 Received: from BL2FFO11FD028.protection.gbl (2a01:111:f400:7c09::159) by BN3PR0301CA0046.outlook.office365.com (2a01:111:e400:401e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 28 Jun 2016 09:42:43 +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=fail 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 BL2FFO11FD028.mail.protection.outlook.com (10.173.161.107) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 28 Jun 2016 09:42:41 +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 u5S9gbKo011754; Tue, 28 Jun 2016 02:42:38 -0700 From: Meng Yi To: Subject: [PATCH v2 1/2] drm/fsl-dcu: rework codes to support of_graph dt binding for panel Date: Tue, 28 Jun 2016 17:32:04 +0800 Message-ID: <1467106325-33861-1-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131115805620562355; (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)(199003)(189002)(68736007)(50986999)(50226002)(81156014)(305945005)(8676002)(4326007)(8936002)(8666005)(19580395003)(19580405001)(2906002)(81166006)(48376002)(189998001)(92566002)(106466001)(86362001)(77096005)(87936001)(105606002)(6806005)(50466002)(33646002)(5003940100001)(97736004)(229853001)(85426001)(356003)(110136002)(47776003)(2351001)(586003)(36756003)(5890100001)(7846002)(104016004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0860; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD028; 1:PdvbMU5kFmL2699nKWzIbk6S26359TAaHm9v0GCZh2ipA95VXGFh3hpxzvOCM5obHYN9ycqzzStdzFos9ovgAvgh74jBHZ73w9+3mHWDo88PkxgGjq2CyG1st40eWEef1tZnVc9KDKlrOTCOBNiC5ju5XQPmw0pm6urdvGsLoAY3X1+xWCIfDFy8VWWzFC1i6qyLduQKaiXLtF+x/Y2owdKYOnRjI1P2WEAWQBOWsy8CYCb2fEvLJ/ikJ7lYp8cUNggm/vtDMJmgfKE3iDW/bB90FxBdbIcWM59qHvvT5a3JdwB2G2+6gTlPYZTQbptFM74ms0mqQX9lJaTXpVLDIfBt9oa9t+X2aVLQVtkB/CzK+/4dP1HlToJXr4uBJZU5lOrEhCdid8vfMpjJQYLNXonl1SmUyQ3EivcabtnwE9knwxGQ3Lq7btK9NPqNO2KF+NGj+svxTciiHFN6U7Y+U3kEITtxtCT3bvSfDdSjEa4mOakrQKIW/+C3orBjpHyIJWNWnkCBw/KtX8KK1zKSVvHSy4jMMS4TXvJxEgd/jN5HabZAwDnoqATVLkMxKWbrWNQN/2cidUYs3uPZy8zZnFkzO7aUKl0YKPHSLJEtVwpILju2rkoa0UZleqzTb1Tyh5eWFXiY3+gX9HO7L09w+uR7ySxzyMgOG6BtT74XYKYjUnQT/LPnL4McM/dxxV5fRnm4DFX55auOwTeKY0msdCXdn7ZV9SZxsMkoYepzGO0= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2efa13e8-d995-4386-e9b3-08d39f388cea X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0860; 2:wVOQT1L+QrGY2mpVgJRpIk1mymRYzbWtl5JtuOnliHn/aAbvmX/qcCsdaCCtul1iK/UFnsU0+kHn+3kXQtrWn5leb7KY/3XhoXm9bg9aECNz9WWcVEbQEalSxXQo4MAieJxZn7De8TGK5QfN759Qb9Gdd5QIWMz1GdlP8bPcr84zcRruMqjExZZhcQkRIjWU; 3:l+pjUsVS+v/N2s9e5xN/cs2pobuiX9GleypQdwj/A7i6yo4vvK1pwP9yTpt2R+NaagQkWks9lxqkE96ii6o8I0frdM6hUti9KF0p6L05ZTN6gRuGhUdroh1ey+GJRmnUy8bETbCLgVUlntvFPrTWRpVCE4PfaWcMLi2mFom3IrIoriNqoQZRcKWtJ5j2wVNr+F3jnDvXmyzokXL3mUfGLqgiBHfAebGjZ7DzxBV0KhY=; 25:ciH7R75qbwySUsAWGiWrJ71XczBzqxoZfdXhwptA2SD2K/mOehXBKIJCS2KWIRP+JR0w3NEVJcrwdff0kRKE5E5kh59OypwjnQz7ygxYLKoIv0wXTAcoac1Y0dtMMxCQmAzYAbz2k4wBgm9cko0mFpo0HHQ41DLo/dhUmYeAdN9GfWt3FvlpsNS2ISD4cSyYi5qynD6bj7JtkqGzc364Ud/jh+bkN0UNxEbP8hP0MaYRJ2wl5m7ffezzL7cgBLetOqYh77jC6lLAdCBtfY+XAEGjyZm1fo3vFWqfBmYdhB/mDXWJcG32BKs++h1y73v2sHaK+hOjmDs0PXu/uvmKvQbMswTB8iL7WDaDmXpgfz7R6gZ4lde0nZ/XWdyiwcCBsMHY/k94vbzMDwEG8ejwup9edYBD/bkSOUnTtEEWxUw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0860; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(5005006)(8121501046)(13024025)(13018025)(13023025)(13015025)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB0860; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0860; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0860; 4:zffiUP41Oaotm9pkIn0k+7t73fnd7UEXeQ7UuDZx37ULxXQOe5r0Tt7C+XpSGZ3djIabdkuQtfSiZUKUt+NDYKoLcEKoVSfx1YcIv1jLQXEqWO+Pa8suszaMWnuZJ6/VQw8tHv9wgEWBdX5rsMuLD3SJbs0rhyUykgwPZ/1JJXaEcDqitvSKNB5wKUdGBX7SY3Wm9/6a5IXPlOfzObSaT20PmsJZTWurk9XQjkhYZicp5bFk+jmRjmqifhjMRfQY1zbUb618m0SxMXZ1h4fz9WrTYPRMZcmVl6l6xcCwxLhWrU1rmiSeW/Jp1YTBvHtU5BeJ6fTNQOP87ShZnxKGSbez0VXgiynM+kwy3AsRI2l8vfeEQmG01Epd3tpXUY1Qlybw7X6HWZqD/XBDiJy+lFlR2YBWAIZDeVhEtjtNOE7VTxs3UULJ2j4zUS8PhsNvFZHicT8ITawmPuNMm7gda0kjajbZNyzn5xMZ8PZ8sMGgCMrVbpOMbRMTAHxpNnCua7G4uwPdwBEaDf1ieq3fDw== X-Forefront-PRVS: 0987ACA2E2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0860; 23:pvx2AWnQ3YwNuS5+xcv0Km/0j2LOcytMtAqvsgw?= =?us-ascii?Q?WWB/nNpbL6q6ZSaAJcMcUrIYe3RYG1XP455qDhvO3FkljfZG04C0Ykk+cvf7?= =?us-ascii?Q?p2ckX80jannEChsUA2RK5C0Q93bufOkg5eKHt4N7SoxI0ZKU8MWqUTbdBD0z?= =?us-ascii?Q?FnbDEt5lB1Hggh28tfvUQjDG8GdN2ZMiIl4Tdz/2YO9AmlQqlhKHAS9MLdWJ?= =?us-ascii?Q?RU6d9TeWXA9on/HSoqU9CNwHym9owQ6oaShVXpe9BXzU9wmiUo+PvpBvJDTg?= =?us-ascii?Q?ygzBKZRa4kCUQQ3iPZANCZQHGB0ijm32zS96+toxerL84LSyOwcWT1DRNPBJ?= =?us-ascii?Q?VbSZg6wvo/OVV7S/mzR88IrcwCU3I6Z+3F4Ji1xIlVe9LMpiffGjoXyTYTXn?= =?us-ascii?Q?wSPGLo596V/MrcwW7pLkDA7+wVNWytRaOoLeNTRIT6jLJZFZLJijjVK+cZqA?= =?us-ascii?Q?PaM5DQVs8oJJ7DeglklGSL/dTn/mKECjRlOC0CQ/xnNE2QP4HMVVL+0sogcV?= =?us-ascii?Q?iTFxIAXvMvha6IgnZ7G8QRph7KXHf+sEF+6StZ6iwJp5b0TBbQ2kXJFedtC8?= =?us-ascii?Q?MZqaVk1pXNfV9KdsWFKf/sTOEkNjDtYYkdfkcQ7M3usZVXwlmZvMVvE0QirU?= =?us-ascii?Q?wNDckqFjTDxjme8dpFBXdLfxavwp85CWbijRo+lIl8u/lBvftOKSuwdMT3xP?= =?us-ascii?Q?H7pjfT39bD8Lkfa9Q1cct22Cifi78U7MTmUaaqyxvduGgj9Sr08YSnsTF3SF?= =?us-ascii?Q?/90Q+tbGwYXYvTMZFyiyZg9NWgHfPTzwCdgXEuCLU3K6pEMb251ij/aIwPaQ?= =?us-ascii?Q?JkUPQXWZ3BKCjlYMsHYNxH510noZibfvYREfGTOyfwp2K2VpXSVs/cISs83A?= =?us-ascii?Q?NlVlQyBJaUwCpaGeK+vO3mppGf5b0Z4i0zl1NLogRebaX6IypRk8CXQ9lWhb?= =?us-ascii?Q?nCmevu8giaxkE+Ogr1f6e1AMY0tzMETocvKgJGlt6FA/zumH6VV17QUfyS91?= =?us-ascii?Q?k8/5yD/HAQ2kK0Rfg44rLmEQSprkSyn0GVi8Pyw9zsHVEDMTHh928v3/douV?= =?us-ascii?Q?3haSAt4sKPkT2vPukr6MKYIfIAnwE05kP145g7r8tAsrJtGdHCw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0860; 6:f+w+5rhbsI4xKYzt/t/0L2OsrDBCpbC+NVnXI8ZxxHWAQneg+b/jdwYudRutzx0uFKSGh5DWo10xs5XSHVM/KGqInRq6yErr8ZzngZojwfWXPoflb+d/QDo9idnW3HVIAReMpU3Q5IwcddlDm8qHZmIImj1Qn9hoX3ndmnri5o9VRrTv2TMltar7lsHmgFl5fmJlCjGDlFks9N3T0bC2v5ffNuu4p3ORT9eEOt/S6/N2ym/LmaJTCE7ynlYQ4rb+6eQ9q3gI4/Gcax1fMpMBmoXK1ssGDnWRdRjxJja61wzpyTGRwTnTSwJmSdpLvZoq; 5:m8HvnTYcfMq1FmLL1+95Ck6cIPRI6XJq3wol2p/Kn57sinVG1WyAX5US/ov7URD9RD3rUxlhBhX2u9B0wDur/3XOgTsIn09ZMgVklgYagbTR7ygIacVbRZ3d6YmIBMKArbDOWeoRKgpBY7GKTMKwEIICtQawnhZb3cfZL+k8bIE=; 24:OFkeZjuXD3/rDD5fmhZ2IyJfkrKRavpHmuYoMCkoKdI/ECMTUWdW7enyj9UFPwMnJwdUBcMGrmgHRO5hQYvYpN4e4/A8FM2qDzLsRGoSrRA=; 7:6kasaZSfK9DrbXRls39KrtbKJevP5rmLo3Hoa9GRFSjfFYHH9OM2zAnCa3Exxdgv9bI1AMgFi45/bJLMuioUb7lHtcp1LeC/7EJZcnRifc9q55BbMt3rpd8JPh3suggD0oocn9kYwFv+IsmiLzu3MHN5HQwxJ0uz1H5sqsf0btefGqbHNVpmLd4pPsOw0T453p936JAwk84gDORJLanJm0xLs3vZvTE/ZgrVHmrmN9cLCReMcy0tSwcMMFGU9GwGIO4xYSRkUnExlEKt54T0pg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 09:42:41.8846 (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: CY1PR0301MB0860 X-Mailman-Approved-At: Tue, 28 Jun 2016 10:04: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 --- Changes in V2: -fix some coding style issue -add fsl_dev->connector.panel check -use fsl_dev->np and drop fsl_dev->dev->of_node -return 'ret' when fsl_dcu_attach_panel failed --- 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 | 79 ++++++++++++++++++++-------- 3 files changed, 60 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..b23cc58 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -10,6 +10,7 @@ */ #include +#include #include #include @@ -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,61 @@ 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 ret; + } + + 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; + + /* 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); + if (!fsl_dev->connector.panel) + return -EPROBE_DEFER; + ret = fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel); + if (ret) + return ret; + return 0; + } + + ep_node = of_graph_get_next_endpoint(fsl_dev->np, 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; +}