]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: sunxi-ng: h3/h5: Add max. rate constraint to pll-video
authorJernej Skrabec <jernej.skrabec@siol.net>
Thu, 9 Aug 2018 16:52:14 +0000 (18:52 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 27 Aug 2018 07:18:08 +0000 (09:18 +0200)
As it turns out, pll-video can be set to higher rate that it is really
supported by HW.

For example, one monitor requested 185.58 MHz pixel clock. Clock
framework calculated that minimum rate error would be when pll-video
is set to 2040 MHz. This is clearly out of specs.

Both H3 and H5 user manuals specify 600 MHz as maximum supported rate.
However, BSP clock drivers allow up to 912 MHz and 1008 MHz
respectively. Here 912 MHz is chosen because user manuals were already
proven wrong once for lower limits.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
drivers/clk/sunxi-ng/ccu-sun8i-h3.c

index 77ed0b0ba6819d94317e12f31ac25896143e2a77..eb5c608428fa4ba3aab6a4935449487bdfe8adbe 100644 (file)
@@ -69,18 +69,19 @@ static SUNXI_CCU_NM_WITH_SDM_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
                                       BIT(28), /* lock */
                                       CLK_SET_RATE_UNGATE);
 
-static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN(pll_video_clk, "pll-video",
-                                           "osc24M", 0x0010,
-                                           192000000,  /* Minimum rate */
-                                           8, 7,       /* N */
-                                           0, 4,       /* M */
-                                           BIT(24),    /* frac enable */
-                                           BIT(25),    /* frac select */
-                                           270000000,  /* frac rate 0 */
-                                           297000000,  /* frac rate 1 */
-                                           BIT(31),    /* gate */
-                                           BIT(28),    /* lock */
-                                           CLK_SET_RATE_UNGATE);
+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(pll_video_clk, "pll-video",
+                                               "osc24M", 0x0010,
+                                               192000000, /* Minimum rate */
+                                               912000000, /* Maximum rate */
+                                               8, 7,      /* N */
+                                               0, 4,      /* M */
+                                               BIT(24),   /* frac enable */
+                                               BIT(25),   /* frac select */
+                                               270000000, /* frac rate 0 */
+                                               297000000, /* frac rate 1 */
+                                               BIT(31),   /* gate */
+                                               BIT(28),   /* lock */
+                                               CLK_SET_RATE_UNGATE);
 
 static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
                                        "osc24M", 0x0018,