From patchwork Thu Nov 26 12:47:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 7706481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A90119F2E9 for ; Thu, 26 Nov 2015 12:47:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2F9E20720 for ; Thu, 26 Nov 2015 12:47:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A378320693 for ; Thu, 26 Nov 2015 12:47:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C4C06E072; Thu, 26 Nov 2015 04:47:25 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53C1A6E072 for ; Thu, 26 Nov 2015 04:47:24 -0800 (PST) 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 <0NYF00R1FA6YHH40@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 26 Nov 2015 21:47:22 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 83.1D.29987.A5FF6565; Thu, 26 Nov 2015 21:47:22 +0900 (KST) X-AuditID: cbfee68d-f79286d000007523-4b-5656ff5a6a7c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 7A.3B.00996.A5FF6565; Thu, 26 Nov 2015 21:47:22 +0900 (KST) Received: from localhost.localdomain ([10.252.83.67]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYF00EHJA6XJCF0@mmp1.samsung.com>; Thu, 26 Nov 2015 21:47:22 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: dp: add of_graph dt binding support for panel Date: Thu, 26 Nov 2015 21:47:19 +0900 Message-id: <1448542040-22057-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1448542040-22057-1-git-send-email-inki.dae@samsung.com> References: <1448542040-22057-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsWyRsSkRDfqf1iYwfzP/Ba9504yWVz5+p7N YtL9CSwWb96uYbKYcX4fkwOrx/ZvD1g97ncfZ/LY0n+X3aNvyypGj8+b5AJYo7hsUlJzMstS i/TtErgyJj1ezFowX6Dixcm7LA2Ma3m7GDk5JARMJE4s7mWCsMUkLtxbz9bFyMUhJLCCUWLV ym3MMEWz18xngUgsZZS4NeEdM4TznVHiw/qHjCBVbAKqEhNX3GcDsUUElCX+TlwFFmcWKJJY sv8E2CRhAT+Ju8u6wNaxANVf+nYVqIaDg1fAReL/LSuIZXISJ49NZgWxOQVcJX5+6QdrFQIq WX1sJjvIXgmBbnaJuwuuM0PMEZD4NvkQC8gcCQFZiU0HoI6WlDi44gbLBEbhBYwMqxhFUwuS C4qT0osM9YoTc4tL89L1kvNzNzECQ/r0v2e9OxhvH7A+xCjAwajEw1tgGxYmxJpYVlyZe4jR FGjDRGYp0eR8YOTklcQbGpsZWZiamBobmVuaKYnzKkr9DBYSSE8sSc1OTS1ILYovKs1JLT7E yMTBKdXAWODBpfylZvF3Bp6othUrnj9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000000000000000@CPGS X-CFilter-Loop: Reflected Cc: javier@osg.samsung.com, linux-samsung-soc@vger.kernel.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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. 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 -ENXIO; + } + } } - 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) {