diff options
author | Magnus Damm <damm@opensource.se> | 2014-03-12 19:36:35 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-04-13 22:30:39 -0400 |
commit | 89aff406dbc3ea3dfc008e8472181532c0c0f4ea (patch) | |
tree | 4ae4accbc3fce08b8ec9e2497bf02e395547c7d7 /arch/arm/mach-shmobile | |
parent | e6597e0e19bbabfdd1983dbe79892d8ba210a180 (diff) |
ARM: shmobile: Use shmobile_clk_workaround() on Koelsch
Convert the Koelsch DT reference code to use the newly introduced
function shmobile_clk_workaround().
Signed-off-by: Magnus Damm <damm@opensource.se>
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-koelsch-reference.c | 71 |
1 files changed, 28 insertions, 43 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index a3fd30242bd8..a760f7f19bc9 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c | |||
@@ -19,12 +19,11 @@ | |||
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> | ||
24 | #include <linux/dma-mapping.h> | 22 | #include <linux/dma-mapping.h> |
25 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
26 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
27 | #include <linux/platform_data/rcar-du.h> | 25 | #include <linux/platform_data/rcar-du.h> |
26 | #include <mach/clock.h> | ||
28 | #include <mach/common.h> | 27 | #include <mach/common.h> |
29 | #include <mach/irqs.h> | 28 | #include <mach/irqs.h> |
30 | #include <mach/rcar-gen2.h> | 29 | #include <mach/rcar-gen2.h> |
@@ -82,49 +81,35 @@ static void __init koelsch_add_du_device(void) | |||
82 | platform_device_register_full(&info); | 81 | platform_device_register_full(&info); |
83 | } | 82 | } |
84 | 83 | ||
84 | /* | ||
85 | * This is a really crude hack to provide clkdev support to platform | ||
86 | * devices until they get moved to DT. | ||
87 | */ | ||
88 | static const struct clk_name clk_names[] = { | ||
89 | { "cmt0", NULL, "sh_cmt.0" }, | ||
90 | { "scifa0", NULL, "sh-sci.0" }, | ||
91 | { "scifa1", NULL, "sh-sci.1" }, | ||
92 | { "scifb0", NULL, "sh-sci.2" }, | ||
93 | { "scifb1", NULL, "sh-sci.3" }, | ||
94 | { "scifb2", NULL, "sh-sci.4" }, | ||
95 | { "scifa2", NULL, "sh-sci.5" }, | ||
96 | { "scif0", NULL, "sh-sci.6" }, | ||
97 | { "scif1", NULL, "sh-sci.7" }, | ||
98 | { "scif2", NULL, "sh-sci.8" }, | ||
99 | { "scif3", NULL, "sh-sci.9" }, | ||
100 | { "scif4", NULL, "sh-sci.10" }, | ||
101 | { "scif5", NULL, "sh-sci.11" }, | ||
102 | { "scifa3", NULL, "sh-sci.12" }, | ||
103 | { "scifa4", NULL, "sh-sci.13" }, | ||
104 | { "scifa5", NULL, "sh-sci.14" }, | ||
105 | { "du0", "du.0", "rcar-du-r8a7791" }, | ||
106 | { "du1", "du.1", "rcar-du-r8a7791" }, | ||
107 | { "lvds0", "lvds.0", "rcar-du-r8a7791" }, | ||
108 | }; | ||
109 | |||
85 | static void __init koelsch_add_standard_devices(void) | 110 | static void __init koelsch_add_standard_devices(void) |
86 | { | 111 | { |
87 | /* | 112 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); |
88 | * This is a really crude hack to provide clkdev support to the CMT and | ||
89 | * DU devices until they get moved to DT. | ||
90 | */ | ||
91 | static const struct clk_name { | ||
92 | const char *clk; | ||
93 | const char *con_id; | ||
94 | const char *dev_id; | ||
95 | } clk_names[] = { | ||
96 | { "cmt0", NULL, "sh_cmt.0" }, | ||
97 | { "scifa0", NULL, "sh-sci.0" }, | ||
98 | { "scifa1", NULL, "sh-sci.1" }, | ||
99 | { "scifb0", NULL, "sh-sci.2" }, | ||
100 | { "scifb1", NULL, "sh-sci.3" }, | ||
101 | { "scifb2", NULL, "sh-sci.4" }, | ||
102 | { "scifa2", NULL, "sh-sci.5" }, | ||
103 | { "scif0", NULL, "sh-sci.6" }, | ||
104 | { "scif1", NULL, "sh-sci.7" }, | ||
105 | { "scif2", NULL, "sh-sci.8" }, | ||
106 | { "scif3", NULL, "sh-sci.9" }, | ||
107 | { "scif4", NULL, "sh-sci.10" }, | ||
108 | { "scif5", NULL, "sh-sci.11" }, | ||
109 | { "scifa3", NULL, "sh-sci.12" }, | ||
110 | { "scifa4", NULL, "sh-sci.13" }, | ||
111 | { "scifa5", NULL, "sh-sci.14" }, | ||
112 | { "du0", "du.0", "rcar-du-r8a7791" }, | ||
113 | { "du1", "du.1", "rcar-du-r8a7791" }, | ||
114 | { "lvds0", "lvds.0", "rcar-du-r8a7791" }, | ||
115 | }; | ||
116 | struct clk *clk; | ||
117 | unsigned int i; | ||
118 | |||
119 | for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { | ||
120 | clk = clk_get(NULL, clk_names[i].clk); | ||
121 | if (!IS_ERR(clk)) { | ||
122 | clk_register_clkdev(clk, clk_names[i].con_id, | ||
123 | clk_names[i].dev_id); | ||
124 | clk_put(clk); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | r8a7791_add_dt_devices(); | 113 | r8a7791_add_dt_devices(); |
129 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 114 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
130 | 115 | ||