[PATCH v3 2/2] phy: mediatek: Add support for MT8196 MIPI DSI PHY
AngeloGioacchino Del Regno
angelogioacchino.delregno at collabora.com
Tue Jul 14 01:29:52 PDT 2026
On 7/13/26 12:48, sashiko-bot at kernel.org wrote:
> 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 <angelogioacchino.delregno at collabora.com>
>
> 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?
>
Yes, it does. It's fine. This is on purpose.
There's a way to scale voltages a bit differently (for 4 different freq ranges)
but it's a bit messy to implement, needs me to have different displays to test
all different frequencies (which I don't have), and a bit more code.
The only frequencies that really need the higher signaling voltage are the ones
from 2GHz (which is currently the max frequency, but can be expanded later, as
there will be new HW supporting higher freqs, with the same signaling voltage
increase and the same code for it) onwards.
> 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?
>
More information about the linux-phy
mailing list