* [PATCH] drivers: phy: cadence: cdns-dphy: Enabling lower resolutions in dphy
@ 2025-08-01 11:53 Harikrishna Shenoy
2025-08-06 4:13 ` Kumar, Udit
0 siblings, 1 reply; 2+ messages in thread
From: Harikrishna Shenoy @ 2025-08-01 11:53 UTC (permalink / raw)
To: vkoul, kishon, u.kleine-koenig, linux-phy, linux-kernel,
devarsht, u-kumar1, s-jain1
Cc: h-shenoy
The patch enables cdns dphy for hs_clk_rate in range between
80 Mbps to 160 Mbps 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)
Signed-off-by: Harikrishna Shenoy <h-shenoy@ti.com>
---
Test log: https://gist.github.com/h-shenoy/3975156baf403a0ff8dbcce5b49b2b89
drivers/phy/cadence/cdns-dphy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/cadence/cdns-dphy.c b/drivers/phy/cadence/cdns-dphy.c
index ed87a3970f83..9abed2ece9b0 100644
--- a/drivers/phy/cadence/cdns-dphy.c
+++ b/drivers/phy/cadence/cdns-dphy.c
@@ -139,7 +139,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;
@@ -149,6 +149,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,
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: phy: cadence: cdns-dphy: Enabling lower resolutions in dphy
2025-08-01 11:53 [PATCH] drivers: phy: cadence: cdns-dphy: Enabling lower resolutions in dphy Harikrishna Shenoy
@ 2025-08-06 4:13 ` Kumar, Udit
0 siblings, 0 replies; 2+ messages in thread
From: Kumar, Udit @ 2025-08-06 4:13 UTC (permalink / raw)
To: Harikrishna Shenoy, vkoul, kishon, u.kleine-koenig, linux-phy,
linux-kernel, devarsht, s-jain1, u-kumar1
Thanks Hari for this patch
On 8/1/2025 5:23 PM, Harikrishna Shenoy wrote:
> The patch enables cdns dphy for hs_clk_rate in range between
No need of 'The patch' word
> 80 Mbps to 160 Mbps as mentioned in TRM [0] by setting the
> pll_opdiv field to 16.This change enables lower resolutions
> like 640x480 at 60Hz.
If you like to reword commit message, please feel free to use below
Enable support for hs_clk_rate between 80-160 Mbps cdns dphy
as mentioned in TRM [0] .....
With update in commit message, Please use
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
> [0]: https://www.ti.com/lit/zip/spruil1
> (Table 12-552. DPHY_TX_PLL_CTRL Register Field Descriptions)
>
> Signed-off-by: Harikrishna Shenoy <h-shenoy@ti.com>
> ---
> Test log: https://gist.github.com/h-shenoy/3975156baf403a0ff8dbcce5b49b2b89
>
> drivers/phy/cadence/cdns-dphy.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/cadence/cdns-dphy.c b/drivers/phy/cadence/cdns-dphy.c
> index ed87a3970f83..9abed2ece9b0 100644
> --- a/drivers/phy/cadence/cdns-dphy.c
> +++ b/drivers/phy/cadence/cdns-dphy.c
> @@ -139,7 +139,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;
> @@ -149,6 +149,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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-06 4:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-01 11:53 [PATCH] drivers: phy: cadence: cdns-dphy: Enabling lower resolutions in dphy Harikrishna Shenoy
2025-08-06 4:13 ` Kumar, Udit
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®