From patchwork Sun Mar 27 22:39:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 12793027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1972C433EF for ; Sun, 27 Mar 2022 22:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=52jXHSYodwcE/3JtB3d9onLVHq7cOK9aWitxhOp5co4=; b=i9s1yQZ/Mt8dZw 3wzL6oPUn43F+QsKtzxVAQbnVfu1r/4vJPHN+1EqGrfPk53UpRyQ0634VaXfkaKpp1vUfmsQo+wcA PPIjUXtsu3Yreopv7PZXwjOKYu895HFan8Vtb/JJvZ7ofAEpfXYqizA0M3iGv3Rtt8/plQjLnaFyJ uVGF56VCHZFIfVE//r3rTLYIBvdP6LaJuUl+D6JvMi9S8GgXbA5M8aQG9JXI/ilYKVTKcq7QKGaFR VEcLB7yBVokRw8f2QLiX7yVvnNR5+wd0ZOMbY1hRe1o1R/GtVVWYqlOLDzcNUbtkQY3wk8WCamWbl yH2mqTqdAg6xhZlq9yOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYbio-006aPZ-4I; Sun, 27 Mar 2022 22:50:54 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYbZj-006VHl-D6 for linux-arm-kernel@lists.infradead.org; Sun, 27 Mar 2022 22:41:45 +0000 Received: by mail-wm1-x32a.google.com with SMTP id r204-20020a1c44d5000000b0038ccb70e239so2571836wma.3 for ; Sun, 27 Mar 2022 15:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YZph5ifPxL5uVmjYTfQo6EGmMKT+tqcL6/MBH2RFjf4=; b=FYL3MUZyWfXfmw7McJAYpUgBfnSLr/+glsnDllGUsLyX8Bc3k96gQzF3qJqF7/n/Oc h8t3Wk8MoomrpEir6S8IyIIM4bdAQQGN16UVrUKWHO+x66bRzXbazkjoGy+Qy+r8b8j0 /KOAYeCFjfRmd5/Oid2+9R4crJxuKRhv+qr1z9ohN3POqqpD3shSEOKBZYte8+/E6+OA NmYvOG6hT61i1MkOfphOR4REQDd5GtL7yJeSF6OCqHkzgigHO+60n95TLM/BjjLN+uAF 3TtFvGEzUoGROawW+8adUGvLJmUCP8QlUsVSkmApGrINwItJmNEUW76hwVCmgh6OIb8Z MHLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZph5ifPxL5uVmjYTfQo6EGmMKT+tqcL6/MBH2RFjf4=; b=rNDWY2Y+FsSy4p8uKHrat93WtqpvAoeHPOX7T1fPRvCXmF+RD6c/DocC5KrtbW7kaa 7reFGVD8bsnRGLl00ZLX6DW8/nl891INlNVi8hQd/atpLLJyYZRXStV0T/IXqZgWuD/Z t+QL4puUwjo0cZtSL8t4t0zxxgnWqxbfoH0KPlXi5P36gaaeWM5OYAMt7BdKbg4KI2v8 F+iqLYpTDMZBxCpejX5VH36m4KTLUfaHq8+mkLc+YSYCjmrQb8xQgwkeEf3jM8XgXVWh laj0uAaqIevU1dFMx5Rwr9cCASFM/x6rxUZUsFqnPlqFmsqwKhYD0YNweYm4LLPtTOAM gpBA== X-Gm-Message-State: AOAM532R2+pYTGXR08wdrnERpg+IodxmzA2VFiaMKRXhZc3Oq6F/d5Y9 jCfuRYd4Z7k8q697/5qkvj4Udg== X-Google-Smtp-Source: ABdhPJwFgaFVB8A5AvKVJGjA0aolOBdRPt9bfKisJXAztKDujSSlp241WM3LfsALaOpf6VbP5sNpJQ== X-Received: by 2002:a05:600c:190e:b0:38c:b1ea:f4ac with SMTP id j14-20020a05600c190e00b0038cb1eaf4acmr22183788wmq.70.1648420889357; Sun, 27 Mar 2022 15:41:29 -0700 (PDT) Received: from localhost.localdomain (2a02-8440-6341-357e-3074-96af-9642-0002.rev.sfr.net. [2a02:8440:6341:357e:3074:96af:9642:2]) by smtp.gmail.com with ESMTPSA id v5-20020adfe4c5000000b001edc1e5053esm10400867wrm.82.2022.03.27.15.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 15:41:28 -0700 (PDT) From: Guillaume Ranquet To: airlied@linux.ie, angelogioacchino.delregno@collabora.com, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de, vkoul@kernel.org Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann , kernel test robot Subject: [PATCH v9 18/22] drm/mediatek: Add mt8195 Embedded DisplayPort driver Date: Mon, 28 Mar 2022 00:39:23 +0200 Message-Id: <20220327223927.20848-19-granquet@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220327223927.20848-1-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_154132_044160_129DB5C4 X-CRM114-Status: GOOD ( 28.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Schneider-Pargmann This patch adds a DisplayPort driver for the Mediatek mt8195 SoC. It supports the mt8195, the embedded DisplayPort units. It offers DisplayPort 1.4 with up to 4 lanes. The driver shares its iomap range with the mtk-dp-phy driver using the regmap/syscon facility. This driver is based on an initial version by Jason-JH.Lin . Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Guillaume Ranquet Reported-by: kernel test robot --- drivers/gpu/drm/mediatek/Kconfig | 8 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 2221 ++++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 568 ++++++ drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + 6 files changed, 2801 insertions(+) create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig index 2976d21e9a34..03ffa9b896c3 100644 --- a/drivers/gpu/drm/mediatek/Kconfig +++ b/drivers/gpu/drm/mediatek/Kconfig @@ -28,3 +28,11 @@ config DRM_MEDIATEK_HDMI select PHY_MTK_HDMI help DRM/KMS HDMI driver for Mediatek SoCs + +config MTK_DPTX_SUPPORT + tristate "DRM DPTX Support for Mediatek SoCs" + depends on DRM_MEDIATEK + select PHY_MTK_DP + select DRM_DP_HELPER + help + DRM/KMS Display Port driver for Mediatek SoCs. diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile index 29098d7c8307..d86a6406055e 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -21,3 +21,5 @@ mediatek-drm-hdmi-objs := mtk_cec.o \ mtk_hdmi_ddc.o obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o + +obj-$(CONFIG_MTK_DPTX_SUPPORT) += mtk_dp.o diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c new file mode 100644 index 000000000000..7cd8459cf719 --- /dev/null +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -0,0 +1,2221 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019 MediaTek Inc. + * Copyright (c) 2021 BayLibre + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include