* [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
@ 2026-11-02 7:21 Sreeraj S Kurup
2026-11-15 19:56 ` Manivannan Sadhasivam
0 siblings, 1 reply; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-11-02 7:21 UTC (permalink / raw)
To: chunkuang.hu, p.zabel, vkoul, neil.armstrong, mani, matthias.bgg,
angelogioacchino.delregno
Cc: dri-devel, linux-mediatek, linux-phy, linux-kernel, Sreeraj S Kurup
The mtk_hdmi_pll_drv_setting() function can return -EINVAL when
the requested pixel clock is outside its supported range.
Currently, mtk_hdmi_pll_prepare() ignores this return value and
continues with PLL initialization even when the driver settings
fail.
Check the return value and abort PLL preparation on failure to
avoid powering up the PLL with invalid driver settings.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
index a4bc1268946d..9658781484f1 100644
--- a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
+++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
@@ -360,6 +360,7 @@ static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
{
struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
void __iomem *regs = hdmi_phy->regs;
+ int ret;
mtk_phy_set_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_TX_POSDIV_EN);
@@ -374,7 +375,9 @@ static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
mtk_phy_clear_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_FRL_D2_EN);
mtk_phy_clear_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_FRL_CK_EN);
- mtk_hdmi_pll_drv_setting(hw);
+ ret = mtk_hdmi_pll_drv_setting(hw);
+ if (ret)
+ return ret;
mtk_phy_clear_bits(regs + HDMI_1_CFG_10, RG_HDMITX21_BG_PWD);
mtk_phy_set_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_BIAS_EN);
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
2026-11-02 7:21 [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value Sreeraj S Kurup
@ 2026-11-15 19:56 ` Manivannan Sadhasivam
0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-15 19:56 UTC (permalink / raw)
To: Sreeraj S Kurup
Cc: chunkuang.hu, p.zabel, vkoul, neil.armstrong, mani, matthias.bgg,
angelogioacchino.delregno, dri-devel, linux-mediatek, linux-phy,
linux-kernel
On 2026-11-02 07:21 +0000, Sreeraj S Kurup wrote:
> The mtk_hdmi_pll_drv_setting() function can return -EINVAL when
> the requested pixel clock is outside its supported range.
>
> Currently, mtk_hdmi_pll_prepare() ignores this return value and
> continues with PLL initialization even when the driver settings
> fail.
>
> Check the return value and abort PLL preparation on failure to
> avoid powering up the PLL with invalid driver settings.
>
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-15 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 7:21 [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value Sreeraj S Kurup
2026-11-15 19:56 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®