public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sunxi: video: HDMI: Fix LCD clock divider
@ 2019-08-09 20:30 Mark Kettenis
  2019-09-06 18:27 ` Jagan Teki
  2019-09-23 18:59 ` Anatolij Gustschin
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Kettenis @ 2019-08-09 20:30 UTC (permalink / raw)
  To: u-boot

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")

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
---
 drivers/video/sunxi/sunxi_dw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index cec23295b5..66a319187c 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -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) {
-- 
2.22.0

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

end of thread, other threads:[~2019-09-23 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-09 20:30 [U-Boot] [PATCH] sunxi: video: HDMI: Fix LCD clock divider Mark Kettenis
2019-09-06 18:27 ` Jagan Teki
2019-09-23 18:59 ` Anatolij Gustschin

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