From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.2 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 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 9F60DC433FE for ; Mon, 20 Sep 2021 17:32:39 +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 2468163355 for ; Mon, 20 Sep 2021 17:32:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2468163355 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CKqsW7eWV2kAOlCe4HuvXtD80Dzx9bq0mOeXSuKXaJo=; b=zhg3OiE6lnACIN KGqH00TEGI7t8BGe9UbrErQB8AuNHlKUDe246YpPyEKSezVt9/SNhdZaqDHXmA38Fv7OVjVGW294V tFsOMBT0SUmW3Si1EcdPcFbSo8tswfYwJ1hEzywsgN73w8RoC9UCRMJDD22nh/KcSxqhFC11n/wB6 xlSkhGFX1uZyloRG1lxj09EBwJldLxBU9erx+5l08U5UG8cT1EOwLLnY4tHa2KBepDOXlRvVDHxAV 5B/2VW5tMIIMwI1QLeWYpzxCXro1XFOX9mNnFTBYQwXy9grlHj97JpUVRo9c+uf6tzgE8dKNP6WgE 2OQWUhUo1/BDUGmvRbqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSN9P-002dN5-IX; Mon, 20 Sep 2021 17:32:19 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSN9I-002dLQ-Aj for linux-mediatek@lists.infradead.org; Mon, 20 Sep 2021 17:32:18 +0000 Received: by mail-wr1-x432.google.com with SMTP id x6so31884892wrv.13 for ; Mon, 20 Sep 2021 10:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NwXCj3bcP8ojbOr8/VcWs9aAxo03tDyW/whNTjZ1N/s=; b=1zGzMPPdGvQ+1rX63VeUReYN0Ah85E/qw7nF+CkzjI8NdXfjFavlAGXET16yGXzeUL BGRpHLcoTl+4ILkgIx9AplecGMBsnb7BIBIOM2MEHCFSk0Sp/8h4dfpS2pxzfifxd1qs vlavJiiZMtH/iC2s9ajyKYGj/BHpdmv2KZXG1LB8mPvhry/5meDK336t0wqW6k8X+UK7 iuCwDSONTbWYIuJzpbh64r7DAJdlrTkodO3dUq6d3FcnumguY3NE0OEdCn02l5qsA5Z7 L3HKYgNEenBLtseukbbAN+l7nT/9RjT9/Ncf4yPB0MnCQCrZoOxrQt4LiQ+xekWY8ZZO eWUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NwXCj3bcP8ojbOr8/VcWs9aAxo03tDyW/whNTjZ1N/s=; b=i4UjTji2HWFdmevgH8Btgdy/wV98fVSrxG5YAvcIr1jL7yfMFtCVa7PHiJYbc255B7 BR/KNkfwyg8kSRs4jBKP6dxof4D7Ov+s6t1Nv79RgvzqQuVs9H7y/p/izUTsApWjb6/X aguWFRQidHa1b4yZ/map1/U/qnMPyj5jSHBB74ykxelz9PdpIhT/maIBCUh6vkgoUx/7 TW4QTivjaLapOpcv/ijG72on36/WuNQuHaHzk2c5eBgcZwySWAC/Nw1rYG5Kgaoyf9h8 Oign2mYP22Fcp5bQ6K4QtWnbTwQ+mxJwGtpYJQP/TCuEKxGZoY6+03WINBgR6a84TR5t laaA== X-Gm-Message-State: AOAM530JdNLPxM6EYHcHK8I1GHJRO+SmHCvF1Xg3pFMB5JkPztbjmx3/ EjGbkFytyZZD1+WkHKaGJCErog== X-Google-Smtp-Source: ABdhPJxbnmyMoG6LdD2cR4c1zTu5bCtKsGmotJosyk0g8cHPO6Ot2UD3+4LTqLoVit1rCND7XdRSJA== X-Received: by 2002:a7b:ce06:: with SMTP id m6mr187378wmc.85.1632159129768; Mon, 20 Sep 2021 10:32:09 -0700 (PDT) Received: from blmsp ([2a02:2454:3e6:c900::97e]) by smtp.gmail.com with ESMTPSA id w1sm161944wmc.19.2021.09.20.10.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 10:32:09 -0700 (PDT) Date: Mon, 20 Sep 2021 19:32:08 +0200 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 Subject: Re: [PATCH v2 6/6] drm/mediatek: Add mt8195 DisplayPort driver Message-ID: <20210920173208.kekbktcoobmburlc@blmsp> References: <20210920084424.231825-1-msp@baylibre.com> <20210920084424.231825-7-msp@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210920084424.231825-7-msp@baylibre.com> 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hi, I just noticed that I left some partly old TODOs in the code. Just ignore these for now. I don't expect this to be the last version so I will fix/remove them in the next version. Best, Markus On Mon, Sep 20, 2021 at 10:44:24AM +0200, Markus Schneider-Pargmann wrote: > This patch adds a DisplayPort driver for the Mediatek mt8195 SoC and a > according phy driver mediatek-dp-phy. > > 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. > > 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 > --- > > Notes: > Changes v1 -> v2: > - Fix checkpatch --strict suggestions > - General cleanups of the code. > - Remove all remaining non-atomic functions. > - Remove unused includes and sort them. > - Remove unused select GENERIC_PHY > - Rename phy registers DP_PHY -> MTK_DP_PHY > - Replace usage of delays with usleep_range. > - Split the phy register accesses into a separate phy driver. > - Use a lock to guard access to mtk_dp->edid as it can be allocated/used/freed > in different threads > - use struct dp_sdp for sdp packets. > > 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 | 7 + > drivers/gpu/drm/mediatek/Makefile | 2 + > drivers/gpu/drm/mediatek/mtk_dp.c | 2855 ++++++++++++++++++++++++ > drivers/gpu/drm/mediatek/mtk_dp_reg.h | 498 +++++ > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + > drivers/phy/mediatek/Kconfig | 8 + > drivers/phy/mediatek/Makefile | 1 + > drivers/phy/mediatek/phy-mtk-dp.c | 218 ++ > include/linux/soc/mediatek/mtk-mmsys.h | 2 + > 10 files changed, 3593 insertions(+) > create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c > create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h > create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c > > diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig > index 2976d21e9a34..029b94c71613 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 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..5d95ff68b0df > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -0,0 +1,2855 @@ > +// 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