clk: bcm: rpi: Run some clocks at the minimum rate allowed
authorMaxime Ripard <maxime@cerno.tech>
Fri, 25 Feb 2022 14:35:32 +0000 (15:35 +0100)
committerStephen Boyd <sboyd@kernel.org>
Sat, 12 Mar 2022 03:15:04 +0000 (19:15 -0800)
commite9d6cea2af1cf8d84287ff2287b6cd776f7475d2
tree2e956c45c19320bd47e23b2405b6db6b785e0740
parent542acfec4e313c001f9b82332f4fa2848ec7bf58
clk: bcm: rpi: Run some clocks at the minimum rate allowed

The core clock and M2MC clocks are shared between some devices (Unicam
controllers and the HVS, and the HDMI controllers, respectively) that
will have various, varying, requirements depending on their current work
load.

Since those loads can require a fairly high clock rate in extreme
conditions (up to ~600MHz), we can end up running those clocks at their
maximum frequency even though we no longer require such a high rate.

Fortunately, those devices don't require an exact rate but a minimum
rate, and all the drivers are using clk_set_min_rate. Thus, we can just
rely on the fact that the clk_request minimum (which is the aggregated
minimum of all the clock users) is what we want at all times.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220225143534.405820-11-maxime@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/bcm/clk-raspberrypi.c