From patchwork Thu Jun 5 19:10:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 4309311 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88D209F68F for ; Fri, 6 Jun 2014 00:33:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89DE320295 for ; Fri, 6 Jun 2014 00:33:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 824FD20265 for ; Fri, 6 Jun 2014 00:33:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B900B6E9ED; Thu, 5 Jun 2014 17:32:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 251156E9BE for ; Thu, 5 Jun 2014 12:12:49 -0700 (PDT) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6P00461MPCUC40@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 06 Jun 2014 04:12:48 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 76.70.16580.031C0935; Fri, 06 Jun 2014 04:12:48 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-6f-5390c1300263 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BB.67.07139.031C0935; Fri, 06 Jun 2014 04:12:48 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N6P00FLRMOSKS30@mmp2.samsung.com>; Fri, 06 Jun 2014 04:12:48 +0900 (KST) From: Ajay Kumar To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH V3 6/8] drm/exynos: dp: Modify driver to support bridge chaining Date: Fri, 06 Jun 2014 00:40:50 +0530 Message-id: <1401995452-15798-7-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1401995452-15798-1-git-send-email-ajaykumar.rs@samsung.com> References: <1401995452-15798-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSq2twcEKwweEfYhYH3h9ksdjwZiGz xcKHd5ktrnx9z2Yx6f4EFovLCy+xWnzf9YXdYsb5fUwWqw5vYLd4vvAHs8Xcg7kWP3fNY3Hg 8dj7bQGLx85Zd9k9Fmwq9bjffZzJo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDK+n3nHVPBW o6JxVkED4zvFLkZODgkBE4mr878zQ9hiEhfurWfrYuTiEBJYyihxfd1lFpiifcenMEMkpjNK LP+1jg0kISQwgUni7G9pEJtNQFti2/SbYA0iAm4STYdnsoI0MAt8Y5T4c/4+UAMHh7BAgMT/ pwogJouAqsSmeQYg5bwCHhJXL81lBAlLCChIzJlkAxLmFPCU2Lt3GgvEJg+JZRPPgd0mIXCK XeLA9BdMIAkWAQGJb5MPsUD0ykpsOgD1i6TEwRU3WCYwCi9gZFjFKJpakFxQnJReZKpXnJhb XJqXrpecn7uJERgZp/89m7iD8f4B60OMyUDjJjJLiSbnA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1 X0qKojWjt3T3q3rfbZj1fFbw9RvPKzMnWe3xOrKc96Eg39WXxw9Wr7klLfFqTdC+Ryqc7xft 3FD0sThunuZFkdi8i4GNSizFGYmGWsxFxYkAa4KXUf8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 05 Jun 2014 17:32:52 -0700 Cc: seanpaul@google.com, daniel.vetter@ffwll.ch, joshi@samsung.com, ajaynumb@gmail.com, prashanth.g@samsung.com, Ajay Kumar X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.8 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 exynos_dp supports a simple bridge chain with ptn3460 bridge and an LVDS panel attached to it. This patch creates the bridge chain with ptn3460 as the head of the list and panel_binder being the tail. Also, DERER_PROBE for exynos_dp is tested with this patch. Signed-off-by: Ajay Kumar --- .../devicetree/bindings/video/exynos_dp.txt | 2 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_dp_core.c | 39 +++++++++++++++----- drivers/gpu/drm/exynos/exynos_dp_core.h | 1 + 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt index 53dbccf..0c118ff 100644 --- a/Documentation/devicetree/bindings/video/exynos_dp.txt +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt @@ -51,6 +51,8 @@ Required properties for dp-controller: LANE_COUNT1 = 1, LANE_COUNT2 = 2, LANE_COUNT4 = 4 - display-timings: timings for the connected panel as described by Documentation/devicetree/bindings/video/display-timing.txt + -edp-panel: + phandle for the drm_panel node required by panel_binder. Optional properties for dp-controller: -interlaced: diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 178d2a9..fd1c070 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -52,6 +52,7 @@ config DRM_EXYNOS_DP bool "EXYNOS DRM DP driver support" depends on DRM_EXYNOS_FIMD && ARCH_EXYNOS && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) default DRM_EXYNOS + select DRM_PANEL help This enables support for DP device. diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 414f5e5..a608f5c 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include "exynos_drm_drv.h" #include "exynos_dp_core.h" @@ -983,7 +985,7 @@ static int exynos_drm_attach_lcd_bridge(struct exynos_dp_device *dp, struct drm_encoder *encoder) { struct bridge_init bridge; - struct drm_bridge *bridge_chain = NULL; + struct drm_bridge *bridge_chain = NULL, *next = NULL; bool connector_created = false; if (find_bridge("nxp,ptn3460", &bridge)) { @@ -991,6 +993,14 @@ static int exynos_drm_attach_lcd_bridge(struct exynos_dp_device *dp, bridge.node); } + if (dp->edp_panel) { + next = panel_binder_init(dp->drm_dev, encoder, bridge.client, + bridge.node, dp->edp_panel, DRM_CONNECTOR_POLL_HPD); + if (next) + connector_created = true; + drm_bridge_add_to_chain(bridge_chain, next); + } + return connector_created; } @@ -1215,16 +1225,10 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm_dev = data; struct resource *res; - struct exynos_dp_device *dp; + struct exynos_dp_device *dp = exynos_dp_display.ctx; unsigned int irq_flags; - int ret = 0; - dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device), - GFP_KERNEL); - if (!dp) - return -ENOMEM; - dp->dev = &pdev->dev; dp->dpms_mode = DRM_MODE_DPMS_OFF; @@ -1298,7 +1302,6 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) disable_irq(dp->irq); dp->drm_dev = drm_dev; - exynos_dp_display.ctx = dp; platform_set_drvdata(pdev, &exynos_dp_display); @@ -1325,6 +1328,9 @@ 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; + struct exynos_dp_device *dp; int ret; ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CONNECTOR, @@ -1332,6 +1338,21 @@ static int exynos_dp_probe(struct platform_device *pdev) if (ret) return ret; + dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device), + GFP_KERNEL); + if (!dp) + return -ENOMEM; + + panel_node = of_parse_phandle(dev->of_node, "edp-panel", 0); + if (panel_node) { + dp->edp_panel = of_drm_find_panel(panel_node); + of_node_put(panel_node); + if (!dp->edp_panel) + return -EPROBE_DEFER; + } + + exynos_dp_display.ctx = dp; + ret = component_add(&pdev->dev, &exynos_dp_ops); if (ret) exynos_drm_component_del(&pdev->dev, diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.h b/drivers/gpu/drm/exynos/exynos_dp_core.h index 02cc4f9..26a64d3 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.h +++ b/drivers/gpu/drm/exynos/exynos_dp_core.h @@ -149,6 +149,7 @@ struct exynos_dp_device { struct drm_device *drm_dev; struct drm_connector connector; struct drm_encoder *encoder; + struct drm_panel *edp_panel; struct clk *clock; unsigned int irq; void __iomem *reg_base;