public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate
@ 2023-06-11  9:01 Frank Oltmanns
  2023-06-11  9:01 ` [PATCH v2 1/2] clk: sunxi-ng: nkm: consider alternative parent rates when finding rate Frank Oltmanns
  2023-06-11  9:01 ` [PATCH v2 2/2] clk: sunxi-ng: a64: allow pll-mipi to set parent's rate Frank Oltmanns
  0 siblings, 2 replies; 8+ messages in thread
From: Frank Oltmanns @ 2023-06-11  9:01 UTC (permalink / raw)
  To: Andre Przywara, Chen-Yu Tsai, Frank Oltmanns, Jernej Skrabec,
	Maxime Ripard, Michael Turquette, Roman Beranek, Samuel Holland,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi

This is V2 of a patchset that enables NKM clocks to consider alternative parent
rates and utilize this new feature to adjust the pll-video0 clock on Allwinner
A64.

This allows to achieve an optimal rate for driving the board's panel.

To provide some context, the clock structure involved in this process is as follows:
    clock                       clock type
    --------------------------------------
    pll-video0                  ccu_nm
       pll-mipi                 ccu_nkm
          tcon0                 ccu_mux
             tcon-data-clock    sun4i_dclk

The divider between tcon0 and tcon-data-clock is fixed at 4. Therefore, in order
to achieve a rate that closely matches the desired rate of the panel, pll-mipi
needs to operate at a specific rate.

Changes in V2:
 - Move optimal parent rate calculation to dedicated function
 - Choose a parent rate that does not to overshoot requested rate
 - Add comments to ccu_nkm_find_best
 - Make sure that best_parent_rate stays at original parent rate in the unlikely
   case that all combinations overshoot.

Link to V1:
https://lore.kernel.org/lkml/20230605190745.366882-1-frank@oltmanns.dev/

Frank Oltmanns (2):
  clk: sunxi-ng: nkm: consider alternative parent rates when finding
    rate
  clk: sunxi-ng: a64: allow pll-mipi to set parent's rate

 drivers/clk/sunxi-ng/ccu-sun50i-a64.c |  3 +-
 drivers/clk/sunxi-ng/ccu_nkm.c        | 66 +++++++++++++++++++++++----
 2 files changed, 60 insertions(+), 9 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-06-26 16:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-11  9:01 [PATCH v2 0/2] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate Frank Oltmanns
2023-06-11  9:01 ` [PATCH v2 1/2] clk: sunxi-ng: nkm: consider alternative parent rates when finding rate Frank Oltmanns
2023-06-12  8:51   ` Frank Oltmanns
2023-06-12 12:31     ` Maxime Ripard
2023-06-25 10:45       ` Frank Oltmanns
2023-06-26 16:50         ` Maxime Ripard
2023-06-12 12:21   ` Maxime Ripard
2023-06-11  9:01 ` [PATCH v2 2/2] clk: sunxi-ng: a64: allow pll-mipi to set parent's rate Frank Oltmanns

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