linux/drivers/clk
James Hogan 71472c0c06 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>
2013-08-19 12:27:17 -07:00
..
mmp ARM: pxa: remove cpu_is_xxx in gpio driver 2013-04-11 09:59:23 +08:00
mvebu clk: mvebu: disintegrate obsolete file 2013-05-29 19:28:29 +00:00
mxs clk: mxs: clk-imx23: Include <linux/clk/mxs.h> 2013-08-08 15:57:28 -07:00
rockchip clk: add support for Rockchip gate clocks 2013-06-20 15:58:27 -07:00
samsung clk: exynos5440: Fix incorrect placement of __initdata 2013-08-08 15:57:37 -07:00
socfpga ARM: socfpga: Add support to gate peripheral clocks 2013-06-11 16:35:29 -07:00
spear clk: spear: fix build error for spear3xx 2013-06-11 14:31:37 -07:00
sunxi clk: sunxi: Fix checking return value of clk_register_[composite|factors] 2013-08-08 15:57:27 -07:00
tegra clk: tegra30: Fix incorrect placement of __initdata 2013-08-08 15:57:41 -07:00
ux500 The common clock framework changes for 3.11 include new clock drivers 2013-07-03 11:54:50 -07:00
versatile clk: vexpress: Use full node name to identify individual clocks 2013-06-20 00:02:18 -07:00
x86 ACPI / LPSS: add support for Intel BayTrail 2013-06-19 01:08:47 +02:00
zynq arm: zynq: Migrate platform to clock controller 2013-05-27 09:21:22 +02:00
clk-axi-clkgen.c clk: Add axi-clkgen driver 2013-03-19 17:20:30 -07:00
clk-bcm2835.c clk: bcm2835: probe for fixed-clock in device tree 2013-01-14 21:46:59 -07:00
clk-composite.c clk: composite: allow fixed rates & fixed dividers 2013-04-12 11:23:24 -07:00
clk-devres.c ARM: 7537/1: clk: Fix release in devm_clk_put() 2012-09-19 21:51:27 +01:00
clk-divider.c clk: clk-divider: Export clk_register_divider() 2013-08-16 12:08:53 -07:00
clk-fixed-factor.c clk: export fixed-factor, gate & mux registration 2013-08-16 12:08:54 -07:00
clk-fixed-rate.c clk: fixed-rate: Export clk_fixed_rate_register() 2013-08-16 12:08:50 -07:00
clk-gate.c clk: export fixed-factor, gate & mux registration 2013-08-16 12:08:54 -07:00
clk-highbank.c ACPI and power management updates for 3.9-rc1 2013-02-20 11:26:56 -08:00
clk-ls1x.c clk: add Loongson1B clock support 2012-08-31 11:05:18 -07:00
clk-max77686.c clk: max77686: Avoid double free at remove time 2013-01-15 16:16:26 -08:00
clk-mux.c clk: export fixed-factor, gate & mux registration 2013-08-16 12:08:54 -07:00
clk-nomadik.c clk: nomadik: implement the Nomadik clocks properly 2013-06-20 10:15:30 +02:00
clk-nspire.c clk: Add TI-Nspire clock drivers 2013-05-31 12:07:45 -07:00
clk-ppc-corenet.c clk: mpc85xx: Update the compatible string 2013-05-30 11:55:35 -07:00
clk-prima2.c clk: prima2: Fix incorrect placement of __initdata 2013-08-08 22:35:21 -07:00
clk-s2mps11.c clk: s2mps11: Add support for s2mps11 2013-08-08 15:57:33 -07:00
clk-si5351.c The common clock framework changes for 3.11 include new clock drivers 2013-07-03 11:54:50 -07:00
clk-si5351.h clk: si5351: Allow user to define disabled state for every clock output 2013-05-28 22:50:31 -07:00
clk-twl6040.c clk: use platform_{get,set}_drvdata() 2013-05-30 18:19:34 -07:00
clk-u300.c ARM: u300: convert MMC/SD clock to device tree 2013-06-17 13:54:37 +02:00
clk-vt8500.c The common clock framework changes for 3.11 include new clock drivers 2013-07-03 11:54:50 -07:00
clk-wm831x.c clk: use platform_{get,set}_drvdata() 2013-05-30 18:19:34 -07:00
clk.c clk: add support for clock reparent on set_rate 2013-08-19 12:27:17 -07:00
clkdev.c ARM: 7534/1: clk: Make the managed clk functions generically available 2012-09-15 21:55:27 +01:00
Kconfig clk: s2mps11: Add support for s2mps11 2013-08-08 15:57:33 -07:00
Makefile clk: s2mps11: Add support for s2mps11 2013-08-08 15:57:33 -07:00