aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2014-03-12 19:36:26 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-04-13 22:30:39 -0400
commite6597e0e19bbabfdd1983dbe79892d8ba210a180 (patch)
tree61a73ec06f1c99e02867f945ca838669ad774953 /arch/arm/mach-shmobile
parent58ea1d53ba93620ac50fef9d9720b2323971f243 (diff)
ARM: shmobile: Use shmobile_clk_workaround() on Lager
Convert the Lager 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-lager-reference.c65
1 files changed, 25 insertions, 40 deletions
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 440aac36d693..c76248b9a5e7 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -18,12 +18,11 @@
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>
23#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
24#include <linux/init.h> 22#include <linux/init.h>
25#include <linux/of_platform.h> 23#include <linux/of_platform.h>
26#include <linux/platform_data/rcar-du.h> 24#include <linux/platform_data/rcar-du.h>
25#include <mach/clock.h>
27#include <mach/common.h> 26#include <mach/common.h>
28#include <mach/irqs.h> 27#include <mach/irqs.h>
29#include <mach/rcar-gen2.h> 28#include <mach/rcar-gen2.h>
@@ -86,46 +85,32 @@ static void __init lager_add_du_device(void)
86 platform_device_register_full(&info); 85 platform_device_register_full(&info);
87} 86}
88 87
88/*
89 * This is a really crude hack to provide clkdev support to platform
90 * devices until they get moved to DT.
91 */
92static const struct clk_name clk_names[] = {
93 { "cmt0", NULL, "sh_cmt.0" },
94 { "scifa0", NULL, "sh-sci.0" },
95 { "scifa1", NULL, "sh-sci.1" },
96 { "scifb0", NULL, "sh-sci.2" },
97 { "scifb1", NULL, "sh-sci.3" },
98 { "scifb2", NULL, "sh-sci.4" },
99 { "scifa2", NULL, "sh-sci.5" },
100 { "scif0", NULL, "sh-sci.6" },
101 { "scif1", NULL, "sh-sci.7" },
102 { "hscif0", NULL, "sh-sci.8" },
103 { "hscif1", NULL, "sh-sci.9" },
104 { "du0", "du.0", "rcar-du-r8a7790" },
105 { "du1", "du.1", "rcar-du-r8a7790" },
106 { "du2", "du.2", "rcar-du-r8a7790" },
107 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
108 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
109};
110
89static void __init lager_add_standard_devices(void) 111static void __init lager_add_standard_devices(void)
90{ 112{
91 /* 113 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
92 * This is a really crude hack to provide clkdev support to platform
93 * devices until they get moved to DT.
94 */
95 static const struct clk_name {
96 const char *clk;
97 const char *con_id;
98 const char *dev_id;
99 } clk_names[] = {
100 { "cmt0", NULL, "sh_cmt.0" },
101 { "scifa0", NULL, "sh-sci.0" },
102 { "scifa1", NULL, "sh-sci.1" },
103 { "scifb0", NULL, "sh-sci.2" },
104 { "scifb1", NULL, "sh-sci.3" },
105 { "scifb2", NULL, "sh-sci.4" },
106 { "scifa2", NULL, "sh-sci.5" },
107 { "scif0", NULL, "sh-sci.6" },
108 { "scif1", NULL, "sh-sci.7" },
109 { "hscif0", NULL, "sh-sci.8" },
110 { "hscif1", NULL, "sh-sci.9" },
111 { "du0", "du.0", "rcar-du-r8a7790" },
112 { "du1", "du.1", "rcar-du-r8a7790" },
113 { "du2", "du.2", "rcar-du-r8a7790" },
114 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
115 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
116 };
117 struct clk *clk;
118 unsigned int i;
119
120 for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
121 clk = clk_get(NULL, clk_names[i].clk);
122 if (!IS_ERR(clk)) {
123 clk_register_clkdev(clk, clk_names[i].con_id,
124 clk_names[i].dev_id);
125 clk_put(clk);
126 }
127 }
128
129 r8a7790_add_dt_devices(); 114 r8a7790_add_dt_devices();
130 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 115 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
131 116