diff options
author | Tony Lindgren <tony@atomide.com> | 2013-09-25 18:44:39 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2013-09-25 18:44:39 -0400 |
commit | 6a08e1e6f7fafa2fa5fb6a129c4c8d9c29f11b62 (patch) | |
tree | c844d46ce2ea61c0901683b1fe481bc8399b0829 | |
parent | f2acae69a2060b6b1029b9923dbef5e98a8a0ba7 (diff) |
ARM: OMAP2+: Add quirk support for legacy platform data init
We want to drop the board-*.c files but keep things working.
Let's make it a bit easier to support legacy platform data
init with quirks. This also keeps board-generic.c clean from
board specific hacks.
For now, the quirks table is empty, that is populated
in the later patches.
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pdata-quirks.c | 39 |
4 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index afb457c3135b..f8d4a1b83864 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -233,7 +233,7 @@ obj-y += drm.o | |||
233 | endif | 233 | endif |
234 | 234 | ||
235 | # Specific board support | 235 | # Specific board support |
236 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o | 236 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o |
237 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o | 237 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o |
238 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o | 238 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o |
239 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o | 239 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 39c78387ddec..022b0df94e0d 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -56,6 +56,7 @@ static void __init omap_generic_init(void) | |||
56 | omap_sdrc_init(NULL, NULL); | 56 | omap_sdrc_init(NULL, NULL); |
57 | 57 | ||
58 | of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); | 58 | of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); |
59 | pdata_quirks_init(); | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * HACK: call display setup code for selected boards to enable omapdss. | 62 | * HACK: call display setup code for selected boards to enable omapdss. |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 4a5684b96492..fd059e02574d 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -288,6 +288,8 @@ static inline void omap4_cpu_resume(void) | |||
288 | 288 | ||
289 | #endif | 289 | #endif |
290 | 290 | ||
291 | void pdata_quirks_init(void); | ||
292 | |||
291 | struct omap_sdrc_params; | 293 | struct omap_sdrc_params; |
292 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 294 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
293 | struct omap_sdrc_params *sdrc_cs1); | 295 | struct omap_sdrc_params *sdrc_cs1); |
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c new file mode 100644 index 000000000000..e6051998f929 --- /dev/null +++ b/arch/arm/mach-omap2/pdata-quirks.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Legacy platform_data quirks | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #include <linux/clk.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/kernel.h> | ||
13 | |||
14 | #include "common.h" | ||
15 | #include "common-board-devices.h" | ||
16 | #include "dss-common.h" | ||
17 | |||
18 | struct pdata_init { | ||
19 | const char *compatible; | ||
20 | void (*fn)(void); | ||
21 | }; | ||
22 | |||
23 | static struct pdata_init pdata_quirks[] __initdata = { | ||
24 | { /* sentinel */ }, | ||
25 | }; | ||
26 | |||
27 | void __init pdata_quirks_init(void) | ||
28 | { | ||
29 | struct pdata_init *quirks = pdata_quirks; | ||
30 | |||
31 | while (quirks->compatible) { | ||
32 | if (of_machine_is_compatible(quirks->compatible)) { | ||
33 | if (quirks->fn) | ||
34 | quirks->fn(); | ||
35 | break; | ||
36 | } | ||
37 | quirks++; | ||
38 | } | ||
39 | } | ||