Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Signaling voltage boost is exclusively tied to the absolute maximum clamped frequency, preventing high data rates from receiving the boost. --
--- Patch [2]: [PATCH v3 2/2] phy: mediatek: Add support for MT8196 MIPI DSI PHY --- commit a6b40caad1ac266a0481ef7b26baffceb672008c Author: AngeloGioacchino Del Regno <[email protected]> phy: mediatek: Add support for MT8196 MIPI DSI PHY This commit adds support for the MIPI DSI PHY found in the MediaTek MT8196 SoC and its variants. It introduces a new register layout and basic D-PHY functionality needed to drive MIPI DSI displays. > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c > new file mode 100644 > index 0000000000000..eac3db9922dba > --- /dev/null > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c [ ... ] > +static int mtk_mipi_tx_pll_enable(struct clk_hw *hw) > +{ > + struct mtk_mipi_tx *mipi_tx = mtk_mipi_tx_from_clk_hw(hw); > + void __iomem *base = mipi_tx->regs; > + u32 voltage = RG_DSI_PRD_REF_MINI; > + u32 pres = MIPITX_PRESERVED_MINI; > + unsigned long long pcw_calc; > + unsigned int txdiv, txdiv0; > + u32 pcw; > + > + dev_dbg(mipi_tx->dev, "enable: %u bps\n", mipi_tx->data_rate); > + > + if (mipi_tx->data_rate >= DSI_PHY_PLL_MAX_RATE_HZ) { > + /* Select higher signaling voltage for fast data rates */ > + voltage = RG_DSI_PRD_REF_DEF; > + pres = MIPITX_PRESERVED_DEF; > + txdiv = 1; > + txdiv0 = 0; > + } else if (mipi_tx->data_rate >= 1000000000) { [Severity: Medium] Does this logic unintentionally restrict the higher signaling voltage to only exact matches of the maximum PLL rate? Since mtk_mipi_tx_pll_determine_rate() clamps the clock rate to DSI_PHY_PLL_MAX_RATE_HZ (2.0 GHz), mipi_tx->data_rate can never exceed this value. Consequently, panels requesting data rates slightly below 2.0 GHz (for example, 1.99 GHz) will fall through to the 1.0 GHz branch instead of receiving the voltage boost and correct PLL dividers intended for fast data rates. Could this conflation between the PLL octave band threshold and the maximum frequency clamp macro also break the PLL divider logic if the maximum supported rate limit is increased in the future? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2
