aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pdata-quirks.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-09-25 18:44:39 -0400
committerTony Lindgren <tony@atomide.com>2013-09-25 18:44:39 -0400
commit6a08e1e6f7fafa2fa5fb6a129c4c8d9c29f11b62 (patch)
treec844d46ce2ea61c0901683b1fe481bc8399b0829 /arch/arm/mach-omap2/pdata-quirks.c
parentf2acae69a2060b6b1029b9923dbef5e98a8a0ba7 (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>
Diffstat (limited to 'arch/arm/mach-omap2/pdata-quirks.c')
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c39
1 files changed, 39 insertions, 0 deletions
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
18struct pdata_init {
19 const char *compatible;
20 void (*fn)(void);
21};
22
23static struct pdata_init pdata_quirks[] __initdata = {
24 { /* sentinel */ },
25};
26
27void __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}