From patchwork Mon Sep 6 19:35:29 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: 12477319 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=-14.3 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, UNWANTED_LANGUAGE_BODY,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 3E3E7C433EF for ; Mon, 6 Sep 2021 19:39:35 +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 EB66960F25 for ; Mon, 6 Sep 2021 19:39:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB66960F25 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=cVTHShFx27uR9IpquFEHxjkazwIXSdcNvN9AycjTfTk=; b=ROku4yzrIZPXzO btIBw1F0Yw0mqbyR6wJYYFLWYs19tkkLogY8RgaR9KGsrQO6vL25+3Md7aIT3pzqUztQ/frQjidJL ii5JkctcdcWVFI9LhC4oI9//k9MqDRNwhYhmJTw8/upIsVybXubwXatRaWAp1Mw6AvceUWiN0D4fp Nn0+ol1zS4UASYjPV1ZFNKkq+z/ETQ4y/YP2KOVwWvVRyQOSyeLbYJPyLPS0jm1dhogKIH0mWLBcN QRCyDqdSK/DrfOS9zhS6IY6jZIpzJm41dhJOX7UlSlz0yyY+iMXJOZyK3Vk5Oz3hPewCoyvL/ayJF CzFB2HxscoMijUxu7IUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNKSd-001mV5-AB; Mon, 06 Sep 2021 19:39:19 +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 1mNKQV-001lUG-85 for linux-mediatek@lists.infradead.org; Mon, 06 Sep 2021 19:37:20 +0000 Received: by mail-wr1-x42c.google.com with SMTP id v10so11200017wrd.4 for ; Mon, 06 Sep 2021 12:37:07 -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=PDl2OuYuFUh1S/pTb5gLEsrJEEY+6BdmuC4NdG//FKM=; b=XsFMABhwRWmCkcBPfdaWXDBotNWC4x0FbiMGMpu1yP+IUws/AUvvHSYwXdCOOt3DJG 9Hj3M8NG0PtFSMjPIQSEwg0w6w5AokFlo+msYyItXhTQH7SSB+l7yFyYBgoBl9d/Uvln 9mgvl7+3EaSYdEleTfQzcQxMXWlbAsVC7nGmMY9prhiNLWOh6Ab7cPr5bFf3L9Fh1qB7 vyTF5bOefdnoEqcn3iAQNjF3NmdiWXyUccNFRAJzoZG98zdXUA9lVGVvU/4Z82Y4hKH8 i/GiNvAeANPq80ulsJ8mU7MXSR6QzShriDFQ4krVIGuBT3o3rxjHAA2Tm6KjbWFNzbMT 7FFg== 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=PDl2OuYuFUh1S/pTb5gLEsrJEEY+6BdmuC4NdG//FKM=; b=Uu/I5pADi20++/AVhZO6Ki/EwbWzGHNA6z/rKv194zkmHJR91BBDNZb/9eIbz27TUJ SO4a7dCiDr80fQFAduhO3IA9VU3wPSb3LTg8eJ08BYZA34YgG75yN4nvLSpw12icDovf BA/cWQMHMyff8Bruvz0QrZJMz1Onpe/rtTvaUuUoH0FHsrlhSTpDkfBvnLMHuDn1zjjm SVuQyJc9SapexzscOtKEvSQnk0+plDnQb8/PhzBMkLub04/uJ5ewlbsGTPyVNWeXc08c bb8ElsMGVkDP63paC22Olx/zjRDCYFx3DS4/siQ03tO/xvTHXxD0XGf1QE7/Gqdcwlhu 2r9Q== X-Gm-Message-State: AOAM531EK7Hu6TBZtV3VKu/kq4xOU2BSoe18k76HpMOZnwgqOebxzuRS rTSlpgFP86zXB3PTAvAXbMJ6Fg== X-Google-Smtp-Source: ABdhPJzwvjNgyFGDGnjXfk2/wBSpz6ySSWSq420i4rviw7XM3PpEWx+GfeoSrQO5QQ4nfRMP9ihRCg== X-Received: by 2002:a5d:5150:: with SMTP id u16mr15370422wrt.156.1630957025532; Mon, 06 Sep 2021 12:37:05 -0700 (PDT) Received: from blmsp.lan ([2a02:2454:3e6:c900::97e]) by smtp.gmail.com with ESMTPSA id w29sm8815202wra.88.2021.09.06.12.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 12:37:05 -0700 (PDT) From: Markus Schneider-Pargmann To: Chun-Kuang Hu , Philipp Zabel Cc: Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Markus Schneider-Pargmann Subject: [PATCH v1 6/6] drm/mediatek: Add mt8195 DisplayPort driver Date: Mon, 6 Sep 2021 21:35:29 +0200 Message-Id: <20210906193529.718845-7-msp@baylibre.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906193529.718845-1-msp@baylibre.com> References: <20210906193529.718845-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 --- Notes: Changes RFC -> v1: - Removed unused register definitions. - Replaced workqueue with threaded irq. - Removed connector code. - Move to atomic_* drm functions. - General cleanups of the code. - Remove unused select GENERIC_PHY. drivers/gpu/drm/mediatek/Kconfig | 6 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 2881 +++++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 580 +++++ 4 files changed, 3469 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..6d6a5b5872f2 100644 --- a/drivers/gpu/drm/mediatek/Kconfig +++ b/drivers/gpu/drm/mediatek/Kconfig @@ -28,3 +28,9 @@ 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 + help + DRM/KMS Display Port driver for Mediatek SoCs. diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile index 3abd27d7c91d..ba6e2228bbf8 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -25,3 +25,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..1bd07c8d2f69 --- /dev/null +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -0,0 +1,2881 @@ +// 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