From patchwork Thu Dec 3 09:30:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 7757661 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 EDD62BEEE1 for ; Thu, 3 Dec 2015 09:30:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B64E20502 for ; Thu, 3 Dec 2015 09:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4DDFF204D8 for ; Thu, 3 Dec 2015 09:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932589AbbLCJad (ORCPT ); Thu, 3 Dec 2015 04:30:33 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:58388 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932593AbbLCJaa (ORCPT ); Thu, 3 Dec 2015 04:30:30 -0500 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYR00V20ZQC5000@mailout3.samsung.com>; Thu, 03 Dec 2015 18:30:12 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.114]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 8F.29.04964.4AB00665; Thu, 3 Dec 2015 18:30:12 +0900 (KST) X-AuditID: cbfee68f-f793a6d000001364-e4-56600ba42e7c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id DC.46.09068.3AB00665; Thu, 3 Dec 2015 18:30:12 +0900 (KST) Received: from localhost.localdomain ([10.113.62.206]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYR00HDVZQB3Q20@mmp1.samsung.com>; Thu, 03 Dec 2015 18:30:11 +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, kgene.kim@samsung.com, k.kozlowski@samsung.com, javier@osg.samsung.com, Inki Dae Subject: [PATCH v3 1/3] drm/exynos: dp: add of_graph dt binding support for panel Date: Thu, 03 Dec 2015 18:30:08 +0900 Message-id: <1449135010-8111-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1449135010-8111-1-git-send-email-inki.dae@samsung.com> References: <1449135010-8111-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42JZI2JSpLuEOyHMYMNUHovecyeZLOYfOcdq ceXrezaL/jcLWS3OvVrJaDHp/gQWizdv1zBZvH5haNG74CqbxYzz+5gsll6/yGQxYfpaFovW vUfYHXg91sxbw+hxua+XyWPl8i9sHptWdbJ5bP/2gNXjfvdxJo8t/XfZPfq2rGL0+LxJLoAz issmJTUnsyy1SN8ugSvjY+sMxoJeoYqbR/vYGxjv8XUxcnBICJhI9D9O6mLkBDLFJC7cW8/W xcjFISSwglHi6qo9zBAJE4llv04zQSSWMkpsuz+VFcL5wSjx//BnJpAqNgFViYkr7rOB2CIC yhJ/J65iBCliFtjOJLFh7h5GkISwQLDE1sb/YDYLUMPW3lVgzbwCzhKT7h2HWicncfLYZFYQ m1PARWL1v59gNUJANT+XtYINlRB4xC4xaeVyqEECEt8mH2KB+EdWYtMBqDmSEgdX3GCZwCi8 gJFhFaN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SE8sSc1OTS1ILYLp Y+LglGpgZNNWK1ZdOD8ivu32Q+fCd19uZ1Y8EFl4bCbn2u05r7myQtetCSs6f7o69pPxurp9 LSeyOCY1Zfl/58nOUds/ga2JoVCUuWra6UkiaQxcJ+dsszf3SNNwcuy1K/Q6yLIgIuF2aIHg Esm5rw5WiFpPUFd6ceJCFM+t44dFX5o2Gb/W5HxsIaGuxFKckWioxVxUnAgASd5xEO4CAAA= 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 Tested-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);