Commit | Line | Data |
---|---|---|
577145f4 VP |
1 | /* |
2 | * Copyright (C) 2009 Texas Instruments Inc. | |
3 | * Mikkel Christensen <mlc@ti.com> | |
4 | * | |
5 | * Modified from mach-omap2/board-ldp.c | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
10 | */ | |
11 | ||
12 | #include <linux/kernel.h> | |
13 | #include <linux/init.h> | |
14 | #include <linux/platform_device.h> | |
70ac51ab | 15 | #include <linux/input.h> |
577145f4 | 16 | #include <linux/gpio.h> |
f0fba2ad | 17 | #include <linux/i2c/twl.h> |
577145f4 VP |
18 | |
19 | #include <asm/mach-types.h> | |
20 | #include <asm/mach/arch.h> | |
21 | ||
ce491cf8 | 22 | #include <plat/common.h> |
479f12c9 | 23 | #include <plat/board.h> |
577145f4 | 24 | |
62d0b336 | 25 | #include <mach/board-zoom.h> |
70ac51ab | 26 | |
ca5742bd | 27 | #include "mux.h" |
02563a5d | 28 | #include "sdram-micron-mt46h32m32lf-6.h" |
70ac51ab | 29 | |
b3c6df3a PW |
30 | static void __init omap_zoom2_init_irq(void) |
31 | { | |
02563a5d TR |
32 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, |
33 | mt46h32m32lf6_sdrc_params); | |
b3c6df3a PW |
34 | omap_init_irq(); |
35 | omap_gpio_init(); | |
36 | } | |
37 | ||
f0fba2ad LG |
38 | /* EXTMUTE callback function */ |
39 | void zoom2_set_hs_extmute(int mute) | |
40 | { | |
41 | gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); | |
42 | } | |
70ac51ab VP |
43 | |
44 | static struct twl4030_madc_platform_data zoom2_madc_data = { | |
45 | .irq_line = 1, | |
577145f4 VP |
46 | }; |
47 | ||
f8d9aad9 PU |
48 | static struct twl4030_codec_audio_data zoom2_audio_data = { |
49 | .audio_mclk = 26000000, | |
f0fba2ad LG |
50 | .ramp_delay_value = 3, /* 161 ms */ |
51 | .hs_extmute = 1, | |
52 | .set_hs_extmute = zoom2_set_hs_extmute, | |
f8d9aad9 PU |
53 | }; |
54 | ||
55 | static struct twl4030_codec_data zoom2_codec_data = { | |
953e2f3d | 56 | .audio_mclk = 26000000, |
f8d9aad9 PU |
57 | .audio = &zoom2_audio_data, |
58 | }; | |
59 | ||
577145f4 VP |
60 | static struct twl4030_platform_data zoom2_twldata = { |
61 | .irq_base = TWL4030_IRQ_BASE, | |
62 | .irq_end = TWL4030_IRQ_END, | |
63 | ||
64 | /* platform_data for children goes here */ | |
70ac51ab VP |
65 | .bci = &zoom2_bci_data, |
66 | .madc = &zoom2_madc_data, | |
67 | .usb = &zoom2_usb_data, | |
577145f4 | 68 | .gpio = &zoom2_gpio_data, |
70ac51ab | 69 | .keypad = &zoom2_kp_twl4030_data, |
f8d9aad9 | 70 | .codec = &zoom2_codec_data, |
70ac51ab VP |
71 | .vmmc1 = &zoom2_vmmc1, |
72 | .vmmc2 = &zoom2_vmmc2, | |
73 | .vsim = &zoom2_vsim, | |
f0fba2ad | 74 | }; |
70ac51ab | 75 | |
f0fba2ad LG |
76 | static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = { |
77 | { | |
78 | I2C_BOARD_INFO("twl4030", 0x48), | |
79 | .flags = I2C_CLIENT_WAKE, | |
80 | .irq = INT_34XX_SYS_NIRQ, | |
81 | .platform_data = &zoom2_twldata, | |
82 | }, | |
577145f4 VP |
83 | }; |
84 | ||
f0fba2ad LG |
85 | static int __init omap3_zoom2_i2c_init(void) |
86 | { | |
87 | omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo, | |
88 | ARRAY_SIZE(zoom2_i2c_boardinfo)); | |
89 | return 0; | |
90 | } | |
91 | ||
577145f4 | 92 | |
ca5742bd TL |
93 | #ifdef CONFIG_OMAP_MUX |
94 | static struct omap_board_mux board_mux[] __initdata = { | |
95 | { .reg_offset = OMAP_MUX_TERMINATOR }, | |
96 | }; | |
97 | #else | |
98 | #define board_mux NULL | |
99 | #endif | |
100 | ||
577145f4 VP |
101 | static void __init omap_zoom2_init(void) |
102 | { | |
ca5742bd | 103 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
479f12c9 | 104 | zoom_peripherals_init(); |
f0fba2ad | 105 | omap3_zoom2_i2c_init(); |
62d0b336 | 106 | zoom_debugboard_init(); |
577145f4 VP |
107 | } |
108 | ||
109 | static void __init omap_zoom2_map_io(void) | |
110 | { | |
111 | omap2_set_globals_343x(); | |
6fbd55d0 | 112 | omap34xx_map_common_io(); |
577145f4 VP |
113 | } |
114 | ||
115 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | |
a4f57b81 TL |
116 | .phys_io = ZOOM_UART_BASE, |
117 | .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc, | |
577145f4 VP |
118 | .boot_params = 0x80000100, |
119 | .map_io = omap_zoom2_map_io, | |
120 | .init_irq = omap_zoom2_init_irq, | |
121 | .init_machine = omap_zoom2_init, | |
122 | .timer = &omap_timer, | |
123 | MACHINE_END |