aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-11 09:13:55 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-12-19 05:08:25 -0500
commitf31239ef590186b6895a2f2cf7e0f2709a5c0da0 (patch)
treebac07e0c3fda87b68fb86f1d92d59d28b3e0cc9e
parent4a606af20d930dc1a8b62b0f753cdc018914e5de (diff)
ARM: shmobile: koelsch-reference: Instantiate clkdevs for SCIF and CMT
Now that the common clock framework is supported, the clock lookup entries in clock-r8a7791.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>
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 4b48e2d4dec4..e1c787e639eb 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -19,6 +19,8 @@
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22#include <linux/clk.h>
23#include <linux/clkdev.h>
22#include <linux/kernel.h> 24#include <linux/kernel.h>
23#include <linux/of_platform.h> 25#include <linux/of_platform.h>
24#include <mach/common.h> 26#include <mach/common.h>
@@ -28,7 +30,33 @@
28 30
29static void __init koelsch_add_standard_devices(void) 31static void __init koelsch_add_standard_devices(void)
30{ 32{
31#ifndef CONFIG_COMMON_CLK 33#ifdef CONFIG_COMMON_CLK
34 /*
35 * This is a really crude hack to provide clkdev support to the SCIF
36 * and CMT devices until they get moved to DT.
37 */
38 static const char * const scif_names[] = {
39 "scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2",
40 "scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3",
41 "scifa4", "scifa5",
42 };
43 struct clk *clk;
44 unsigned int i;
45
46 for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
47 clk = clk_get(NULL, scif_names[i]);
48 if (clk) {
49 clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
50 clk_put(clk);
51 }
52 }
53
54 clk = clk_get(NULL, "cmt0");
55 if (clk) {
56 clk_register_clkdev(clk, NULL, "sh_cmt.0");
57 clk_put(clk);
58 }
59#else
32 r8a7791_clock_init(); 60 r8a7791_clock_init();
33#endif 61#endif
34 r8a7791_add_dt_devices(); 62 r8a7791_add_dt_devices();