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: 12439119 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=ham 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 211C2C4338F for ; Mon, 16 Aug 2021 19:29:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AB92D60E76 for ; Mon, 16 Aug 2021 19:29:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB92D60E76 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.infradead.org 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=gZzn1YcztgDKC4e0elOOEJTuHoyevVddhi/KLVgI1bo=; b=Q8KFH4YU+zHm+O KutIYIRuasp7yocwRDVvQPNvt8PgNJWHZXKQPZjCtD7+edFTHCuzy9YmN1/3vdOg6It4FiejWfy53 fhwNaJ/c9qlc1ne2+EHWsbjKUo7ZY9T7J0OssZEGp/1ZXs9rqjJsZQw9P6cZpLHBz4FheRWNKxH33 TkXcWb6/Mban+mVu6Ot+VILCNdeBieswKWzwrg2071wpgWIoKQWsFKpGmy7W3Fbg070VukhZTGk1D snz+KRsVkPA7Uy3kDv/baIXpmt/4XxhNeAmCuSzt35d4gK0No7h5if20Zu77/JNRZwbpP0NvXqxze qUrZ09SO1jAa2+Yp0h1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFiIk-0009bd-DW; Mon, 16 Aug 2021 19:29:38 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFiF7-0008JF-1P for linux-mediatek@lists.infradead.org; Mon, 16 Aug 2021 19:26:03 +0000 Received: by mail-wr1-x42c.google.com with SMTP id q10so25143429wro.2 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=AK7mpBuBCqRtmk1RMX7QNS64xcRFzuXe+H8dP/R8wD335uORKDXE+m9nOYd2Bj0qjV HpHL9FK87UaXmX/c4FqpMuGAWQEAEirM2LptOVH1PVDizmm3d8xqRu7thXf0BBKbXB03 d3OLCDJclygO0ZEYYqXYZRtJWLMNC2l2XXaaGdJzZRHRxcXXMfyDlBY2d3CZDXNZ9yxM NpAdsWouAf6+sycdUrpPEvsi+Hdk0bwz31nJRh/+ViVz+kpIj5NvqOn2td72Daqqwb5c tzrQimYJLBY4kKnwixDCHYkc12RyFFuDYT2gQ+QsXRUarfmKNm2xEVIucFq/9hqt4qM9 NwIA== X-Gm-Message-State: AOAM530TuBEbdNr1vHk+OcJwzfSZ1/PIV+J/KlWtx6coKzvqGMExfR9a n5XytLhfBCeM0tAtAGJQjXyT/JHkirU9yw== 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-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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