diff options
author | James Hogan <james.hogan@imgtec.com> | 2013-07-29 12:25:00 +0100 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-08-19 12:27:17 -0700 |
commit | 71472c0c06cf9a3d1540762ea205654c584e3bc4 (patch) | |
tree | 22db34b3c7bc0d0053fcfac2c95d77adf09107de /virt/kvm | |
parent | 4935b22c46ea5e2dc44ef0b72db50741649eb3a4 (diff) | |
download | linux-71472c0c06cf9a3d1540762ea205654c584e3bc4.tar.gz linux-71472c0c06cf9a3d1540762ea205654c584e3bc4.tar.bz2 linux-71472c0c06cf9a3d1540762ea205654c584e3bc4.zip |
clk: add support for clock reparent on set_rate
Add core support to allow clock implementations to select the best
parent clock when rounding a rate, e.g. the one which can provide the
closest clock rate to that requested. This is by way of adding a new
clock op, determine_rate(), which is like round_rate() but has an extra
parameter to allow the clock implementation to optionally select a
different parent clock. The core then takes care of reparenting the
clock when setting the rate.
The parent change takes place with the help of some new private data
members. struct clk::new_parent specifies a clock's new parent (NULL
indicates no change), and struct clk::new_child specifies a clock's new
child (whose new_parent member points back to it). The purpose of these
are to allow correct walking of the future tree for notifications prior
to actually reparenting any clocks, specifically to skip child clocks
who are being reparented to another clock (they will be notified via the
new parent), and to include any new child clock. These pointers are set
by clk_calc_subtree(), and the new_child pointer gets cleared when a
child is actually reparented to avoid duplicate POST_RATE_CHANGE
notifications.
Each place where round_rate() is called, determine_rate() is checked
first and called in preference. This restructures a few of the call
sites to simplify the logic into if/else blocks.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'virt/kvm')
0 files changed, 0 insertions, 0 deletions