From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"kernel@collabora.com" <kernel@collabora.com>,
"robh@kernel.org" <robh@kernel.org>,
"Alexandre Mergnat" <amergnat@baylibre.com>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"dmitry.osipenko@collabora.com" <dmitry.osipenko@collabora.com>,
"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"mripard@kernel.org" <mripard@kernel.org>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"granquet@baylibre.com" <granquet@baylibre.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"airlied@gmail.com" <airlied@gmail.com>,
"Justin Yeh (葉英茂)" <Justin.Yeh@mediatek.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Rex-BC Chen (陳柏辰)" <Rex-BC.Chen@mediatek.com>
Subject: Re: [PATCH v4 07/12] drm/mediatek: mtk_dp: Use PHY API for PHY power sequences
Date: Fri, 28 Aug 2026 03:40:07 +0000 [thread overview]
Message-ID: <cc5504c032fea688fd9690298ff6fbd58a998e67.camel@mediatek.com> (raw)
In-Reply-To: <20260709113148.49090-8-angelogioacchino.delregno@collabora.com>
On Thu, 2026-07-09 at 13:31 +0200, AngeloGioacchino Del Regno wrote:
> The PHY driver has gained support for .power_on() and .power_off()
> callbacks: use the API provided phy_power_on(), phy_power_off()
> functions instead of writing into PHY registers from this driver.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 31 ++++++++++++++++++++++++-------
> 1 file changed, 24 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index b2e5fa0914bc..383c8e66b527 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -1404,6 +1404,8 @@ static void mtk_dp_aux_panel_poweron(struct mtk_dp *mtk_dp, bool pwron)
>
> static void mtk_dp_power_enable(struct mtk_dp *mtk_dp)
> {
> + int ret;
> +
> mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_RESET_AND_PROBE,
> 0, SW_RST_B_PHYD);
>
> @@ -1414,20 +1416,35 @@ static void mtk_dp_power_enable(struct mtk_dp *mtk_dp)
> SW_RST_B_PHYD, SW_RST_B_PHYD);
> mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
> DP_PWR_STATE_BANDGAP_TPLL, DP_PWR_STATE_MASK);
> - regmap_write(mtk_dp->regs, DP_PHY_AUX_RX_CTL,
> - RG_DPAUX_RX_VALID_DEGLITCH_EN | RG_XTP_GLB_CKDET_EN |
> - RG_DPAUX_RX_EN);
> - regmap_clear_bits(mtk_dp->regs, MTK_DP_0034, DA_CKM_CKTX0_EN_FORCE_EN);
> +
> + if (mtk_dp->phy_dev) {
You use unlikely in mtk_dp_power_disable(), so use it here.
Regards,
CK
> + regmap_write(mtk_dp->regs, DP_PHY_AUX_RX_CTL,
> + RG_DPAUX_RX_VALID_DEGLITCH_EN | RG_XTP_GLB_CKDET_EN |
> + RG_DPAUX_RX_EN);
> + regmap_clear_bits(mtk_dp->regs, MTK_DP_0034, DA_CKM_CKTX0_EN_FORCE_EN);
> + } else {
> + ret = phy_power_on(mtk_dp->phy);
> + if (ret)
> + dev_warn(mtk_dp->dev, "Could not power on PHY!\n");
> + }
> }
>
> static void mtk_dp_power_disable(struct mtk_dp *mtk_dp)
> {
> + int ret;
> +
> mtk_dp_write(mtk_dp, MTK_DP_TOP_PWR_STATE, 0);
>
> - regmap_set_bits(mtk_dp->regs, MTK_DP_0034, DA_CKM_CKTX0_EN_FORCE_EN);
> + if (unlikely(mtk_dp->phy_dev)) {
> + regmap_set_bits(mtk_dp->regs, MTK_DP_0034, DA_CKM_CKTX0_EN_FORCE_EN);
>
> - /* Disable RX */
> - regmap_write(mtk_dp->regs, DP_PHY_AUX_RX_CTL, 0);
> + /* Disable RX */
> + regmap_write(mtk_dp->regs, DP_PHY_AUX_RX_CTL, 0);
> + } else {
> + ret = phy_power_off(mtk_dp->phy);
> + if (ret)
> + dev_warn(mtk_dp->dev, "Could not power off PHY!\n");
> + }
>
> mtk_dp_write(mtk_dp, MTK_DP_TOP_MEM_PD,
> 0x550 | FUSE_SEL | MEM_ISO_EN);
next prev parent reply other threads:[~2026-08-28 3:40 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 11:31 [PATCH v4 00/12] drm: MediaTek DisplayPort cleanups and MT8196 eDP AngeloGioacchino Del Regno
2026-07-09 11:31 ` [PATCH v4 01/12] dt-bindings: display: mediatek: dp: Deprecate nvmem efuse data AngeloGioacchino Del Regno
2026-07-11 15:08 ` Krzysztof Kozlowski
2026-08-27 6:03 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 02/12] dt-bindings: display: mediatek: dp: Add compatible for MT8196 eDP AngeloGioacchino Del Regno
2026-07-11 15:08 ` Krzysztof Kozlowski
2026-08-27 6:17 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 03/12] drm/mediatek: mtk_dp: Call pm_runtime_put_sync() in removal path AngeloGioacchino Del Regno
2026-07-09 11:42 ` sashiko-bot
2026-08-27 6:23 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 04/12] drm/mediatek: mtk_dp: Fix hdmi codec and phy driver unregistration AngeloGioacchino Del Regno
2026-07-09 11:48 ` sashiko-bot
2026-08-27 7:22 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 05/12] drm/mediatek: mtk_dp: Clarify SMC eDP/DP video unmute commands AngeloGioacchino Del Regno
2026-08-27 7:28 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 06/12] drm/mediatek: mtk_dp: Rework register offsets for proper PHY usage AngeloGioacchino Del Regno
2026-08-28 3:32 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 07/12] drm/mediatek: mtk_dp: Use PHY API for PHY power sequences AngeloGioacchino Del Regno
2026-07-09 11:53 ` sashiko-bot
2026-08-28 3:40 ` CK Hu (胡俊光) [this message]
2026-07-09 11:31 ` [PATCH v4 08/12] drm/mediatek: mtk_dp: Add support for PHY from devicetree AngeloGioacchino Del Regno
2026-08-28 6:07 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 09/12] drm/mediatek: mtk_dp: Move max link rate to SoC specific data AngeloGioacchino Del Regno
2026-07-09 11:53 ` sashiko-bot
2026-08-28 6:17 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 10/12] drm/mediatek: mtk_dp: Add support for HotPlug Detection in DP AUX AngeloGioacchino Del Regno
2026-07-09 12:00 ` sashiko-bot
2026-07-09 12:05 ` AngeloGioacchino Del Regno
2026-08-28 6:48 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 11/12] drm/mediatek: mtk_dp: Add support for eDP1.5 IPs and MT8196 SoC AngeloGioacchino Del Regno
2026-07-09 12:11 ` sashiko-bot
2026-07-09 12:17 ` AngeloGioacchino Del Regno
2026-08-28 7:13 ` CK Hu (胡俊光)
2026-07-09 11:31 ` [PATCH v4 12/12] drm/mediatek: mtk_dp: Clarify XTAL freq and Debounce registers AngeloGioacchino Del Regno
2026-07-09 11:57 ` sashiko-bot
2026-08-28 8:33 ` CK Hu (胡俊光)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc5504c032fea688fd9690298ff6fbd58a998e67.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Jason-JH.Lin@mediatek.com \
--cc=Justin.Yeh@mediatek.com \
--cc=Rex-BC.Chen@mediatek.com \
--cc=airlied@gmail.com \
--cc=amergnat@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=granquet@baylibre.com \
--cc=jitao.shi@mediatek.com \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox