From patchwork Wed Dec 2 11:57:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 7745331 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DDF38BEEE1 for ; Wed, 2 Dec 2015 11:58:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A06020483 for ; Wed, 2 Dec 2015 11:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B3642063B for ; Wed, 2 Dec 2015 11:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757998AbbLBL56 (ORCPT ); Wed, 2 Dec 2015 06:57:58 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:55411 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757996AbbLBL54 (ORCPT ); Wed, 2 Dec 2015 06:57:56 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYQ031VFBWIZGC0@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 02 Dec 2015 20:57:54 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 87.FD.04949.2CCDE565; Wed, 2 Dec 2015 20:57:54 +0900 (KST) X-AuditID: cbfee68d-f79646d000001355-ba-565edcc20b35 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id B3.2F.13906.1CCDE565; Wed, 2 Dec 2015 20:57:54 +0900 (KST) Received: from localhost.localdomain ([10.113.62.206]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYQ00JKCBWH9VA0@mmp2.samsung.com>; Wed, 02 Dec 2015 20:57:53 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, javier@osg.samsung.com, Inki Dae Subject: [PATCH v2 1/2] drm/exynos: dp: add of_graph dt binding support for panel Date: Wed, 02 Dec 2015 20:57:51 +0900 Message-id: <1449057472-4389-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJLMWRmVeSWpSXmKPExsWyRsSkUPfQnbgwg75VXBa9504yWVz5+p7N YtL9CSwWb96uYbKYcX4fkwOrx/ZvD1g97ncfZ/LY0n+X3aNvyypGj8+b5AJYo7hsUlJzMstS i/TtErgyDm++wVzwSKDi1eP9bA2MD3m7GDk5JARMJM6vPcMEYYtJXLi3nq2LkYtDSGAFo8Tx m4+YYIoeHDsNlZjFKLH40Ux2COcHo0T3gV+MIFVsAqoSE1fcZwOxRQSUJf5OXAUWZxYokliy /wQziC0sECyxafkTsBoWoPq767ezg9i8As4SU9/9YIHYJidx8thkVgj7PZvElCuWEPUCEt8m HwKq4QCKy0psOsAMUSIpcXDFDZYJjIILGBlWMYqmFiQXFCelFxnqFSfmFpfmpesl5+duYgSG 6Ol/z3p3MN4+YH2IUYCDUYmHdwVPXJgQa2JZcWXuIUZToA0TmaVEk/OBkZBXEm9obGZkYWpi amxkbmmmJM6rKPUzWEggPbEkNTs1tSC1KL6oNCe1+BAjEwenVAOjSJE/r6FANyun3+L/dsc3 nGC+UffAOWunwdqHa4+2MPgeueW0+eCDm9Ji2f+4Pk1ddqeMo+LnbbuXRx5e+Ltqyp+3az2l f5QsPHulMdrp3gyb0q2h974kBwoXfXOOU579pGXzV6VcjTUBjNvCndOfv+nTC75mOuv232NZ sy+JG/7fn3BI4Fe3vBJLcUaioRZzUXEiAA1UQYlMAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnkeLIzCtJLcpLzFFi42I5/e+xoO6hO3FhBt/esFj0njvJZHHl63s2 i0n3J7BYvHm7hslixvl9TA6sHtu/PWD1uN99nMljS/9ddo++LasYPT5vkgtgjWpgtMlITUxJ LVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLxCdB1y8wB2q6kUJaYUwoUCkgs LlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzDi8+QZzwSOBileP97M1MD7k7WLk5JAQMJF4 cOw0G4QtJnHh3nogm4tDSGAWo8TiRzPZIZwfjBLdB34xglSxCahKTFxxH6xDREBZ4u/EVWBx ZoEiiSX7TzCD2MICwRKblj8Bq2EBqr+7fjs7iM0r4Cwx9d0PFohtchInj01mncDIvYCRYRWj RGpBckFxUnquYV5quV5xYm5xaV66XnJ+7iZGcCQ8k9rBeHCX+yFGAQ5GJR7eFTxxYUKsiWXF lbmHGCU4mJVEeL1kgEK8KYmVValF+fFFpTmpxYcYTYEOmMgsJZqcD4zSvJJ4Q2MTMyNLI3ND CyNjcyVx3tpLkWFCAumJJanZqakFqUUwfUwcnFINjMV8BXPuGf1UtP2p6GQzL9HXNfDYPInN qiplWe1CbAx3Khd/9deI/5vluo6NNdbQVdD34kcpsZSN5jy7OTtXX6uabjDpZ+zy1Uf0J1oa 7vYQP7qPy2mijNzFCN5XtZ5TecUnTvu2eqWc5jGjuwuyd93vWL/5/ObFufaVHdHh83bnfNza qHRgpRJLcUaioRZzUXEiAEKvlWWaAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds of_graph dt binding support for panel device and also keeps the backward compatibility. i.e., The dts file for Exynos5800 based peach pi board has a panel property so we need to keep the backward compatibility. Changelog v2: - return -EINVAL if getting a port node failed. Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_dp_core.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 94f02a0..0b53045 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -1392,7 +1392,7 @@ static const struct component_ops exynos_dp_ops = { static int exynos_dp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *panel_node, *bridge_node, *endpoint; + struct device_node *panel_node = NULL, *bridge_node, *endpoint = NULL; struct exynos_dp_device *dp; int ret; @@ -1403,15 +1403,32 @@ static int exynos_dp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dp); + /* This is for the backward compatibility. */ panel_node = of_parse_phandle(dev->of_node, "panel", 0); if (panel_node) { dp->panel = of_drm_find_panel(panel_node); of_node_put(panel_node); if (!dp->panel) return -EPROBE_DEFER; + } else { + endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + if (endpoint) { + panel_node = of_graph_get_remote_port_parent(endpoint); + if (panel_node) { + dp->panel = of_drm_find_panel(panel_node); + of_node_put(panel_node); + if (!dp->panel) + return -EPROBE_DEFER; + } else { + DRM_ERROR("no port node for panel device.\n"); + return -EINVAL; + } + } } - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + panel_node = !endpoint ? NULL : panel_node; + + endpoint = of_graph_get_next_endpoint(dev->of_node, panel_node); if (endpoint) { bridge_node = of_graph_get_remote_port_parent(endpoint); if (bridge_node) {