From patchwork Wed Jul 25 08:02:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10543661 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 B47711822 for ; Wed, 25 Jul 2018 08:02:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A64A51FFBE for ; Wed, 25 Jul 2018 08:02:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A6AC27CEA; Wed, 25 Jul 2018 08:02:49 +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 7239C23201 for ; Wed, 25 Jul 2018 08:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbeGYJNS (ORCPT ); Wed, 25 Jul 2018 05:13:18 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34195 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbeGYJNR (ORCPT ); Wed, 25 Jul 2018 05:13:17 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180725080242euoutp029a29c68d159a91c0667a5cc2b8af9c6d~Ejd8mo8oo2095220952euoutp02O; Wed, 25 Jul 2018 08:02:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180725080242euoutp029a29c68d159a91c0667a5cc2b8af9c6d~Ejd8mo8oo2095220952euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1532505762; bh=DneE96lcFLbIAA0DUGD4h798hyKionZCakmkAcS/raE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=YN2FtfnL8XYSxqhFvA7mdX7sW0TrP+U0XTSmo0Kr2VAC5tPCMPcTMHx5TbRFky9oh zPHpFn7C6n6ki8EkWQRm+jdJ+P/etCeOkJlaTwOfmyAFtFWWJwMU6PMnxjsIS7CQgV 5ZYTZZ9QEjZhQPSP6Q0sMXUzQJ8pUvui0GT+v0u4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180725080242eucas1p167a7eba6cdaf8be6db7ca6159baf7649~Ejd76-TzD1346913469eucas1p1x; Wed, 25 Jul 2018 08:02:42 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FC.D7.61560.1AE285B5; Wed, 25 Jul 2018 09:02:41 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180725080241eucas1p21f0aa8aa7f265ee71ab68f02aff9bef3~Ejd7E5BsH0401404014eucas1p2n; Wed, 25 Jul 2018 08:02:41 +0000 (GMT) X-AuditID: cbfec7f5-1edff7000002f078-f2-5b582ea1850c Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.94.04183.0AE285B5; Wed, 25 Jul 2018 09:02:40 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PCE00IP3X0G2N00@eusync1.samsung.com>; Wed, 25 Jul 2018 09:02:40 +0100 (BST) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Krzysztof Kozlowski , Archit Taneja , Laurent Pinchart , Inki Dae , Maciej Purski Subject: [PATCH v4] drm/bridge: tc358764: Add DSI to LVDS bridge driver Date: Wed, 25 Jul 2018 10:02:27 +0200 Message-id: <20180725080227.11694-1-a.hajda@samsung.com> X-Mailer: git-send-email 2.18.0 In-reply-to: <1529396370-18761-8-git-send-email-m.purski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsWy7djPc7oL9SKiDR6v0ba4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+QuuwOXx+W+XiaP2R0z WT02repk87jffZzJo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDLmzZ/AVjC5nbHi8a5rbA2M uwq6GDk5JARMJH5uvsfcxcjFISSwglGicd8JNgjnM6PEzRsT2LsYOcCq1rfkQcSXMUrs2/mC HcL5zyix9swcZpBRbAKaEn8332QDsUUE3CSaDs9kBSliFnjAJNG7/C0jSEJYwF3ix4ITjCBT WQRUJc702oGEeQUsJJ7uaGGCOEle4uHxdrByTgFXifufPrOAzJEQWMImsadtOjPERS4Sz7cm QdQLS7w6voUdwpaRuDy5mwXCrpdomnmFGaK3g1HixOLlbBAJa4nDxy+ygtjMAnwSk7bBzOSV 6GgTgijxkNh+6zfYPUICMxglPv+ynsAouYCRYRWjeGppcW56arFxXmq5XnFibnFpXrpecn7u JkZgnJ7+d/zrDsZ9f5IOMQpwMCrx8H6wC48WYk0sK67MPcQowcGsJMLrchgoxJuSWFmVWpQf X1Sak1p8iFGag0VJnDdOoy5KSCA9sSQ1OzW1ILUIJsvEwSnVwNidv1rqgOzT//wvPv7PvXB0 91Vf69p/tzYJRve821gtqBdVsSfJ7U/OfsaM+sB/fjMPyobPfPTnlPGZ66sX3ptiM+mMqXCW wOE7T1iknrb3un+dvNli+svMd1MynL0OXar8+mD7Y0ftjFnX1h2qlJi5nWl76P2NMbrXD8ot y+0xbOvZ6ddweekhJZbijERDLeai4kQAbbKfR88CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFLMWRmVeSWpSXmKPExsVy+t/xy7oL9CKiDe5fN7a4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+QuuwOXx+W+XiaP2R0z WT02repk87jffZzJo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDLmzZ/AVjC5nbHi8a5rbA2M uwq6GDk4JARMJNa35HUxcnEICSxhlHiy6RJbFyMnkNPIJNHwlwXEZhPQlPi7+SZYXETATaLp 8ExWkAZmgQdMEi83vQVLCAu4S/xYcIIRZCiLgKrEmV47kDCvgIXE0x0tTCC2hIC8xMPj7Ywg NqeAq8T9T59ZIHa5SJxY9Z15AiPPAkaGVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIEhtu3Y zy07GLveBR9iFOBgVOLh9XAMjxZiTSwrrsw9xCjBwawkwutyGCjEm5JYWZValB9fVJqTWnyI UZqDRUmc97xBZZSQQHpiSWp2ampBahFMlomDU6qB0SCZ1XnKfj5F9vn50umzjzKUGu7Vehyj I7LNpTLh6sJ/J4zK5szS/9Cj+SE2Yk5ZT47e6St8n31DYnLPlU+1KprGoaQak8a+e5/s972n z0iZbv/48/orgRnRB6rudj+9YTyH97jNqce+TDNSk+awXefce3sSF8+SlDMqga83rJorntqR x625SomlOCPRUIu5qDgRAHehH6ctAgAA X-CMS-MailID: 20180725080241eucas1p21f0aa8aa7f265ee71ab68f02aff9bef3 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180725080241eucas1p21f0aa8aa7f265ee71ab68f02aff9bef3 References: <1529396370-18761-8-git-send-email-m.purski@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. Signed-off-by: Andrzej Hajda Signed-off-by: Maciej Purski [ a.hajda@samsung.com: v4 ] Signed-off-by: Andrzej Hajda --- Since Maciej cannot work soon on this patchset I took over his work. Regards Andrzej --- drivers/gpu/drm/bridge/Kconfig | 8 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/tc358764.c | 492 ++++++++++++++++++++++++++++++ 3 files changed, 501 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..0bb0d10bca47 --- /dev/null +++ b/drivers/gpu/drm/bridge/tc358764.c @@ -0,0 +1,492 @@ +// 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