Commit 811a498e authored by Archit Taneja's avatar Archit Taneja Committed by Stephen Boyd

clk: qcom: Fix pre-divider usage for pixel RCG

The clk_rcg_pixel_set_rate clk_op sets up the pre-divider by reading
its current value from the NS register.

Using the pre-divider wasn't really intended when creating these ops.
The pixel RCG was only intended to achieve fractional multiplication
provided in the pixel_table array. Leaving the pre-divider to the
existing register value results in a wrong pixel clock when the
bootloader sets up the display. This was left unidentified because
the IFC6410 Plus board on which this was verified didn't have a
bootloader that configured the display.

Don't set the RCG pre-divider in freq_tbl to the existing NS register
value. Force it to 1 and only use the M/N counter to achieve the desired
fractional multiplication.

Cc: Vinay Simha <vinaysimha@inforcecomputing.com>
Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent d3622b58
...@@ -638,7 +638,6 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate, ...@@ -638,7 +638,6 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
return ret; return ret;
src = ns_to_src(&rcg->s, ns); src = ns_to_src(&rcg->s, ns);
f.pre_div = ns_to_pre_div(&rcg->p, ns) + 1;
for (i = 0; i < num_parents; i++) { for (i = 0; i < num_parents; i++) {
if (src == rcg->s.parent_map[i].cfg) { if (src == rcg->s.parent_map[i].cfg) {
...@@ -647,6 +646,9 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate, ...@@ -647,6 +646,9 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
} }
} }
/* bypass the pre divider */
f.pre_div = 1;
/* let us find appropriate m/n values for this */ /* let us find appropriate m/n values for this */
for (; frac->num; frac++) { for (; frac->num; frac++) {
request = (rate * frac->den) / frac->num; request = (rate * frac->den) / frac->num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment