Skip to contentSkip to conversation

sunxi: video: HDMI: Fix LCD clock divider

PATCH New Mark Kettenis 3 participants 3 messages Aug 9, 2019 – Sep 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunxi: video: HDMI: Fix LCD clock divider

Currently we may end up with an LCD clock divider that differs from the HDMI PHY clock divider if we can't exactly match the pixel clock. Fix this by using DIV_ROUND_UP to calculate the divider. This works since the PLL is chosen such that the resulting pixel clock is never higher than the requested pixel clock.

Fixes 1feed358ed15 ("sunxi: video: HDMI: Fix clock setup")
---
 drivers/video/sunxi/sunxi_dw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/sunxi/sunxi_dw_hdmi.c +1 -1
index cec23295b5..66a319187c 100644
@@ -254,7 +254,7 @@ static void sunxi_dw_hdmi_lcdc_init(int mux, const struct display_timing *edid,
 {
 	struct sunxi_ccm_reg * const ccm =
 		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
-	int div = clock_get_pll3() / edid->pixelclock.typ;
+	int div = DIV_ROUND_UP(clock_get_pll3(), edid->pixelclock.typ);
 	struct sunxi_lcdc_reg *lcdc;
 
 	if (mux == 0) {
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/1 sunxi: video: HDMI: Fix LCD clock divider

Quoted 11 lines · Mark Kettenis

Currently we may end up with an LCD clock divider that differs from the HDMI PHY clock divider if we can't exactly match the pixel clock. Fix this by using DIV_ROUND_UP to calculate the divider. This works since the PLL is chosen such that the resulting pixel clock is never higher than the requested pixel clock.

Fixes 1feed358ed15 ("sunxi: video: HDMI: Fix clock setup")

---

Moved, to Anatolij on pw

#2 lore raw

PATCH 1/1 sunxi: video: HDMI: Fix LCD clock divider

In reply to Mark Kettenis

On Fri, 9 Aug 2019 22:30:26 +0200
Mark Kettenis kettenis at openbsd.org wrote:
...

Quoted 2 lines
---
 drivers/video/sunxi/sunxi_dw_hdmi.c | 2 +-

Applied to u-boot-video/master, thanks!

--
Anatolij