From patchwork Thu Mar 26 11:15:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 6097591 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 074709F350 for ; Thu, 26 Mar 2015 11:16:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 267EE203ED for ; Thu, 26 Mar 2015 11:16:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B629C203EC for ; Thu, 26 Mar 2015 11:16:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6B9F6E9D8; Thu, 26 Mar 2015 04:15:57 -0700 (PDT) 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 ESMTP id 385916E4C2 for ; Thu, 26 Mar 2015 04:15:53 -0700 (PDT) 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 <0NLT007C1GMFX4C0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 26 Mar 2015 20:15:51 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 87.1F.18484.76AE3155; Thu, 26 Mar 2015 20:15:51 +0900 (KST) X-AuditID: cbfee68f-f791c6d000004834-34-5513ea6790d7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 3E.B8.20081.76AE3155; Thu, 26 Mar 2015 20:15:51 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NLT00A2SGMAMQ10@mmp2.samsung.com>; Thu, 26 Mar 2015 20:15:50 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, inki.dae@samsung.com, daniel@fooishbar.org Subject: [PATCH v3 7/8] drm/exynos: dsi: add support for MIC driver as a bridge Date: Thu, 26 Mar 2015 20:15:39 +0900 Message-id: <1427368540-28010-8-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1427368540-28010-1-git-send-email-human.hwang@samsung.com> References: <1427368540-28010-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsWyRsSkRDf9lXCowZR+MYvrX56zWlxpnc5q Mf/IOVaL6+ftLK58fc9msXRGH6vFpPsTWCxe3LvIYjFj8ks2B06PF1+3MXvc7z7O5NG3ZRWj x+dNcgEsUVw2Kak5mWWpRfp2CVwZzWf+Mhf0yFccPnyOpYHxvkQXIyeHhICJxPaZW9ggbDGJ C/fWA9lcHEICSxklfq95wwJTdO7YRWYQW0hgOqNE31seiKIfjBK97/6BdbMJ6EksuPaDHcQW EciV6H/xggmkiFmgh1Gi8cpksEnCAv4Sk+eeZAWxWQRUJc5c/wA0lYODV8Bd4uUPeYhlchIn j00GK+EU8JDomfOYCWKxu8TZ7l3MIDMlBBaxS0yd1sAGMUdA4tvkQywgcyQEZCU2HWCGmCMp cXDFDZYJjMILGBlWMYqmFiQXFCelFxnrFSfmFpfmpesl5+duYgSG++l/z/p3MN49YH2IUYCD UYmH90e/cKgQa2JZcWXuIUZToA0TmaVEk/OBUZVXEm9obGZkYWpiamxkbmmmJM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etd0y52XdBX8/XGFD5Ru7lvVapcL929MVmJpTgj0VCLuag4EQCr1nB3 vAIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: dh09.lee@samsung.com, sw0312.kim@samsung.com, Hyungwon Hwang , cw00.choi@samsung.com 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 MIC must be initilized by MIPI DSI when it is being bound. Signed-off-by: Hyungwon Hwang --- Changes for v2: - None Changes for v3: - None .../devicetree/bindings/video/exynos_dsim.txt | 23 ++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 24 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dsim.txt b/Documentation/devicetree/bindings/video/exynos_dsim.txt index 8b12bfe..9112b10 100644 --- a/Documentation/devicetree/bindings/video/exynos_dsim.txt +++ b/Documentation/devicetree/bindings/video/exynos_dsim.txt @@ -31,10 +31,19 @@ Video interfaces: Device node can contain video interface port nodes according to [2]. The following are properties specific to those nodes: - port node: - - reg: (required) can be 0 for input RGB/I80 port or 1 for DSI port; + port node inbound: + - reg: (required) must be 0. + port node outbound: + - reg: (required) must be 1. - endpoint node of DSI port (reg = 1): + endpoint node connected from mic node (reg = 0): + - remote-endpoint: specifies the endpoint in mic node. This node is required + for Exynos5433 mipi dsi. So mic can access to panel node + thoughout this dsi node. + endpoint node connected to panel node (reg = 1): + - remote-endpoint: specifies the endpoint in panel node. This node is + required in all kinds of exynos mipi dsi to represent + the connection between mipi dsi and panel. - samsung,burst-clock-frequency: specifies DSI frequency in high-speed burst mode - samsung,esc-clock-frequency: specifies DSI frequency in escape mode @@ -73,7 +82,15 @@ Example: #address-cells = <1>; #size-cells = <0>; + port@0 { + reg = <0>; + decon_to_mic: endpoint { + remote-endpoint = <&mic_to_decon>; + }; + }; + port@1 { + reg = <1>; dsi_ep: endpoint { reg = <0>; samsung,burst-clock-frequency = <500000000>; diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index d1ecd0f..d382511 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -282,6 +283,7 @@ struct exynos_dsi { struct list_head transfer_list; struct exynos_dsi_driver_data *driver_data; + struct device_node *bridge_node; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1778,7 +1780,22 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency", &dsi->esc_clk_rate); + if (ret < 0) + goto end; + + of_node_put(ep); + + ep = of_graph_get_next_endpoint(node, NULL); + if (!ep) { + ret = -ENXIO; + goto end; + } + dsi->bridge_node = of_graph_get_remote_port_parent(ep); + if (!dsi->bridge_node) { + ret = -ENXIO; + goto end; + } end: of_node_put(ep); @@ -1791,6 +1808,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, struct exynos_drm_display *display = dev_get_drvdata(dev); struct exynos_dsi *dsi = display_to_dsi(display); struct drm_device *drm_dev = data; + struct drm_bridge *bridge; int ret; ret = exynos_drm_create_enc_conn(drm_dev, display); @@ -1800,6 +1818,12 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, return ret; } + bridge = of_drm_find_bridge(dsi->bridge_node); + if (bridge) { + display->encoder->bridge = bridge; + drm_bridge_attach(drm_dev, bridge); + } + return mipi_dsi_host_register(&dsi->dsi_host); }