diff options
author | Benoit Cousson <b-cousson@ti.com> | 2011-09-22 15:52:02 -0400 |
---|---|---|
committer | Benoit Cousson <b-cousson@ti.com> | 2011-10-04 16:27:05 -0400 |
commit | a7cbb9b15d55dff0488b1a6d93929c2386d8632b (patch) | |
tree | 5057b85e55910e82f89afdb40d29585c10b5f48f /arch/arm/mach-omap2 | |
parent | 8d61649ddf6707d89fc10028f9d1bd1a2ea37b4f (diff) |
ARM: OMAP2+: board-generic: Add i2c static init
Still needed to boot until the i2c & twl driver is adapted to
device-tree. Otherwise the voltage control code will try to
access the twl and crash.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 62c6b2e8b5d7..d9ccb9d98e15 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/irqdomain.h> | 17 | #include <linux/irqdomain.h> |
18 | #include <linux/i2c/twl.h> | ||
18 | 19 | ||
19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
20 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
@@ -22,7 +23,31 @@ | |||
22 | #include <plat/board.h> | 23 | #include <plat/board.h> |
23 | #include <plat/common.h> | 24 | #include <plat/common.h> |
24 | #include <mach/omap4-common.h> | 25 | #include <mach/omap4-common.h> |
26 | #include "common-board-devices.h" | ||
25 | 27 | ||
28 | /* | ||
29 | * XXX: Still needed to boot until the i2c & twl driver is adapted to | ||
30 | * device-tree | ||
31 | */ | ||
32 | static struct twl4030_platform_data sdp4430_twldata = { | ||
33 | .irq_base = TWL6030_IRQ_BASE, | ||
34 | .irq_end = TWL6030_IRQ_END, | ||
35 | }; | ||
36 | |||
37 | static void __init omap4_i2c_init(void) | ||
38 | { | ||
39 | omap4_pmic_init("twl6030", &sdp4430_twldata); | ||
40 | } | ||
41 | |||
42 | static struct twl4030_platform_data beagle_twldata = { | ||
43 | .irq_base = TWL4030_IRQ_BASE, | ||
44 | .irq_end = TWL4030_IRQ_END, | ||
45 | }; | ||
46 | |||
47 | static void __init omap3_i2c_init(void) | ||
48 | { | ||
49 | omap3_pmic_init("twl4030", &beagle_twldata); | ||
50 | } | ||
26 | 51 | ||
27 | static struct of_device_id omap_dt_match_table[] __initdata = { | 52 | static struct of_device_id omap_dt_match_table[] __initdata = { |
28 | { .compatible = "simple-bus", }, | 53 | { .compatible = "simple-bus", }, |
@@ -48,6 +73,18 @@ static void __init omap_generic_init(void) | |||
48 | of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); | 73 | of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); |
49 | } | 74 | } |
50 | 75 | ||
76 | static void __init omap4_init(void) | ||
77 | { | ||
78 | omap4_i2c_init(); | ||
79 | omap_generic_init(); | ||
80 | } | ||
81 | |||
82 | static void __init omap3_init(void) | ||
83 | { | ||
84 | omap3_i2c_init(); | ||
85 | omap_generic_init(); | ||
86 | } | ||
87 | |||
51 | #if defined(CONFIG_SOC_OMAP2420) | 88 | #if defined(CONFIG_SOC_OMAP2420) |
52 | static const char *omap242x_boards_compat[] __initdata = { | 89 | static const char *omap242x_boards_compat[] __initdata = { |
53 | "ti,omap2420", | 90 | "ti,omap2420", |
@@ -93,7 +130,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") | |||
93 | .map_io = omap3_map_io, | 130 | .map_io = omap3_map_io, |
94 | .init_early = omap3430_init_early, | 131 | .init_early = omap3430_init_early, |
95 | .init_irq = omap3_init_irq, | 132 | .init_irq = omap3_init_irq, |
96 | .init_machine = omap_generic_init, | 133 | .init_machine = omap3_init, |
97 | .timer = &omap3_timer, | 134 | .timer = &omap3_timer, |
98 | .dt_compat = omap3_boards_compat, | 135 | .dt_compat = omap3_boards_compat, |
99 | MACHINE_END | 136 | MACHINE_END |
@@ -110,7 +147,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") | |||
110 | .map_io = omap4_map_io, | 147 | .map_io = omap4_map_io, |
111 | .init_early = omap4430_init_early, | 148 | .init_early = omap4430_init_early, |
112 | .init_irq = gic_init_irq, | 149 | .init_irq = gic_init_irq, |
113 | .init_machine = omap_generic_init, | 150 | .init_machine = omap4_init, |
114 | .timer = &omap4_timer, | 151 | .timer = &omap4_timer, |
115 | .dt_compat = omap4_boards_compat, | 152 | .dt_compat = omap4_boards_compat, |
116 | MACHINE_END | 153 | MACHINE_END |