aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pdata-quirks.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-12-08 17:15:35 -0500
committerTony Lindgren <tony@atomide.com>2013-12-08 17:15:35 -0500
commit841af81f7a180f5793cb0d82a7a7626bbc17c028 (patch)
tree46107f319d52a729ffcd76238df6285d8810f358 /arch/arm/mach-omap2/pdata-quirks.c
parentf2e2c9d9b4087b74eb9e00d8dfac148354cb0b71 (diff)
parent218077a3c03d8c136691a0020424633525fcdc85 (diff)
Merge branch 'omap-for-v3.14/board-removal' into omap-for-v3.14/omap3-board-removal
Diffstat (limited to 'arch/arm/mach-omap2/pdata-quirks.c')
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c48
1 files changed, 41 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 39f020c982e8..6a7554515b6e 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -26,6 +26,8 @@ struct pdata_init {
26 void (*fn)(void); 26 void (*fn)(void);
27}; 27};
28 28
29struct of_dev_auxdata omap_auxdata_lookup[];
30
29/* 31/*
30 * Create alias for USB host PHY clock. 32 * Create alias for USB host PHY clock.
31 * Remove this when clock phandle can be provided via DT 33 * Remove this when clock phandle can be provided via DT
@@ -68,6 +70,15 @@ static inline void legacy_init_wl12xx(unsigned ref_clock,
68} 70}
69#endif 71#endif
70 72
73#ifdef CONFIG_MACH_NOKIA_N8X0
74static void __init omap2420_n8x0_legacy_init(void)
75{
76 omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
77}
78#else
79#define omap2420_n8x0_legacy_init NULL
80#endif
81
71#ifdef CONFIG_ARCH_OMAP3 82#ifdef CONFIG_ARCH_OMAP3
72static void __init hsmmc2_internal_input_clk(void) 83static void __init hsmmc2_internal_input_clk(void)
73{ 84{
@@ -125,7 +136,23 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
125 pcs_pdata.rearm = rearm; 136 pcs_pdata.rearm = rearm;
126} 137}
127 138
139/*
140 * Few boards still need auxdata populated before we populate
141 * the dev entries in of_platform_populate().
142 */
143static struct pdata_init auxdata_quirks[] __initdata = {
144#ifdef CONFIG_SOC_OMAP2420
145 { "nokia,n800", omap2420_n8x0_legacy_init, },
146 { "nokia,n810", omap2420_n8x0_legacy_init, },
147 { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
148#endif
149 { /* sentinel */ },
150};
151
128struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 152struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
153#ifdef CONFIG_MACH_NOKIA_N8X0
154 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
155#endif
129#ifdef CONFIG_ARCH_OMAP3 156#ifdef CONFIG_ARCH_OMAP3
130 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 157 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
131 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 158 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
@@ -137,6 +164,10 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
137 { /* sentinel */ }, 164 { /* sentinel */ },
138}; 165};
139 166
167/*
168 * Few boards still need to initialize some legacy devices with
169 * platform data until the drivers support device tree.
170 */
140static struct pdata_init pdata_quirks[] __initdata = { 171static struct pdata_init pdata_quirks[] __initdata = {
141#ifdef CONFIG_ARCH_OMAP3 172#ifdef CONFIG_ARCH_OMAP3
142 { "nokia,omap3-n900", hsmmc2_internal_input_clk, }, 173 { "nokia,omap3-n900", hsmmc2_internal_input_clk, },
@@ -156,14 +187,8 @@ static struct pdata_init pdata_quirks[] __initdata = {
156 { /* sentinel */ }, 187 { /* sentinel */ },
157}; 188};
158 189
159void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) 190static void pdata_quirks_check(struct pdata_init *quirks)
160{ 191{
161 struct pdata_init *quirks = pdata_quirks;
162
163 omap_sdrc_init(NULL, NULL);
164 of_platform_populate(NULL, omap_dt_match_table,
165 omap_auxdata_lookup, NULL);
166
167 while (quirks->compatible) { 192 while (quirks->compatible) {
168 if (of_machine_is_compatible(quirks->compatible)) { 193 if (of_machine_is_compatible(quirks->compatible)) {
169 if (quirks->fn) 194 if (quirks->fn)
@@ -173,3 +198,12 @@ void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table)
173 quirks++; 198 quirks++;
174 } 199 }
175} 200}
201
202void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table)
203{
204 omap_sdrc_init(NULL, NULL);
205 pdata_quirks_check(auxdata_quirks);
206 of_platform_populate(NULL, omap_dt_match_table,
207 omap_auxdata_lookup, NULL);
208 pdata_quirks_check(pdata_quirks);
209}