Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: cdns-dphy: Store hs_clk_rate and return it

The DPHY driver does not return the actual hs_clk_rate, so the DSI
driver has no idea what clock was actually achieved. Set the realized
hs_clk_rate to the opts struct, so that the DSI driver gets it back.

Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Tested-by: Parth Pancholi <parth.pancholi@toradex.com>
Tested-by: Jayesh Choudhary <j-choudhary@ti.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250723-cdns-dphy-hs-clk-rate-fix-v1-1-d4539d44cbe7@ideasonboard.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Tomi Valkeinen and committed by
Vinod Koul
689a54ac 78a474b5

+5
+5
drivers/phy/cadence/cdns-dphy.c
··· 79 79 u8 pll_ipdiv; 80 80 u8 pll_opdiv; 81 81 u16 pll_fbdiv; 82 + u32 hs_clk_rate; 82 83 unsigned int nlanes; 83 84 }; 84 85 ··· 154 153 cfg->pll_fbdiv = DIV_ROUND_UP_ULL(dlane_bps * 2 * cfg->pll_opdiv * 155 154 cfg->pll_ipdiv, 156 155 pll_ref_hz); 156 + 157 + cfg->hs_clk_rate = div_u64((u64)pll_ref_hz * cfg->pll_fbdiv, 158 + 2 * cfg->pll_opdiv * cfg->pll_ipdiv); 157 159 158 160 return 0; 159 161 } ··· 301 297 if (ret) 302 298 return ret; 303 299 300 + opts->hs_clk_rate = cfg->hs_clk_rate; 304 301 opts->wakeup = cdns_dphy_get_wakeup_time_ns(dphy) / 1000; 305 302 306 303 return 0;