aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-08-25clk: Add missing header for 'bool' definition to clk-conf.hChen-Yu Tsai1-0/+2
of_clk_set_defaults uses the type 'bool', but clk-conf.h does not include its definition. This results in a compile error when only clk-conf.h is used. Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24drivers/clk: appropriate __init annotation for const dataNicolas Pitre2-3/+3
Init data marked const should be annotated with __initconst for correctness and not __initdata. This also fixes LTO builds that otherwise fail with section mismatch errors. Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Michael Turquette <[email protected]> [[email protected]: Dropped hunks that moved const char * arrays to const char * const] Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: rockchip: register pll mux before pll itselfHeiko Stuebner1-31/+32
The structure is xin24m -> pll -> pll-mux (xin24m,pll,xin32k). The pll does have an init callback to make sure the boot-selected frequency is using the expected pll settings and resets the same frequency using the values provided in the driver if necessary. The setting itself also involves remuxing the pll-mux temporarily to the xin24m source to let the new pll rate settle. Until now this worked flawlessly, even when it had the flaw of accessing the mux settings before the mux actually got registered. With the recent clock-core conversions this flaw became apparent in null pointer dereference in [<c03fc400>] (clk_hw_get_num_parents) from [<c0400df0>] (clk_mux_get_parent+0x14/0xc8) [<c0400ddc>] (clk_mux_get_parent) from [<c040246c>] (rockchip_rk3066_pll_set_rate+0xd8/0x320) So to fix that, simply register the pll-mux before the pll, so that it will be fully initialized when the pll clock executes its init- callback and possibly touches the pll-mux clock. Signed-off-by: Heiko Stuebner <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2015-08-24clk: add bindings for the Ux500 clocksLinus Walleij1-0/+64
These Ux500 clocks have been around for years and were never properly documented. Add the proper binding documentation. Cc: Ulf Hansson <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Acked-by: Michael Turquette <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk/ARM: move Ux500 PRCC bases to the device treeLinus Walleij6-176/+225
The base addresses for the Ux500 PRCC controllers are hardcoded, let's move them to the clock node in the device tree and delete the constants. Cc: Ulf Hansson <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Acked-by: Olof Johansson <[email protected]> Acked-by: Michael Turquette <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: remove duplicated code with __clk_set_parent_afterDong Aisheng1-7/+1
__clk_set_parent_after() actually used the second argument then we could put this duplicate logic in there and call it with a different order of arguments in the success vs. error paths in this function. Cc: Mike Turquette <[email protected]> Suggested-by: Stephen Boyd <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Convert __clk_get_name(hw->clk) to clk_hw_get_name(hw)Stephen Boyd18-70/+70
Use the provider based method to get a clock's name so that we can get rid of the clk member in struct clk_hw one day. Mostly converted with the following coccinelle script. @@ struct clk_hw *E; @@ -__clk_get_name(E->clk) +clk_hw_get_name(E) Acked-by: Heiko Stuebner <[email protected]> Cc: Sylwester Nawrocki <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Peter De Schrijver <[email protected]> Cc: Prashant Gaikwad <[email protected]> Cc: Stephen Warren <[email protected]> Acked-by: Thierry Reding <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Tero Kristo <[email protected]> Cc: Ulf Hansson <[email protected]> Acked-by: Sebastian Hesselbarth <[email protected]> Acked-by: Andrew Bresticker <[email protected]> Cc: Ezequiel Garcia <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Kevin Cernekee <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Cc: Ulrich Hecht <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Constify clk_hw argument to provider APIsStephen Boyd2-14/+15
We don't modify the clk_hw argument in these functions, so it's safe to mark it as const. Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Hi6220: add stub clock driverLeo Yan3-2/+278
On Hi6220, there have some clocks which can use mailbox channel to send messages to power controller to change frequency; this includes CPU, GPU and DDR clocks. For dynamic frequency scaling, firstly need write the frequency value to SRAM region, and then send message to mailbox to trigger power controller to handle this requirement. This driver will use syscon APIs to pass SRAM memory region and use common mailbox APIs for channels accessing. This init driver will support cpu frequency change firstly. Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24dt-bindings: clk: Hi6220: Document stub clock driverLeo Yan1-1/+18
Document the new compatible for stub clock driver which is used for CPU and DDR's dynamic frequency scaling. Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24dt-bindings: arm: Hi6220: add doc for SRAM controllerLeo Yan1-0/+18
Document "hisilicon,hi6220-sramctrl" for SRAM controller. Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: fix pll missed divide NR in fraction modeGuo Zeng1-0/+1
PLL VCO frequency is given by Fvco = Fref * 2 * NF / NR in integer-N mode, or by Fvco = Fref * SSN / NR in Spread Spectrum (fractional-N) mode. Thus fix the missing part of NR Signed-off-by: Guo Zeng <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: fix bit field and its root clk for coresight_tpiuGuo Zeng1-1/+1
bit4 thcpum_cpudiv4_clken r/w thcpum_cpudiv4_clk clock enable (default: 1) Root clock CPU_CLK must be enabled for this clock to be enabled bit3 coresight_tpiu_clken r/w coresight_tpiu_clk clock enable (default: 0) Root clock TPIU_CLK must be enabled for this clock to be enabled Signed-off-by: Guo Zeng <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: replace dto resolution magic number by macroYibo Cai1-5/+8
Signed-off-by: Yibo Cai <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: fix integer overflow in dto rate calculationYibo Cai1-2/+2
I cannot believe that I spend quite a lot time in finding this bug. It seems a pitfall people tend to fall in. In "int64 = int32 * int32", conversion from 32-bits to 64-bits comes after the multiplication. So this statement may not work as expected. Signed-off-by: Yibo Cai <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: export mux clks so that consumers can get themGuo Zeng1-2/+3
this patch makes mux clks can be referenced by device drivers. Signed-off-by: Guo Zeng <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: atlas7: add lost pwm unit clksGuo Zeng1-0/+4
Signed-off-by: Guo Zeng <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: socfpga: Add a second parent option for the dbg_base_clkDinh Nguyen2-4/+15
The debug base clock can be bypassed from the main PLL to the OSC1 clock. The bypass register is the staysoc1(0x10) register that is in the clock manager. This patch adds the option to get the correct parent for the debug base clock. Signed-off-by: Dinh Nguyen <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: ux500: delete the non-DT U8500 clock implementationLinus Walleij3-528/+0
This code is unused and not coming back. Let's kill it off. Cc: Ulf Hansson <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Remove unused provider APIsStephen Boyd2-82/+16
Remove these APIs now that we've converted all users to the replacement struct clk_hw based versions. Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: si5351: Convert __clk_get_name() to clk_hw_get_name()Stephen Boyd1-8/+8
This driver uses __clk_get_name() when it's dealing with struct clk_hw pointers. Use the simpler form so that we can get rid of the clk member in struct clk_hw one day. Acked-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24drm/msm/dsi: Convert to clk_hw based provider APIsStephen Boyd1-2/+2
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Wentao Xu <[email protected]> Cc: Rob Clark <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: versatile: Switch to assigned clock parentsStephen Boyd2-62/+27
We're removing struct clk from the clk provider API. This code is calling the consumer APIs to change the parent to a 1 MHz fixed rate clock for each of the clocks that the driver provides. Move to using the assigned-clock-parents DT property for this instead. Because this is an ABI break, detect if the property is missing and fall back to setting the parent explicitly before the clocks are registered. Acked-by: Pawel Moll <[email protected]> Cc: Linus Walleij <[email protected]> Tested-by: Sudeep Holla <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: versatile: Add SP810 device tree bindings documentPawel Moll1-0/+35
Signed-off-by: Pawel Moll <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: ti: Convert to clk_hw based provider APIsStephen Boyd7-35/+33
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Acked-by: Tero Kristo <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: tegra: Convert to clk_hw based provider APIsStephen Boyd2-10/+10
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Tomeu Vizoso <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: sunxi: Convert to clk_hw based provider APIsStephen Boyd3-14/+14
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Maxime Ripard <[email protected]> Cc: "Emilio López" <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: spear: Convert to clk_hw based provider APIsStephen Boyd1-1/+1
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: sirf: Convert to clk_hw based provider APIsStephen Boyd1-6/+6
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Barry Song <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: samsung: Convert to clk_hw based provider APIsStephen Boyd1-2/+2
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Chanwoo Choi <[email protected]> Acked-by: Sylwester Nawrocki <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Kukjin Kim <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: rockchip: Convert to clk_hw based provider APIsStephen Boyd1-9/+9
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: qcom: Convert to clk_hw based provider APIsStephen Boyd4-36/+30
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: stm32f4: Convert to clk_hw based provider APIsStephen Boyd1-2/+1
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Daniel Thompson <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: mvebu: Convert to clk_hw based provider APIsStephen Boyd1-4/+2
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. This also removes a clk_get() in this driver that can just as easily use of_clk_get_parent_name() instead. Cc: Gregory CLEMENT <[email protected]> Cc: Thomas Petazzoni <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: mmp: Convert to clk_hw based provider APIsStephen Boyd2-21/+17
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Chao Xie <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Convert basic types to clk_hw based provider APIsStephen Boyd3-12/+11
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: bcm: Convert to clk_hw based provider APIsStephen Boyd1-10/+10
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: at91: Convert to clk_hw based provider APIsStephen Boyd3-13/+13
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24MIPS: alchemy: Convert to clk_hw based provider APIsStephen Boyd1-6/+6
We're removing struct clk from the clk provider API, so switch this code to using the clk_hw based provider APIs. Cc: Manuel Lauss <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Linux-MIPS <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24ARM: OMAP: Convert __clk_get_rate() to provider/consumer APIsStephen Boyd1-3/+3
We're removing struct clk from the clk provider API, so switch to clk_get_rate() and clk_hw_get_rate() here appropriately. Acked-by: Tero Kristo <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: ti: Remove CLK_IS_BASIC checkStephen Boyd1-6/+0
This code is never called with a basic clock type, so the check here is not doing anything useful and is blocking the removal of __clk_get_flags(). Remove the check so we can delete the __clk_get_flags() API. Acked-by: Tero Kristo <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Convert __clk_get_flags() to clk_hw_get_flags()Stephen Boyd17-21/+21
Mostly converted with the following snippet: @@ struct clk_hw *E; @@ -__clk_get_flags(E->clk) +clk_hw_get_flags(E) Acked-by: Tero Kristo <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Max Filippov <[email protected]> Acked-by: Sebastian Hesselbarth <[email protected]> Cc: Daniel Thompson <[email protected]> Cc: Coquelin <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Replace __clk_get_num_parents with clk_hw_get_num_parents()Stephen Boyd15-20/+20
Mostly converted with the following semantic patch: @@ struct clk_hw *E; @@ -__clk_get_num_parents(E->clk) +clk_hw_get_num_parents(E) Acked-by: Boris Brezillon <[email protected]> Cc: Chao Xie <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Javier Martinez Canillas <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: "Emilio López" <[email protected]> Acked-by: Tero Kristo <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Acked-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2015-08-24clk: Add clk_hw_*() APIs for use by clk providersStephen Boyd2-0/+70
clk providers shouldn't need to use the consumer APIs (clk.h). Add provider APIs to replace the __clk_*() APIs that take a struct clk_hw as their first argument instead of a struct clk. Signed-off-by: Stephen Boyd <[email protected]>
2015-08-12clk: rockchip: Fix SPIF special clock definitionSjoerd Simons1-3/+3
Neither spdif_src nor spdif_pll exists, judging by the vendor kernel in both cases spdif_pre was meant. This brings the naming in line and hierachy in line with that of sclk_i2s0. Also allow sclk_spdif and spdif_frac to change their parents rate as that the upstream dividers are purely there to feed sclk_spdif Signed-off-by: Sjoerd Simons <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2015-08-12clk: bcm2835: Drop the fixed sys_pclk.Eric Anholt1-5/+0
Nothing uses it, and I can't find any evidence that anything ever has. Its role is now filled by the core clock in the firmware driver. Signed-off-by: Eric Anholt <[email protected]> Acked-by: Stephen Warren <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2015-08-12clk: track the orphan status of clocks and their childrenHeiko Stuebner1-3/+30
While children of orphan clocks are not carried in the orphan-list itself, they're nevertheless orphans in their own right as they also don't have an input-rate available. To ease tracking if a clock is an orphan or has an orphan in its parent path introduce an orphan field into struct clk and update it and the fields in child-clocks when a clock gets added or removed from the orphan-list. Suggested-by: Stephen Boyd <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: Alex Elder <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Max Filippov <[email protected]> Cc: [email protected] Cc: Zhangfei Gao <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Chao Xie <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Stefan Wahren <[email protected]> Cc: Andrew Bresticker <[email protected]> Cc: Robert Jarzmik <[email protected]> Cc: Georgi Djakov <[email protected]> Cc: Sylwester Nawrocki <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Barry Song <[email protected]> Cc: Dinh Nguyen <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: Gabriel FERNANDEZ <[email protected]> Cc: [email protected] Cc: Peter De Schrijver <[email protected]> Cc: Tero Kristo <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Michal Simek <[email protected]> [[email protected]: s/clk/core/ in new function] Signed-off-by: Stephen Boyd <[email protected]>
2015-08-12clk: sunxi: Add a simple gates driverMaxime Ripard3-177/+159
The gates were handled with a common piece of framework that was registering all gates array, that was not using the CLK_OF_DECLARE logic, and was not using clock-indices but some private masks that were pretty much equivalent. Move this code in a new driver that handles all the gates array and solves both these issues. Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Michael Turquette <[email protected]> [[email protected]: Include clk.h for consumer API usage] Signed-off-by: Stephen Boyd <[email protected]>
2015-08-12ARM: sun9i: Wrap the clock-indicesMaxime Ripard1-10/+22
Wrap the clock-indices to match the wrapping of the clock-output-names in order to make it easier to match indices to names. Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2015-08-12ARM: sun8i: Add clock indicesMaxime Ripard1-0/+15
The A23 and A33 gates have a non continuous set of clock IDs that are valid. Add the clock-indices property to the DT to express this. Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Michael Turquette <[email protected]>