]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: cadence: cdns-dphy: Enable lower resolutions in dphy
authorHarikrishna Shenoy <h-shenoy@ti.com>
Thu, 7 Aug 2025 05:20:02 +0000 (10:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:19 +0000 (15:37 -0500)
[ Upstream commit 43bd2c44515f8ee5c019ce6e6583f5640387a41b ]

Enable support for data lane rates between 80-160 Mbps cdns dphy
as mentioned in TRM [0] by setting the pll_opdiv field to 16.
This change enables lower resolutions like 640x480 at 60Hz.

[0]: https://www.ti.com/lit/zip/spruil1
(Table 12-552. DPHY_TX_PLL_CTRL Register Field Descriptions)

Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Harikrishna Shenoy <h-shenoy@ti.com>
Link: https://lore.kernel.org/r/20250807052002.717807-1-h-shenoy@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/cadence/cdns-dphy.c

index de5389374d79d09e158e4011e4acf627ec5f4fd9..1bd986cba8f7fa9cf4f36f242bf4d85d5593072b 100644 (file)
@@ -145,7 +145,7 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
 
        dlane_bps = opts->hs_clk_rate;
 
-       if (dlane_bps > 2500000000UL || dlane_bps < 160000000UL)
+       if (dlane_bps > 2500000000UL || dlane_bps < 80000000UL)
                return -EINVAL;
        else if (dlane_bps >= 1250000000)
                cfg->pll_opdiv = 1;
@@ -155,6 +155,8 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
                cfg->pll_opdiv = 4;
        else if (dlane_bps >= 160000000)
                cfg->pll_opdiv = 8;
+       else if (dlane_bps >= 80000000)
+               cfg->pll_opdiv = 16;
 
        cfg->pll_fbdiv = DIV_ROUND_UP_ULL(dlane_bps * 2 * cfg->pll_opdiv *
                                          cfg->pll_ipdiv,