From patchwork Mon Aug 16 19:25:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 12439151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96039C4338F for ; Mon, 16 Aug 2021 19:45:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EDCF660F41 for ; Mon, 16 Aug 2021 19:45:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EDCF660F41 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8C2D6E049; Mon, 16 Aug 2021 19:45:34 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by gabe.freedesktop.org (Postfix) with ESMTPS id 754506E048 for ; Mon, 16 Aug 2021 19:25:52 +0000 (UTC) Received: by mail-wr1-x434.google.com with SMTP id v4so17971875wro.12 for ; Mon, 16 Aug 2021 12:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/XfYFIYwy/HkujSVpOAeCSjRnFWuHt2xEmDcZy3F/4Y=; b=S85xAQN6w1FtqeHt1YXtSmFEOjPaNOnNwspAVDXg199BhDU7XBNwSl/5i5wcYpTGaH Myu5QsY/UdjKor2I4MpIpq0BZDsPPFv3bsK7Z35xgl533WZA7ssfLfU1xBMqnvbGUF3o R8RCkdG7HE3SHT2JY3aIAa/buJXj6oriK7AEW0ZXALHn8z1BVMcnAFIgvDB1R52OMr4+ 9RXSocIV0RbApSGTthHcplt5jzMYJ1ZR6LnmCYtswPADscZ40XRzLnTbgpDwsxQTdHLM pjEIFG7xCVDFiwtZ97kuDaJrr6rk337TOOIxkZcCc0F88eMVNI2A9yQNV8AHztKwfnS4 c9Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/XfYFIYwy/HkujSVpOAeCSjRnFWuHt2xEmDcZy3F/4Y=; b=Id/ptWWgo4fztcjjqmxvxnU/5l8Tx9/RVcHcqqr0kqUcQIchkZrOIeBuzH/pFFt1Dk YeWV6fm8MyTR/L1aByKSDeTBkCAZ1NBHzWZxgefqwq2YHXKc6rgtNTLA0gFaDPRZoCTg wBf1oy6by9ilWKXCe7ffKDh4FUItL2ttHH9CpT16a23a9pyRKj2w7a8OxqrfwWMkOHHF 2vVv8/SNaNOnJwmETgABaoS3eaXzhTnrUpdN7KbDsbykijOgZ8yGSbqs/QItsB6GEBOJ 51JLuGEi94YRlQSurBBjX6bleOX0ZR+hVB6p6niJGrSyqgOP4XvYS51TjBI6e+beLV1H /vkA== X-Gm-Message-State: AOAM533KCq/ChmjI3kLIFyIqoJxc6XArDa9CcZ5Ddaiz+6UvYuTdb6Ea q7HJF9kybWLiYIJo58sXRmqlXA== X-Google-Smtp-Source: ABdhPJw3jfeZIRgdw9Um2xmvFRnS0MnRpKmcR7W1UGKYD0Q3/yCaet5CgdvMqwZIu/cCEkTbqLHu8w== X-Received: by 2002:a5d:4c4e:: with SMTP id n14mr69719wrt.226.1629141950515; Mon, 16 Aug 2021 12:25:50 -0700 (PDT) Received: from blmsp.lan ([2a02:2454:3e6:c900::97e]) by smtp.gmail.com with ESMTPSA id k17sm333954wmj.0.2021.08.16.12.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 12:25:50 -0700 (PDT) From: Markus Schneider-Pargmann To: Chun-Kuang Hu , Philipp Zabel Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Markus Schneider-Pargmann Subject: [RFC PATCH 5/5] drm/mediatek: Add mt8195 DisplayPort driver Date: Mon, 16 Aug 2021 21:25:23 +0200 Message-Id: <20210816192523.1739365-6-msp@baylibre.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816192523.1739365-1-msp@baylibre.com> References: <20210816192523.1739365-1-msp@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 16 Aug 2021 19:45:33 +0000 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a DisplayPort driver for the Mediatek mt8195 SoC. It supports both functional units on the mt8195, the embedded DisplayPort as well as the external DisplayPort units. It offers hot-plug-detection, audio up to 8 channels, and DisplayPort 1.4 with up to 4 lanes. This driver is based on an initial version by Jason-JH.Lin . Signed-off-by: Markus Schneider-Pargmann --- drivers/gpu/drm/mediatek/Kconfig | 7 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 3025 ++++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 3095 +++++++++++++++++++++++++ 4 files changed, 6129 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..d81eb3521c1c 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 GENERIC_PHY + help + DRM/KMS Display Port driver for Mediatek SoCs. diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile index dc54a7a69005..6b9d148ab7fe 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -20,3 +20,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..055ab816937f --- /dev/null +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -0,0 +1,3025 @@ +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include