From patchwork Wed Jul 25 15:46:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10544191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12A87139A for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00F8A2A508 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E89412A54F; Wed, 25 Jul 2018 15:47:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DEAB2A50F for ; Wed, 25 Jul 2018 15:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbeGYQ7Q (ORCPT ); Wed, 25 Jul 2018 12:59:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33542 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbeGYQ7Q (ORCPT ); Wed, 25 Jul 2018 12:59:16 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180725154700euoutp01331f96192ac8b6642719ac44096ff088~EpzVaNeW11687316873euoutp01g; Wed, 25 Jul 2018 15:47:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180725154700euoutp01331f96192ac8b6642719ac44096ff088~EpzVaNeW11687316873euoutp01g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532533620; bh=ofXvK2+TsfMJRBgCp+oZ/bH/OnpQ/YPS5v8mpImDBz4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=cP/73LK7L7zJPL+qRob5XaJHs2QgnftKiGMvaiEQ2/czbfvdUlmZSC7RmDoErhv1F eEtajp+v9o7JabnWPEFy8xg3rzPEARegs+ifAZ48ww/I73gRnyhIcm+YDHyxSEtwIr 3z7pNa8ST1E0oFI9mt7fTZbXmkrmLU9YmOtjS8bo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154700eucas1p1c9f0cc0ca6401676b4a0553fe09cfd97~EpzU6nxDG1465114651eucas1p1d; Wed, 25 Jul 2018 15:47:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id AC.E8.04627.37B985B5; Wed, 25 Jul 2018 16:46:59 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154659eucas1p17b6862ede839fa0d091acff69090e87b~EpzUOkHBT0824808248eucas1p1_; Wed, 25 Jul 2018 15:46:59 +0000 (GMT) X-AuditID: cbfec7f2-0edff70000021213-6c-5b589b732a1a Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 42.03.04178.37B985B5; Wed, 25 Jul 2018 16:46:59 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCF00M07IIAVC60@eusync4.samsung.com>; Wed, 25 Jul 2018 16:46:59 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Inki Dae Cc: Maciej Purski , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Andrzej Hajda , Rob Herring , Thierry Reding , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart Subject: [PATCH v5 1/9] drm/exynos: rename bridge_node to in_bridge_node Date: Wed, 25 Jul 2018 17:46:36 +0200 Message-id: <20180725154644.25412-2-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <20180725154644.25412-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNIsWRmVeSWpSXmKPExsWy7djPc7rFsyOiDd5fs7G4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k9Nq3qZPO4332cyaNvyypGj8+b5ALYo7hsUlJzMstSi/TtErgy 7pxLK5gnXLHz4DumBsYJAl2MnBwSAiYSR1t7WLsYuTiEBFYwSsy4dJkJwvnMKPFi/ScWmKo9 f8+xgthCAssYJV5f5IAo+s8ocfAoRIJNQFPi7+abbCC2iECmxIaDC9lBipgFepglzp2+AzSW g0NYwEPi3UpVkBoWAVWJ33sXMoLYvAIWEke7dzJCLJOXeHi8HczmFLCUuLL/EBvIHAmBHWwS 8+avh7rIReLVnjY2CFtY4tXxLewQtoxEZ8dBJgi7XqJp5hVmiOYORokTi5dDNVhLHD5+Eexq ZgE+iUnbpjODHCchwCvR0SYEUeIhMa19FjQoehglfn8/zT6BUXIBI8MqRvHU0uLc9NRiw7zU cr3ixNzi0rx0veT83E2MwCg+/e/4px2MXy8lHWIU4GBU4uF90RQeLcSaWFZcmXuIUYKDWUmE 1+UwUIg3JbGyKrUoP76oNCe1+BCjNAeLkjivtE9EtJBAemJJanZqakFqEUyWiYNTqoHRlFWt qy2cW8Js2uPte1KmBrw5+aD+G99808CeqO9Clguqpk7aej7loUdAxPb4Xgt9lstnYq2835/S zLlWEpkh8M9Z4uunDz7XFjM8+LZSRIyP67mRavJCS2P23EfCFfmLOCYwz8xKCWUS/nj6UtIW 9ZzFU7+W257+2edygieV7SMbi7KDzhclluKMREMt5qLiRAAlXVt/3gIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t/xa7rFsyOiDdr+8VncWneO1aKp4y2r xcYZ61ktrnx9z2Yx6f4EFovz5zewW3ROXMJuMeP8PiaLBS9vsVisPXKX3aJ17xF2i5+75rE4 8Hhc7utl8tg56y67x+yOmawem1Z1snnc7z7O5NG3ZRWjx+dNcgHsUVw2Kak5mWWpRfp2CVwZ d86lFcwTrth58B1TA+MEgS5GTg4JAROJPX/PsYLYQgJLGCX6JqVA2I1MEv9aC0BsNgFNib+b b7KB2CICmRKX1rYydzFycTAL9DFL7P22kqmLkYNDWMBD4t1KVZAaFgFVid97FzKC2LwCFhJH u3cyQuySl3h4vB3M5hSwlLiy/xAbxC4LiQMb17FNYORZwMiwilEktbQ4Nz232FCvODG3uDQv XS85P3cTIzD4th37uXkH46WNwYcYBTgYlXh4L8yMiBZiTSwrrsw9xCjBwawkwutyODxaiDcl sbIqtSg/vqg0J7X4EKM0B4uSOO95g8ooIYH0xJLU7NTUgtQimCwTB6dUA2Px0cuJrYyfi780 7ZOw2dIdLR8Rm7LZID1c7V3i0UiGR0kPD2TcVvi3XkKJN3VS7qVrEvzP1l1JNDmnESy3TpF3 TvVRlmzzXTffrtw+OybWMSbmZued5e96arxWx7La37n5QWz7Dzeb+rbGE0v2FU3j+rGp1VBh y5ZHk8vut7NIsiXpOssonFFiKc5INNRiLipOBACI7ZS9OgIAAA== X-CMS-MailID: 20180725154659eucas1p17b6862ede839fa0d091acff69090e87b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725154659eucas1p17b6862ede839fa0d091acff69090e87b References: <20180725154644.25412-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maciej Purski Driver uses bridge_node to refer to bridge on input side of DSI. Since we want to add support for bridges on output side lets add "in" prefix to avoid confusion with out bridges. Changes in v5: - replace mic_ prefix with in_ Signed-off-by: Maciej Purski [ a.hajda@samsuung.com: v5 ] Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7c3030b7e586..351403f9d245 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -279,7 +279,7 @@ struct exynos_dsi { struct list_head transfer_list; const struct exynos_dsi_driver_data *driver_data; - struct device_node *bridge_node; + struct device_node *in_bridge_node; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1631,7 +1631,7 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) if (ret < 0) return ret; - dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_IN, 0); + dsi->in_bridge_node = of_graph_get_remote_node(node, DSI_PORT_IN, 0); return 0; } @@ -1642,7 +1642,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, struct drm_encoder *encoder = dev_get_drvdata(dev); struct exynos_dsi *dsi = encoder_to_dsi(encoder); struct drm_device *drm_dev = data; - struct drm_bridge *bridge; + struct drm_bridge *in_bridge; int ret; drm_encoder_init(drm_dev, encoder, &exynos_dsi_encoder_funcs, @@ -1661,10 +1661,10 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, return ret; } - if (dsi->bridge_node) { - bridge = of_drm_find_bridge(dsi->bridge_node); - if (bridge) - drm_bridge_attach(encoder, bridge, NULL); + if (dsi->in_bridge_node) { + in_bridge = of_drm_find_bridge(dsi->in_bridge_node); + if (in_bridge) + drm_bridge_attach(encoder, in_bridge, NULL); } return mipi_dsi_host_register(&dsi->dsi_host); @@ -1783,7 +1783,7 @@ static int exynos_dsi_remove(struct platform_device *pdev) { struct exynos_dsi *dsi = platform_get_drvdata(pdev); - of_node_put(dsi->bridge_node); + of_node_put(dsi->in_bridge_node); pm_runtime_disable(&pdev->dev); From patchwork Wed Jul 25 15:46:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10544199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3504E1822 for ; Wed, 25 Jul 2018 15:47:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 242452A4FC for ; Wed, 25 Jul 2018 15:47:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 175E42A519; Wed, 25 Jul 2018 15:47:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 112F72A527 for ; Wed, 25 Jul 2018 15:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728580AbeGYQ7Q (ORCPT ); Wed, 25 Jul 2018 12:59:16 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50559 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728514AbeGYQ7Q (ORCPT ); Wed, 25 Jul 2018 12:59:16 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180725154701euoutp0230e9cc5ecbfcbe650d8606b22c9f2c27~EpzVtooMK0392203922euoutp02O; Wed, 25 Jul 2018 15:47:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180725154701euoutp0230e9cc5ecbfcbe650d8606b22c9f2c27~EpzVtooMK0392203922euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532533621; bh=rBR4kD4pMBRoVVd/kEMUCj88ftg0K/pS6ge9tI60sUw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=NTcwZcduvyuQOLYzt/9jtmIoZJ8nKHyNEWs63hcD3FOHhkIjn18M81X40IsI/2Joj skumtk9wBeXtajt3FHbCUL+CUjeSbg+U1AVEOejMdn3Q9gWm7p2GLmptjSuE4P4EGQ q2XRBFxuYpL5zvYR2QPPdGFrk4VYmeJeFRhGaqTA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180725154700eucas1p20f3d8e799f2974729fdba12a0052801c~EpzVTFTtP2172521725eucas1p2K; Wed, 25 Jul 2018 15:47:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F2.A6.61560.47B985B5; Wed, 25 Jul 2018 16:47:00 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154659eucas1p116f3a5e735333b07bcf9808f00694f3c~EpzUgbE5K0824808248eucas1p1-; Wed, 25 Jul 2018 15:46:59 +0000 (GMT) X-AuditID: cbfec7f5-207ff7000002f078-9f-5b589b74a2c8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D9.B1.04183.37B985B5; Wed, 25 Jul 2018 16:46:59 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCF00M07IIAVC60@eusync4.samsung.com>; Wed, 25 Jul 2018 16:46:59 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Inki Dae Cc: Maciej Purski , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Andrzej Hajda , Rob Herring , Thierry Reding , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart Subject: [PATCH v5 2/9] drm/exynos: move connector creation to attach callback Date: Wed, 25 Jul 2018 17:46:37 +0200 Message-id: <20180725154644.25412-3-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <20180725154644.25412-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNIsWRmVeSWpSXmKPExsWy7djP87olsyOiDRbPErW4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k9Nq3qZPO4332cyaNvyypGj8+b5ALYo7hsUlJzMstSi/TtErgy Hp0/z1ZwTqHi86rnrA2MXdJdjJwcEgImEk/W7WXpYuTiEBJYwSjx7e5KRpCEkMBnRokpRxRg ilZOvMQEUbSMUWJu4x1WCOc/o8TBo+dYQarYBDQl/m6+yQZiiwhkSmw4uJAdpIhZoIdZ4tzp O0wgCWGBAIn3S+6BrWARUJXo2H4RLM4rYCGxe/M7Voh18hIPj7eD1XAKWEpc2X+IDWSQhMAO Non+OyeBEhxAjovElPsxEPXCEq+Ob2GHsGUkL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/Tww1kncnb2pKYRxoxufTXjTQ8Xn1dnFS627fI8s a2lffuv55K2XHk1Z9WhXw4dIUc89j/2rp/7lLS3tcjEz6t2SkH9J63/p977m6nv6h9an+K9t OFbD2/foZrfk1Kmfj5mlfm1XYinOSDTUYi4qTgQAaePaHD0CAAA= X-CMS-MailID: 20180725154659eucas1p116f3a5e735333b07bcf9808f00694f3c X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725154659eucas1p116f3a5e735333b07bcf9808f00694f3c References: <20180725154644.25412-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maciej Purski The current implementation assumes that the only possible peripheral device for DSIM is a panel. Using an output bridge child device should also be possible. If an output bridge is available, don't create a new connector. Instead, call drm_bridge_attach() and set encoder's bridge to NULL in order to avoid an out bridge from being visible by the framework, as the DSI bus needs control on enabling its child output bridge. Such sequence is required by Toshiba TC358764 bridge, which is a DSI peripheral bridge device. changed in v5: - detach bridge in mipi_dsi detach callback Signed-off-by: Maciej Purski [ a.hajda@samsung.com: v5 ] Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 50 ++++++++++++++++--------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 351403f9d245..f5f51f584fa0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -255,6 +255,7 @@ struct exynos_dsi { struct mipi_dsi_host dsi_host; struct drm_connector connector; struct drm_panel *panel; + struct drm_bridge *out_bridge; struct device *dev; void __iomem *reg_base; @@ -1499,7 +1500,30 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); - struct drm_device *drm = dsi->connector.dev; + struct drm_encoder *encoder = &dsi->encoder; + struct drm_device *drm = encoder->dev; + struct drm_bridge *out_bridge; + + out_bridge = of_drm_find_bridge(device->dev.of_node); + if (out_bridge) { + drm_bridge_attach(encoder, out_bridge, NULL); + dsi->out_bridge = out_bridge; + encoder->bridge = NULL; + } else { + int ret = exynos_dsi_create_connector(encoder); + + if (ret) { + DRM_ERROR("failed to create connector ret = %d\n", ret); + drm_encoder_cleanup(encoder); + return ret; + } + + dsi->panel = of_drm_find_panel(device->dev.of_node); + if (dsi->panel) { + drm_panel_attach(dsi->panel, &dsi->connector); + dsi->connector.status = connector_status_connected; + } + } /* * This is a temporary solution and should be made by more generic way. @@ -1518,11 +1542,6 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, dsi->lanes = device->lanes; dsi->format = device->format; dsi->mode_flags = device->mode_flags; - dsi->panel = of_drm_find_panel(device->dev.of_node); - if (dsi->panel) { - drm_panel_attach(dsi->panel, &dsi->connector); - dsi->connector.status = connector_status_connected; - } exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = !(dsi->mode_flags & MIPI_DSI_MODE_VIDEO); @@ -1538,19 +1557,21 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); - struct drm_device *drm = dsi->connector.dev; - - mutex_lock(&drm->mode_config.mutex); + struct drm_device *drm = dsi->encoder.dev; if (dsi->panel) { + mutex_lock(&drm->mode_config.mutex); exynos_dsi_disable(&dsi->encoder); drm_panel_detach(dsi->panel); dsi->panel = NULL; dsi->connector.status = connector_status_disconnected; + mutex_unlock(&drm->mode_config.mutex); + } else { + if (dsi->out_bridge->funcs->detach) + dsi->out_bridge->funcs->detach(dsi->out_bridge); + dsi->out_bridge = NULL; } - mutex_unlock(&drm->mode_config.mutex); - if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); @@ -1654,13 +1675,6 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, if (ret < 0) return ret; - ret = exynos_dsi_create_connector(encoder); - if (ret) { - DRM_ERROR("failed to create connector ret = %d\n", ret); - drm_encoder_cleanup(encoder); - return ret; - } - if (dsi->in_bridge_node) { in_bridge = of_drm_find_bridge(dsi->in_bridge_node); if (in_bridge) From patchwork Wed Jul 25 15:46:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10544195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1C3FA517 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A10FE2A508 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94C522A54D; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ECE02A508 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728600AbeGYQ7R (ORCPT ); Wed, 25 Jul 2018 12:59:17 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33551 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbeGYQ7R (ORCPT ); Wed, 25 Jul 2018 12:59:17 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180725154701euoutp01ea1a6f0bbd66f8128ca959c0317c700f~EpzWQRcp41687316873euoutp01h; Wed, 25 Jul 2018 15:47:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180725154701euoutp01ea1a6f0bbd66f8128ca959c0317c700f~EpzWQRcp41687316873euoutp01h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532533621; bh=ic3qNtoq51bQUkB+tC4AheocFQdN9kl6T9RIQSBGcrw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=QWgoXrdEk3F9QaZWZdQ3+UksyZM9TE9jZ5UnuXque0sMWW2QuBgEf12aIu0c2+ISD KK6deDwtUPpYpPx3EvltYRmPeLCTjmJDV7bMHHqdNQ3PZKciLsozfafHk6JZ7d5ZNY MJ9xheFmYnj3P3pBDGYc4C6RQnZa3IqqU07Bbvis= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180725154701eucas1p2eba5018129c29fe2d8042c2055505d03~EpzVroFXi2172521725eucas1p2O; Wed, 25 Jul 2018 15:47:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id F9.40.05751.47B985B5; Wed, 25 Jul 2018 16:47:00 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154700eucas1p1ae0db40d64d3ccdd59ef992c9e02aa4b~EpzU8lm5M1246612466eucas1p1x; Wed, 25 Jul 2018 15:47:00 +0000 (GMT) X-AuditID: cbfec7f4-c2dff70000001677-a6-5b589b742ebf Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 63.03.04178.47B985B5; Wed, 25 Jul 2018 16:47:00 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCF00M07IIAVC60@eusync4.samsung.com>; Wed, 25 Jul 2018 16:47:00 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Inki Dae Cc: Maciej Purski , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Andrzej Hajda , Rob Herring , Thierry Reding , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart Subject: [PATCH v5 3/9] drm/exynos: enable out_bridge in exynos_dsi_enable Date: Wed, 25 Jul 2018 17:46:38 +0200 Message-id: <20180725154644.25412-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <20180725154644.25412-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWy7djP87olsyOiDTYdNba4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k9Nq3qZPO4332cyaNvyypGj8+b5ALYo7hsUlJzMstSi/TtErgy 1px6w1pwT7hi2sIPLA2MpwW6GDk5JARMJN4sn8EOYgsJrGCUOP2FpYuRC8j+zCgx9/JjJpii Tdc+QCWWMUp0//zKDuH8Z5Q493ItWBWbgKbE38032UBsEYFMiQ0HF4IVMQv0MEucO30HrEhY wEti78VLYDaLgKrEtXknwXbzClhIbJj5jxVinbzEw+PtjCA2p4ClxJX9h9hABkkI7GGTuPP+ ExtEkYvE58WfmSFsYYlXx7ewQ9gyEp0dB6HurpdomnmFGaK5g1HixOLlUM3WEoePXwTbxizA JzFp23SgIg6gOK9ER5sQhOkhsXmF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08r3LBTbmr8xWUzJTYkx7GK87DrHZoi6fzn4WEhrqP9 kZq1tzTYn52q38y/SGuXjZJVxX0lluKMREMt5qLiRAAk6KltPgIAAA== X-CMS-MailID: 20180725154700eucas1p1ae0db40d64d3ccdd59ef992c9e02aa4b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725154700eucas1p1ae0db40d64d3ccdd59ef992c9e02aa4b References: <20180725154644.25412-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maciej Purski As the out bridge will not be enabled directly by the framework, it should be enabled by DSI. exynos_dsi_enable() should handle a case, when there is an out_bridge connected as a DSI peripheral. Changed in v5: - fixed error path in exynos_dsi_enable Signed-off-by: Maciej Purski [ a.hajda@samsung.com: v5 ] Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 38 +++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index f5f51f584fa0..54cfcebe7a2c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1383,29 +1383,37 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) return; pm_runtime_get_sync(dsi->dev); - dsi->state |= DSIM_STATE_ENABLED; - ret = drm_panel_prepare(dsi->panel); - if (ret < 0) { - dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); - return; + if (dsi->panel) { + ret = drm_panel_prepare(dsi->panel); + if (ret < 0) + goto err_put_sync; + } else { + drm_bridge_pre_enable(dsi->out_bridge); } exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); - ret = drm_panel_enable(dsi->panel); - if (ret < 0) { - dsi->state &= ~DSIM_STATE_ENABLED; - exynos_dsi_set_display_enable(dsi, false); - drm_panel_unprepare(dsi->panel); - pm_runtime_put_sync(dsi->dev); - return; + if (dsi->panel) { + ret = drm_panel_enable(dsi->panel); + if (ret < 0) + goto err_display_disable; + } else { + drm_bridge_enable(dsi->out_bridge); } dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; + return; + +err_display_disable: + exynos_dsi_set_display_enable(dsi, false); + drm_panel_unprepare(dsi->panel); + +err_put_sync: + dsi->state &= ~DSIM_STATE_ENABLED; + pm_runtime_put(dsi->dev); } static void exynos_dsi_disable(struct drm_encoder *encoder) @@ -1418,11 +1426,11 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; drm_panel_disable(dsi->panel); + drm_bridge_disable(dsi->out_bridge); exynos_dsi_set_display_enable(dsi, false); drm_panel_unprepare(dsi->panel); - + drm_bridge_post_disable(dsi->out_bridge); dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); } From patchwork Wed Jul 25 15:46:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10544197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DEC589093 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE9312A508 for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C266C2A510; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D222A50F for ; Wed, 25 Jul 2018 15:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728612AbeGYQ7R (ORCPT ); Wed, 25 Jul 2018 12:59:17 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50570 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbeGYQ7R (ORCPT ); Wed, 25 Jul 2018 12:59:17 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180725154702euoutp02a7f86bb73cb4888c0164366f85e28f96~EpzW4Xy340353903539euoutp02g; Wed, 25 Jul 2018 15:47:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180725154702euoutp02a7f86bb73cb4888c0164366f85e28f96~EpzW4Xy340353903539euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532533622; bh=7AvimsPQ6cOZfNhmwsjMJKCjQgRM0ICuV5XuiWtspGo=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=jtF2J5CAvAmYXbM09TqC+9twyP62Z47ytSDrvF0+8Z7UxoZSVZe5XEbw9CsJz2Q6h v2jURgIX7UAYcTK9VlZ3okknVLJ1SNV5h9oRCKmPyePcYm6doT0/CaW04vcnJX3AdI zeiGR4SZiD6mU2q3dw4SRLe3oxuGs7B1mGZH9UOQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180725154701eucas1p2bca4715d8675653bf10043f7b85bebea~EpzWVRtGX1189511895eucas1p2C; Wed, 25 Jul 2018 15:47:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id EA.40.05751.57B985B5; Wed, 25 Jul 2018 16:47:01 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154700eucas1p148d715003b77bc3686e25ebd22a3e57a~EpzVcN2KC1465114651eucas1p1f; Wed, 25 Jul 2018 15:47:00 +0000 (GMT) X-AuditID: cbfec7f4-c2dff70000001677-a8-5b589b7598d5 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7B.B1.04183.47B985B5; Wed, 25 Jul 2018 16:47:00 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCF00M07IIAVC60@eusync4.samsung.com>; Wed, 25 Jul 2018 16:47:00 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Maciej Purski , Rob Herring , Thierry Reding , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart Subject: [PATCH v5 4/9] dt-bindings: tc358754: add DT bindings Date: Wed, 25 Jul 2018 17:46:39 +0200 Message-id: <20180725154644.25412-5-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <20180725154644.25412-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsWy7djPc7qlsyOiDS79k7O4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k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soHYIgKZEpfWtoLFmQX6mCVWHFQDsYUF7CQWNz4Bq2ERUJVYc7WZsYuRg4NXwEJi wvpkiGXyEg+PtzOC2JwClhJX9h8CKxcCKjmwcR3bBEaeBYwMqxhFUkuLc9Nzi430ihNzi0vz 0vWS83M3MQLDb9uxn1t2MHa9Cz7EKMDBqMTDe2FmRLQQa2JZcWXuIUYJDmYlEV6Xw+HRQrwp iZVVqUX58UWlOanFhxilOViUxHnPG1RGCQmkJ5akZqemFqQWwWSZODilGhj1u95ERz8KkJZ7 03FojdmqSTM8a1c2hOqq2jYqmegHVbu/9Tnn3sV3PTS49dYRfubuI0ur7WZK/L5ZM+Hc5W9f o9w3cSlxpZo+9/BV7fysc73rp/Hd1p6gIP25VwRV0zskDE8+fWv4NGWyx++OSpF9FgcKu705 eEQ6nbIYjcvFVSs550+5pMRSnJFoqMVcVJwIADTqmGY7AgAA X-CMS-MailID: 20180725154700eucas1p148d715003b77bc3686e25ebd22a3e57a X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725154700eucas1p148d715003b77bc3686e25ebd22a3e57a References: <20180725154644.25412-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch adds bindings to Toshiba DSI/LVDS bridge TC358764. Bindings describe power supplies, reset gpio and video interfaces. Signed-off-by: Andrzej Hajda Signed-off-by: Maciej Purski Reviewed-by: Rob Herring --- .../display/bridge/toshiba,tc358764.txt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.txt diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.txt b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.txt new file mode 100644 index 000000000000..8f9abf28a8fa --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.txt @@ -0,0 +1,35 @@ +TC358764 MIPI-DSI to LVDS panel bridge + +Required properties: + - compatible: "toshiba,tc358764" + - reg: the virtual channel number of a DSI peripheral + - vddc-supply: core voltage supply, 1.2V + - vddio-supply: I/O voltage supply, 1.8V or 3.3V + - vddlvds-supply: LVDS1/2 voltage supply, 3.3V + - reset-gpios: a GPIO spec for the reset pin + +The device node can contain following 'port' child nodes, +according to the OF graph bindings defined in [1]: + 0: DSI Input, not required, if the bridge is DSI controlled + 1: LVDS Output, mandatory + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + + bridge@0 { + reg = <0>; + compatible = "toshiba,tc358764"; + vddc-supply = <&vcc_1v2_reg>; + vddio-supply = <&vcc_1v8_reg>; + vddlvds-supply = <&vcc_3v3_reg>; + reset-gpios = <&gpd1 6 GPIO_ACTIVE_LOW>; + #address-cells = <1>; + #size-cells = <0>; + port@1 { + reg = <1>; + lvds_ep: endpoint { + remote-endpoint = <&panel_ep>; + }; + }; + }; From patchwork Wed Jul 25 15:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10544207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B40CC9093 for ; Wed, 25 Jul 2018 15:47:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0AB02A4FC for ; Wed, 25 Jul 2018 15:47:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94B772A50F; Wed, 25 Jul 2018 15:47:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67C892A4FC for ; Wed, 25 Jul 2018 15:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728620AbeGYQ7T (ORCPT ); Wed, 25 Jul 2018 12:59:19 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33572 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbeGYQ7T (ORCPT ); Wed, 25 Jul 2018 12:59:19 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180725154703euoutp013ad26946673b40591b935c8a9c0522ac~EpzXm2AGw1687316873euoutp01k; Wed, 25 Jul 2018 15:47:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180725154703euoutp013ad26946673b40591b935c8a9c0522ac~EpzXm2AGw1687316873euoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532533623; bh=bzCIbnxwYoxy6jj8D433b8D3lTBpPywhVCSICSdKJIg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=bIUBm8HuLkuejHtaPOFMfXCTQseWGVopAuj8QbWNnxqFUIzjuLjW9ib8A8ZqesJYX AcMnjYa71AJFk32C4NCIRtHJ4SWRtTWTQ7kv7u0wS0j1UMfTFh+j4I3zGd6N0nqCNa SslE8jytkJIQkhmdpdvr3AsTmQlGqgJZ7HunQaMA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154702eucas1p1fafefb5263328a1ee8030318bf482b55~EpzWr-npm0824908249eucas1p1-; Wed, 25 Jul 2018 15:47:02 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9F.E8.04627.57B985B5; Wed, 25 Jul 2018 16:47:01 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725154701eucas1p1301a4793a9d76f38cc75abbc40848164~EpzV_NJrA0824908249eucas1p1_; Wed, 25 Jul 2018 15:47:01 +0000 (GMT) X-AuditID: cbfec7f2-0d3ff70000021213-71-5b589b759c86 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 34.03.04178.57B985B5; Wed, 25 Jul 2018 16:47:01 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCF00M07IIAVC60@eusync4.samsung.com>; Wed, 25 Jul 2018 16:47:01 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Maciej Purski , Rob Herring , Thierry Reding , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart Subject: [PATCH v5 5/9] drm/bridge: tc358764: Add DSI to LVDS bridge driver Date: Wed, 25 Jul 2018 17:46:40 +0200 Message-id: <20180725154644.25412-6-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <20180725154644.25412-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLIsWRmVeSWpSXmKPExsWy7djPc7qlsyOiDWZ9NLK4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k9Nq3qZPO4332cyaNvyypGj8+b5ALYo7hs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W5jB7FZBFQlJj25CWbzClhI 3Pz+nhVim7zEw+PtjCA2p4ClxJX9h8BmCgHVHNi4jm0CI88CRoZVjCKppcW56bnFhnrFibnF pXnpesn5uZsYgUG47djPzTsYL20MPsQowMGoxMN7YWZEtBBrYllxZe4hRgkOZiURXpfD4dFC vCmJlVWpRfnxRaU5qcWHGKU5WJTEec8bVEYJCaQnlqRmp6YWpBbBZJk4OKUaGGcXqS29t+i1 3RUB961ye9gvmi27KKKo9XZjqEkZq15NmLFrzPEDPK+mOaUeTz+XevjdBIE9znPnXHePy3mv 9NXULbptqsbySTOu3barYHVyleVYO9Fy70o/8QecayyL/JY+aWf/EXLJ0+76G6vXEzo9v76N uNgXVrb4+ux2s4DdtYYZ/c8OcyixFGckGmoxFxUnAgDmoR1kPgIAAA== X-CMS-MailID: 20180725154701eucas1p1301a4793a9d76f38cc75abbc40848164 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725154701eucas1p1301a4793a9d76f38cc75abbc40848164 References: <20180725154644.25412-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a drm_bridge driver for the Toshiba TC358764 DSI to LVDS bridge. Changes in v4: - removed license blob, - ordered includes, - added error handling, - fixed reset GPIO handling, - added missing calls to the panel, - custom OF graph code replaced with helpers, - removed tc358764_poweroff from remove callback. v5: - fixed supply names, - fixed broken console - added connector to fb_helper, - added detach callback - unbinding works, - fixed typo in error checking code, - removed sparse bridge->encoder check - core does it already. Signed-off-by: Andrzej Hajda Signed-off-by: Maciej Purski [ a.hajda@samsung.com: v4, v5 ] Signed-off-by: Andrzej Hajda Reviewed-by: Archit Taneja --- drivers/gpu/drm/bridge/Kconfig | 8 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/tc358764.c | 499 ++++++++++++++++++++++++++++++ 3 files changed, 508 insertions(+) create mode 100644 drivers/gpu/drm/bridge/tc358764.c diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index fa2c7997e2fd..f3da8a716833 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -110,6 +110,14 @@ config DRM_THINE_THC63LVD1024 ---help--- Thine THC63LVD1024 LVDS/parallel converter driver. +config DRM_TOSHIBA_TC358764 + tristate "TC358764 DSI/LVDS bridge" + depends on DRM && DRM_PANEL + depends on OF + select DRM_MIPI_DSI + help + Toshiba TC358764 DSI/LVDS bridge driver. + config DRM_TOSHIBA_TC358767 tristate "Toshiba TC358767 eDP bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 35f88d48ec20..bf7c0cecf227 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o +obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c new file mode 100644 index 000000000000..779bc5fce22a --- /dev/null +++ b/drivers/gpu/drm/bridge/tc358764.c @@ -0,0 +1,499 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Samsung Electronics Co., Ltd + * + * Authors: + * Andrzej Hajda + * Maciej Purski + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include