The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll
@ 2023-12-12  3:32 Adam Ford
  2023-12-12  3:32 ` [PATCH 2/2] drm/bridge: samsung-dsim: Fix porch calcalcuation rounding Adam Ford
  2023-12-12  8:25 ` [PATCH 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll Frieder Schrempf
  0 siblings, 2 replies; 8+ messages in thread
From: Adam Ford @ 2023-12-12  3:32 UTC (permalink / raw)
  To: dri-devel
  Cc: aford, Adam Ford, Inki Dae, Jagan Teki, Marek Szyprowski,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Marco Felsch,
	Michael Tretter, linux-kernel

The P divider should be set based on the min and max values of
the fin pll which may vary between different platforms.
These ranges are defined per platform, but hard-coded values
were used instead which resulted in a smaller range available
on the i.MX8M[MNP] than what was possible.

Fixes: 846307185f0f ("drm/bridge: samsung-dsim: update PLL reference clock")
Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index be5914caa17d..239d253a7d71 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -573,8 +573,8 @@ static unsigned long samsung_dsim_pll_find_pms(struct samsung_dsim *dsi,
 	u16 _m, best_m;
 	u8 _s, best_s;
 
-	p_min = DIV_ROUND_UP(fin, (12 * MHZ));
-	p_max = fin / (6 * MHZ);
+	p_min = DIV_ROUND_UP(fin, (driver_data->pll_fin_max * MHZ));
+	p_max = fin / (driver_data->pll_fin_min * MHZ);
 
 	for (_p = p_min; _p <= p_max; ++_p) {
 		for (_s = 0; _s <= 5; ++_s) {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-08 13:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12  3:32 [PATCH 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll Adam Ford
2023-12-12  3:32 ` [PATCH 2/2] drm/bridge: samsung-dsim: Fix porch calcalcuation rounding Adam Ford
2023-12-12 10:29   ` Adam Ford
2024-01-25 18:44   ` Adam Ford
2024-01-29  8:17     ` Frieder Schrempf
2024-02-08 13:15       ` Adam Ford
2023-12-12  8:25 ` [PATCH 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll Frieder Schrempf
2023-12-12 10:18   ` Adam Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox