summaryrefslogtreecommitdiffstats
path: root/drivers/clk/versatile/clk-sp810.c
Commit message (Collapse)AuthorAgeFilesLines
* clk: versatile: sp810: Remove usage of CLK_IS_BASICStephen Boyd2018-12-101-1/+1
| | | | | | | | | | This flag doesn't look to be used by any code, just set in the clk init structure and then never tested again. Remove it from this driver as it doesn't provide any benefit. Cc: Linus Walleij <linus.walleij@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
* clk: versatile: sp810: support reentranceLinus Walleij2016-02-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite care take to allocate clocks state containers the SP810 driver actually just supports creating one instance: all clocks registered for every instance will end up with the exact same name and __clk_init() will fail. Rename the timclken<0> .. timclken<n> to sp810_<instance>_<n> so every clock on every instance gets a unique name. This is necessary for the RealView PBA8 which has two SP810 blocks: the second block will not register its clocks unless every clock on every instance is unique and results in boot logs like this: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at ../drivers/clk/versatile/clk-sp810.c:137 clk_sp810_of_setup+0x110/0x154() Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.5.0-rc2-00030-g352718fc39f6-dirty #225 Hardware name: ARM RealView Machine (Device Tree Support) [<c00167f8>] (unwind_backtrace) from [<c0013204>] (show_stack+0x10/0x14) [<c0013204>] (show_stack) from [<c01a049c>] (dump_stack+0x84/0x9c) [<c01a049c>] (dump_stack) from [<c0024990>] (warn_slowpath_common+0x74/0xb0) [<c0024990>] (warn_slowpath_common) from [<c0024a68>] (warn_slowpath_null+0x1c/0x24) [<c0024a68>] (warn_slowpath_null) from [<c051eb44>] (clk_sp810_of_setup+0x110/0x154) [<c051eb44>] (clk_sp810_of_setup) from [<c051e3a4>] (of_clk_init+0x12c/0x1c8) [<c051e3a4>] (of_clk_init) from [<c0504714>] (time_init+0x20/0x2c) [<c0504714>] (time_init) from [<c0501b18>] (start_kernel+0x244/0x3c4) [<c0501b18>] (start_kernel) from [<7000807c>] (0x7000807c) ---[ end trace cb88537fdc8fa200 ]--- Cc: Michael Turquette <mturquette@baylibre.com> Cc: Pawel Moll <pawel.moll@arm.com> Fixes: 6e973d2c4385 "clk: vexpress: Add separate SP810 driver" Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: remove unneeded error messageSudip Mukherjee2015-11-201-3/+1Star
| | | | | | | | If kzalloc fails we will already have many messages in the log and we do not need another message to know that kzalloc for sp810 has failed. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: fix memory leakSudip Mukherjee2015-11-181-0/+1
| | | | | | | | If of_clk_parent_fill() fails then we printed an error message and returned. But we missed freeing sp810. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: Switch to assigned clock parentsStephen Boyd2015-08-251-61/+15Star
| | | | | | | | | | | | | | | 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 <pawel.moll@arm.com> Cc: Linus Walleij <linus.walleij@linaro.org> Tested-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: off by one in clk_sp810_timerclken_of_get()Dan Carpenter2015-07-291-2/+2
| | | | | | | | | The ">" should be ">=" or we end up reading beyond the end of the array. Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: Remove clk.h and clkdev.h includesStephen Boyd2015-07-201-1/+2
| | | | | | | | | | | Clock provider drivers generally shouldn't include clk.h because it's the consumer API. Remove the include here because this is a provider driver. Also remove clkdev.h in files that aren't using it and replace them with slab.h in files that were relying on the implicit include of slab.h in clkdev.h. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: Silence sparse warningsStephen Boyd2015-05-151-2/+2
| | | | | | | | | | | | | drivers/clk/versatile/clk-sp810.c:159:29: error: incompatible types for operation (<=) drivers/clk/versatile/clk-sp810.c:159:29: left side has type char const *<noident> drivers/clk/versatile/clk-sp810.c:159:29: right side has type int drivers/clk/versatile/clk-sp810.c:159:53: error: incompatible types for operation (<=) drivers/clk/versatile/clk-sp810.c:159:53: left side has type char const *<noident> drivers/clk/versatile/clk-sp810.c:159:53: right side has type int drivers/clk/versatile/clk-sp810.c:138:13: warning: symbol 'clk_sp810_of_setup' was not declared. Should it be static? Acked: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* clk: versatile: Staticize clk_sp810_timerclken_of_getSachin Kamat2013-12-201-1/+1
| | | | | | | clk_sp810_timerclken_of_get is used only in this file. Make it static. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
* clk: vexpress: Add separate SP810 driverPawel Moll2013-04-181-0/+188
Factor out the SP810 clocking code into a separate driver, selecting better (faster) parent at clk_prepare() time. This is to avoid problems with clocking infrastructure initialisation order, in particular to avoid dependency of fixed clock being initialized before SP810. It also makes vexpress platform OF-based clock initialisation code unnecessary. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Tested-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> [mturquette@linaro.org: add .unprepare, FIXME comment, cleaned up code]