From patchwork Fri Dec 17 15:08:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 12685019 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B65C1C433EF for ; Fri, 17 Dec 2021 15:09:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A0B3112AF2; Fri, 17 Dec 2021 15:09:37 +0000 (UTC) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1623A112AF2 for ; Fri, 17 Dec 2021 15:09:34 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id a9so4622653wrr.8 for ; Fri, 17 Dec 2021 07:09:34 -0800 (PST) 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=KJherw28pnVAXYmEWSXbhersLyRnnmRnoLKFlrBS1hY=; b=Rp28AGdwqxdZs6aFjfO3z8fkbt5YRzdmEClP7LKQL6la769nQOZcAoTb+qeMD1LTm/ HHWh6hrifOW/sfjlQ7RwQPyv8O77ikw41ih5XMhMktPOaScKbsFHYrI/bdd+E+A1qyij bb4NTEZckuxt79SLlyLDRYM0EMDsY0PeKuMYNSVqb39HB/JSxrdUaw6R1+ymB2xRHPPq OPLIQ3F8RqxIbylAMZYQPZ503cK4ebzyqWSZMwJDhmOeX/FaRdPanH6Nm/QgiaxfBHJ/ KRtkQ3IpgNqWglL9nXRAEApbpf2WQ8rwbYd2mYHlFRwEMLMD6LN3cby6F39twKVdCCpR vkJA== 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=KJherw28pnVAXYmEWSXbhersLyRnnmRnoLKFlrBS1hY=; b=7SLIWC5LYFLtnOdys2XD2sjdAeE2SVuTvEs63OvM9xGd1Ip+brExx4vqcJGaqNg0eH 5VcFw4udyM1UQqQjwu+LZdLqPeE1cXTLpevIw+i/26GHnuvN6o+lfXP/JlqQVHMw3pOM qPnHG8yD3IWOVEY3IFQWiawcT5mknIgNnuumv+xSu6Q7NhtPbU1ewKMnHnrLqJl3iFK6 9rd9O6EYr/ujGWiPqeu3TXOhBvwkM3GreWuv4ZHdth7Vb552NbCNS1w9WO2z4OCU86gG cRjOx28wkc3lgvaDf4LTiNUqed5gZP5g80auuN0tc9c6p8DoePWPUupvhlDxFWyvgGsx iyeA== X-Gm-Message-State: AOAM530xxqyM5J3RYqv0fRV6n1Tb0YNGFgeshEWGoCMJuR5qFYgZIxPT vUyWOSMrCbMtypEj2BcRLwJWxA== X-Google-Smtp-Source: ABdhPJyVPE51dxBhUVU+MTfUCNx4E1XziIhLblWuYdXaV84dFIUMSxvTIS7vQ6D4i0Hcc83o4an4jA== X-Received: by 2002:a05:6000:144d:: with SMTP id v13mr2959694wrx.393.1639753771845; Fri, 17 Dec 2021 07:09:31 -0800 (PST) Received: from localhost.localdomain (2a02-8440-6441-43a4-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6441:43a4:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id g18sm12655132wmq.4.2021.12.17.07.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 07:09:31 -0800 (PST) From: Guillaume Ranquet To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger Subject: [PATCH v7 7/8] drm/mediatek: Add mt8195 DisplayPort driver Date: Fri, 17 Dec 2021 16:08:53 +0100 Message-Id: <20211217150854.2081-8-granquet@baylibre.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211217150854.2081-1-granquet@baylibre.com> References: <20211217150854.2081-1-granquet@baylibre.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel test robot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Markus Schneider-Pargmann , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Markus Schneider-Pargmann This patch adds a DisplayPort driver for the Mediatek mt8195 SoC. It supports the mt8195, the external DisplayPort units. It offers hot-plug-detection, audio up to 8 channels, and DisplayPort 1.4 with up to 4 lanes. The driver creates a child device for the phy. The child device will never exist without the parent being active. As they are sharing a register range, the parent passes a regmap pointer to the child so that both can work with the same register range. The phy driver sets device data that is read by the parent to get the phy device that can be used to control the phy properties. 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 | 7 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 3028 ++++++++++++++++++++++++ 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, 3607 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 2976d21e9a34a..029b94c716131 100644 --- a/drivers/gpu/drm/mediatek/Kconfig +++ b/drivers/gpu/drm/mediatek/Kconfig @@ -28,3 +28,10 @@ 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 + help + DRM/KMS Display Port driver for Mediatek SoCs. diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile index 29098d7c8307c..d86a6406055e6 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 0000000000000..41e95a0bcaa2c --- /dev/null +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -0,0 +1,3028 @@ +// 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