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: 7706491 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 1A434BF90C for ; Thu, 26 Nov 2015 12:47:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A578820760 for ; Thu, 26 Nov 2015 12:47:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80B3E206D8 for ; Thu, 26 Nov 2015 12:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751014AbbKZMrZ (ORCPT ); Thu, 26 Nov 2015 07:47:25 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:59997 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbbKZMrY (ORCPT ); Thu, 26 Nov 2015 07:47:24 -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 <0NYF00R1FA6YHH40@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.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 Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, javier@osg.samsung.com, Inki Dae 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 yMTBKdXAWODBpf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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=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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) {