aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-11 09:13:54 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-12-19 05:08:25 -0500
commit4a606af20d930dc1a8b62b0f753cdc018914e5de (patch)
treee015416028998b5078ad88db0282739145158194 /arch/arm/mach-shmobile
parente006502126a6a1f3afd879afa9101cc3df8b11f9 (diff)
ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT
Now that the common clock framework is supported, the clock lookup entries in clock-r8a7790.c are not registered anymore. Devices must instead reference their clocks in the device tree. However, SCIF and CMT devices are still instantiated through platform code, and thus need a clock lookup entry. Retrieve the SCIF and CMT clock entries by name and register clkdevs for the corresponding devices. This will be removed when the SCIF and CMT devices will be instantiated from the device tree. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index fc43f7ce6577..7e3fe377e381 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -18,6 +18,8 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clk.h>
22#include <linux/clkdev.h>
21#include <linux/init.h> 23#include <linux/init.h>
22#include <linux/of_platform.h> 24#include <linux/of_platform.h>
23#include <mach/common.h> 25#include <mach/common.h>
@@ -27,9 +29,36 @@
27 29
28static void __init lager_add_standard_devices(void) 30static void __init lager_add_standard_devices(void)
29{ 31{
30#ifndef CONFIG_COMMON_CLK 32#ifdef CONFIG_COMMON_CLK
33 /*
34 * This is a really crude hack to provide clkdev support to the SCIF
35 * and CMT devices until they get moved to DT.
36 */
37 static const char * const scif_names[] = {
38 "scifa0", "scifa1", "scifb0", "scifb1",
39 "scifb2", "scifa2", "scif0", "scif1",
40 "hscif0", "hscif1",
41 };
42 struct clk *clk;
43 unsigned int i;
44
45 for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
46 clk = clk_get(NULL, scif_names[i]);
47 if (clk) {
48 clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
49 clk_put(clk);
50 }
51 }
52
53 clk = clk_get(NULL, "cmt0");
54 if (clk) {
55 clk_register_clkdev(clk, NULL, "sh_cmt.0");
56 clk_put(clk);
57 }
58#else
31 r8a7790_clock_init(); 59 r8a7790_clock_init();
32#endif 60#endif
61
33 r8a7790_add_dt_devices(); 62 r8a7790_add_dt_devices();
34 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 63 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
35} 64}