linux/drivers/clk/at91
Boris Brezillon 0817b62cc0 clk: change clk_ops' ->determine_rate() prototype
Clock rates are stored in an unsigned long field, but ->determine_rate()
(which returns a rounded rate from a requested one) returns a long
value (errors are reported using negative error codes), which can lead
to long overflow if the clock rate exceed 2Ghz.

Change ->determine_rate() prototype to return 0 or an error code, and pass
a pointer to a clk_rate_request structure containing the expected target
rate and the rate constraints imposed by clk users.

The clk_rate_request structure might be extended in the future to contain
other kind of constraints like the rounding policy, the maximum clock
inaccuracy or other things that are not yet supported by the CCF
(power consumption constraints ?).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
CC: Jonathan Corbet <corbet@lwn.net>
CC: Tony Lindgren <tony@atomide.com>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: "Emilio López" <emilio@elopez.com.ar>
CC: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
CC: Peter De Schrijver <pdeschrijver@nvidia.com>
CC: Prashant Gaikwad <pgaikwad@nvidia.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Alexandre Courbot <gnurou@gmail.com>
CC: linux-doc@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-omap@vger.kernel.org
CC: linux-mips@linux-mips.org
CC: linux-tegra@vger.kernel.org
[sboyd@codeaurora.org: Fix parent dereference problem in
__clk_determine_rate()]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[sboyd@codeaurora.org: Folded in fix from Heiko for fixed-rate
clocks without parents or a rate determining op]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2015-07-27 18:12:01 -07:00
..
clk-h32mx.c clk: at91: add a driver for the h32mx clock 2014-09-22 11:38:59 +02:00
clk-main.c clk: at91: Use of_clk_get_parent_count() instead of open coding 2015-06-04 13:51:23 -07:00
clk-master.c clk: at91: Use of_clk_get_parent_count() instead of open coding 2015-06-04 13:51:23 -07:00
clk-peripheral.c clk: at91: fix PERIPHERAL_MAX_SHIFT definition 2015-06-19 14:43:40 +02:00
clk-pll.c clk: at91: pll: fix input range validity check 2015-06-19 14:43:39 +02:00
clk-plldiv.c clk: at91: add PMC pll clocks 2013-12-02 15:31:22 +01:00
clk-programmable.c clk: change clk_ops' ->determine_rate() prototype 2015-07-27 18:12:01 -07:00
clk-slow.c clk: at91: Use of_clk_get_parent_count() instead of open coding 2015-06-04 13:51:23 -07:00
clk-smd.c clk: at91: Use of_clk_get_parent_count() instead of open coding 2015-06-04 13:51:23 -07:00
clk-system.c clk: at91: remove the useless CLK_IGNORE_UNUSED flag 2014-07-15 11:54:09 +02:00
clk-usb.c clk: change clk_ops' ->determine_rate() prototype 2015-07-27 18:12:01 -07:00
clk-utmi.c clk: at91: add PMC utmi clock 2013-12-02 15:31:25 +01:00
Makefile clk: at91: add a driver for the h32mx clock 2014-09-22 11:38:59 +02:00
pmc.c clk: at91: Constify irq_domain_ops 2015-05-01 18:25:09 -07:00
pmc.h Merge branch 'ccf/atmel-fixes-for-4.1' of https://github.com/bbrezillon/linux-at91 into clk-fixes 2015-06-19 07:37:14 -07:00
sckc.c clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00
sckc.h clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00