From patchwork Mon Dec 7 12:52:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 7783411 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 998D8BEEE1 for ; Mon, 7 Dec 2015 12:52:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E36FD204CF for ; Mon, 7 Dec 2015 12:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC01E20527 for ; Mon, 7 Dec 2015 12:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753374AbbLGMwo (ORCPT ); Mon, 7 Dec 2015 07:52:44 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:57732 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbbLGMwm (ORCPT ); Mon, 7 Dec 2015 07:52:42 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYZ010GJNRSF230@mailout4.samsung.com>; Mon, 07 Dec 2015 21:52:40 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.115]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id D8.80.04790.81185665; Mon, 7 Dec 2015 21:52:40 +0900 (KST) X-AuditID: cbfee691-f79766d0000012b6-1c-566581182d43 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 62.00.09068.81185665; Mon, 7 Dec 2015 21:52:40 +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 <0NYZ00JAQNRRRP40@mmp2.samsung.com>; Mon, 07 Dec 2015 21:52:40 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, devicetree@vger.kernel.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linux-samsung-soc@vger.kernel.org, javier@osg.samsung.com, kgene.kim@samsung.com, k.kozlowski@samsung.com, Inki Dae Subject: [PATCH v3 1/4] drm/exynos: dp: add of_graph dt binding support for panel Date: Mon, 07 Dec 2015 21:52:35 +0900 Message-id: <1449492758-19989-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1449492758-19989-1-git-send-email-inki.dae@samsung.com> References: <1449492758-19989-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42JZI2JSrCvRmBpmsOawuEXvuZNMFvOPnGO1 uPL1PZtF/5uFrBbnXq1ktJh0fwKLxZu3a5gsXr8wtOhdcJXNYsb5fUwWS69fZLKYMH0ti0Xr 3iPsDrwea+atYfS43NfL5LFy+Rc2j02rOtk8tn97wOpxv/s4k8eW/rvsHn1bVjF6fN4kF8AZ xWWTkpqTWZZapG+XwJVxt92m4KxQRdu+F+wNjDP4uxg5OCQETCQOTKzsYuQEMsUkLtxbz9bF yMUhJLCCUeLIpTOMEAkTiUsnp7FDJGYxSnyZt5gRwvnBKHHsyAJmkCo2AVWJiSvus4HYIgLK En8nrgIrYhbYziSxuHExWEJYIFjiwY1/YGNZgBr+vNzEBGLzCrhIfNnUyAyxTk7i5LHJrCA2 p4CrRMv5R2C9QkA1O1q+gQ2VEHjJLtF4ZgM7xCABiW+TD7FA/CMrsekA1BxJiYMrbrBMYBRe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TOu+9SZJiQQHpiSWp2ampBahFM HxMHp1QD49K9jh/FbRp8WwNnLNrK5GuUpfZuyhIJA2GOj+KGpaVF9y4c38Kn5tz/a9/fNWkJ TxZqGnlcmxK4stFsrTn/Eq71PwV65x74HXthh0bH7/Mak91/VBzm2nhl98S66U4aBv8u/ZII 3fW+7w7jA3ftP0dWnK86UG5RKtJ8LG6nuh+Pcv7k1w3z3iqxFGckGmoxFxUnAgC9ISX+7QIA AA== 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 v3: - bind only one of two nodes outbound - panel or bridge. Changelog v2: - return -EINVAL if getting a port node failed. Signed-off-by: Inki Dae Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/exynos/exynos_dp_core.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 94f02a0..60260a0 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,14 +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; + } + } } + if (endpoint) + goto out; + endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); if (endpoint) { bridge_node = of_graph_get_remote_port_parent(endpoint); @@ -1423,6 +1441,7 @@ static int exynos_dp_probe(struct platform_device *pdev) return -EPROBE_DEFER; } +out: pm_runtime_enable(dev); ret = component_add(&pdev->dev, &exynos_dp_ops);