Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3719340rwb; Mon, 5 Sep 2022 17:36:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6cnJZn2kp1pH3od7fmltvmaKeequW6m7K4h3Of1Prd6KARo7eYpx/pecOb3uPwnshWayRj X-Received: by 2002:a05:6402:34c6:b0:43d:8cea:76c0 with SMTP id w6-20020a05640234c600b0043d8cea76c0mr46854024edc.268.1662424599797; Mon, 05 Sep 2022 17:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662424599; cv=none; d=google.com; s=arc-20160816; b=Woii0bzSI110xWCQyCxQKviSqf/fL+lcnkPX5SZvm3w7QIGiXO8NZofXDJnH4d6kVC OldjIan1PHLIvnnhtHpCEL+Tk0X7vGC3A6fYyb+jBqpXMnr7ByNfNeB5nTVc0r+p360+ UvcJapWrkGoufkUuqoFV6R1SJHKWJ6R5OWzUr078eCdr+t5coHgGXe0Jkv3kAY00UNZ6 k4imk18sRr3D1I/mjKrYCh6z2YPgLp8UlZO9nzC/bjbyWbC5j8XXHVJH+1MNhXtZweqH xAlzB+WzjTO9+0APby8CohXP9Kb0tEJJBUtSnRo9tCeRalA1m+87c81dKntyGuaeMpPv n6fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=m3LDgAKJxaJg9PpJj0i7Ohs7ZKByFbwNIQ2cg+Ecots=; b=eJpYQOve/OqAo8RzOsC+cy9OEfhV4Z0zWr0GlljLQJJyB1IWqMmBuJ811z/ngGo1oy 2jE28NF24bhTyqyKeDipYh/dIpjfh3HCR+/NiswVqZnBtPjI7RJyJLDhO6zyWSwOTW5W CrSKNXHHxviQnlKsZaYQw2iRO6XSM1mYyXFlzoY71pNq3Ps8B2q+QiDdX6YIMOBd2SZk xmm2udwZNncSeiD1B7jlWhkM+SyEZyjvzMHkFvpjKI3qPHzGX1r9CGExfRBjMVKun/KK LX0oymfnhL1z2B0Q6ycByHmlQH2GDrBK+3l6CIlgQLHNJxRNOO9qsB8uPwoHKKRt15AE +ggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kFwY5KqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc37-20020a1709078a2500b007317d093e6csi8428930ejc.808.2022.09.05.17.36.13; Mon, 05 Sep 2022 17:36:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kFwY5KqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbiIFAHu (ORCPT + 99 others); Mon, 5 Sep 2022 20:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbiIFAHs (ORCPT ); Mon, 5 Sep 2022 20:07:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 738D66747C; Mon, 5 Sep 2022 17:07:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8FEF611A0; Tue, 6 Sep 2022 00:07:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FBCAC4314A; Tue, 6 Sep 2022 00:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662422864; bh=RxQyOvfbzTJkC9ckq7/uP41kOb0nxGHixfMNPEkB6RA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kFwY5KqNb6b9n8NOFXWpz+HYE6YVqjx81SNPB3/oVYGTK/5yH6Qxt+hzvmJ1+EX4U OhRXHIFyanQEwG9zkjd+4s23X61mcSLowRhl8eWZ2EnDcUppJ0nWDankWF0QuGbVy+ 3tfa9yTR51+Tg5UP8lJsxurCae1k7Loh8OeXAkdhidCGQjF7pQRh9+Uov/ulAF3rmr U+qBDamFkwwILDWq2syCyM1uzyFPoai1ofg7kMKWuIYnlz2kl7DkJJjPdWcJkXfXcL Rf6uwwSNThoi4EYMAnK/atlZ9pTbmG4NpYz398rd+FH7sbtaY4bpD1eUJsNj0OEyUS jABPKtUT/6P0w== Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-1272fc7f51aso11272385fac.12; Mon, 05 Sep 2022 17:07:44 -0700 (PDT) X-Gm-Message-State: ACgBeo1eGZ6HZ3CC0eAbQn54VEIs5K3bDeyHapw7wzfgWx9rwldm9k0r 2HXG05MNPtXD/tibvK+nwcOuTrtGcnxZMmYnbg== X-Received: by 2002:a05:6871:96:b0:11d:ca1b:db19 with SMTP id u22-20020a056871009600b0011dca1bdb19mr10929345oaa.74.1662422862591; Mon, 05 Sep 2022 17:07:42 -0700 (PDT) MIME-Version: 1.0 References: <20220901044149.16782-1-rex-bc.chen@mediatek.com> <20220901044149.16782-4-rex-bc.chen@mediatek.com> In-Reply-To: <20220901044149.16782-4-rex-bc.chen@mediatek.com> From: Chun-Kuang Hu Date: Tue, 6 Sep 2022 08:07:21 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v17 03/10] drm/mediatek: Add MT8195 Embedded DisplayPort driver To: Bo-Chen Chen Cc: Chun-Kuang Hu , Philipp Zabel , Daniel Vetter , Rob Herring , krzysztof.kozlowski+dt@linaro.org, Maxime Ripard , Thomas Zimmermann , Matthias Brugger , deller@gmx.de, David Airlie , Markus Schneider-Pargmann , Guillaume Ranquet , Jitao Shi , Chen-Yu Tsai , AngeloGioacchino Del Regno , CK Hu , liangxu.xu@mediatek.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Bo-Chen: Please help to fix the compile warning: ../drivers/gpu/drm/mediatek/mtk_dp.c: In function =E2=80=98mtk_dp_video_mut= e=E2=80=99: ../drivers/gpu/drm/mediatek/mtk_dp.c:947:23: warning: format =E2=80=98%x=E2= =80=99 expects argument of type =E2=80=98unsigned int=E2=80=99, but argument 4 has= type =E2=80=98long unsigned int=E2=80=99 [-Wformat=3D] 947 | dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n"= , | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/linux/dev_printk.h:129:27: note: in definition of macro =E2=80= =98dev_printk=E2=80=99 129 | _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ | ^~~ ../include/linux/dev_printk.h:163:31: note: in expansion of macro =E2=80=98= dev_fmt=E2=80=99 163 | dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ | ^~~~~~~ ../drivers/gpu/drm/mediatek/mtk_dp.c:947:2: note: in expansion of macro =E2=80=98dev_dbg=E2=80=99 947 | dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n"= , | ^~~~~~~ ../drivers/gpu/drm/mediatek/mtk_dp.c:947:36: note: format string is defined= here 947 | dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n"= , | ~^ | | | unsigned int | %lx Regards, Chun-Kuang. Bo-Chen Chen =E6=96=BC 2022=E5=B9=B49=E6=9C=881= =E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=AD=E5=8D=8812:42=E5=AF=AB=E9=81=93=EF= =BC=9A > > From: Markus Schneider-Pargmann > > This patch adds a embedded displayport driver for the MediaTek mt8195 SoC= . > > It supports the MT8195, the embedded DisplayPort units. It offers > 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 > Jitao shi > > Signed-off-by: Markus Schneider-Pargmann > Signed-off-by: Guillaume Ranquet > Signed-off-by: Bo-Chen Chen > --- > drivers/gpu/drm/mediatek/Kconfig | 9 + > drivers/gpu/drm/mediatek/Makefile | 2 + > drivers/gpu/drm/mediatek/mtk_dp.c | 1999 +++++++++++++++++++++++++ > drivers/gpu/drm/mediatek/mtk_dp_reg.h | 305 ++++ > 4 files changed, 2315 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..e66f4a3b6be0 100644 > --- a/drivers/gpu/drm/mediatek/Kconfig > +++ b/drivers/gpu/drm/mediatek/Kconfig > @@ -21,6 +21,15 @@ config DRM_MEDIATEK > This driver provides kernel mode setting and > buffer management to userspace. > > +config DRM_MEDIATEK_DP > + tristate "DRM DPTX Support for MediaTek SoCs" > + depends on DRM_MEDIATEK > + select PHY_MTK_DP > + select DRM_DISPLAY_HELPER > + select DRM_DISPLAY_DP_HELPER > + help > + DRM/KMS Display Port driver for MediaTek SoCs. > + > config DRM_MEDIATEK_HDMI > tristate "DRM HDMI Support for Mediatek SoCs" > depends on DRM_MEDIATEK > diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek= /Makefile > index 6e604a933ed0..3517d1c65cd7 100644 > --- a/drivers/gpu/drm/mediatek/Makefile > +++ b/drivers/gpu/drm/mediatek/Makefile > @@ -23,3 +23,5 @@ mediatek-drm-hdmi-objs :=3D mtk_cec.o \ > mtk_hdmi_ddc.o > > obj-$(CONFIG_DRM_MEDIATEK_HDMI) +=3D mediatek-drm-hdmi.o > + > +obj-$(CONFIG_DRM_MEDIATEK_DP) +=3D 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..e2ec9b02b1aa > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -0,0 +1,1999 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019-2022 MediaTek Inc. > + * Copyright (c) 2022 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