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+b5ALYo7hsUlJzMstSi/TtErgy Tj6fx1owu5ux4tzJOUwNjH0lXYycHBICJhIf/zaxdjFycQgJrGCUmHWnkRkkISTwmVFi869g mKIpC44yQhQtY5Ro+drFClH0n1Hi+fUYEJtNQFPi7+abbCC2iECmxIaDC9lBGpgFepglVi1f CpYQFvCWePa4jR3EZhFQlZj05CaYzStgIXHz+3tWiG3yEg+PtzOC2JwClhJX9h9iAxkkIbCH TeLRuxNMEEUuEm+nr4OyhSVeHd/CDmHLSHR2HISK10s0zbzCDNHcwShxYvFyNoiEtcTh4xfB tjEL8ElM2jYdqIgDKM4r0dEmBFHiIfG6bTMbxMs9jBJTn29gnMAouYCRYRWjeGppcW56arFh Xmq5XnFibnFpXrpecn7uJkZgJJ/+d/zTDsavl5IOMQpwMCrx8L5oCo8WYk0sK67MPcQowcGs JMLrchgoxJuSWFmVWpQfX1Sak1p8iFGag0VJnFfaJyJaSCA9sSQ1OzW1ILUIJsvEwSnVwBj6 Oq8ufdGfkovvcr6WtJRsmntl1WnPYy80Zj5Ru/7Zkm3xjHcXIi679B8y5ROr/KHzf3HPetX3 +atmTq42M3FtvS+/cuoD7/LpDHe9P/ZvaNPO/hygdn1CZHJNdNa81VtCPRIffq+qcHXddvv1 XZ+XO1Jdpkqs0m3er2a1/MHBStN//nvUGuWVWIozEg21mIuKEwGOHcJ94AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsVy+t/xa7qlsyOiDRa+FbW4te4cq0VTx1tW i40z1rNaXPn6ns1i0v0JLBbnz29gt+icuITdYsb5fUwWC17eYrFYe+Quu0Xr3iPsFj93zWNx 4PG43NfL5LFz1l12j9kdM1k9Nq3qZPO4332cyaNvyypGj8+b5ALYo7hsUlJzMstSi/TtErgy Tj6fx1owu5ux4tzJOUwNjH0lXYycHBICJhJTFhxl7GLk4hASWMIoMWvKChYIp5FJ4u35h0wg VWwCmhJ/N99kA7FFBDIlLq1tZQaxmQX6mCVWHFQDsYUFvCWePW5jB7FZBFQlJj25CWbzClhI 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