vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Texas Instruments Inc. |
| 3 | * |
| 4 | * Modified from mach-omap2/board-zoom2.c |
| 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 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/input.h> |
| 15 | #include <linux/input/matrix_keypad.h> |
| 16 | #include <linux/gpio.h> |
Balaji T K | ebeb53e | 2009-12-15 20:09:02 +0530 | [diff] [blame] | 17 | #include <linux/i2c/twl.h> |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 18 | #include <linux/regulator/machine.h> |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 19 | #include <linux/regulator/fixed.h> |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 20 | #include <linux/wl12xx.h> |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 21 | #include <linux/mmc/host.h> |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 22 | |
| 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/mach/arch.h> |
| 25 | #include <asm/mach/map.h> |
| 26 | |
| 27 | #include <plat/common.h> |
| 28 | #include <plat/usb.h> |
| 29 | |
Jarkko Nikula | 4b285c3 | 2010-09-23 19:11:54 +0300 | [diff] [blame] | 30 | #include <mach/board-zoom.h> |
| 31 | |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 32 | #include "mux.h" |
Adrian Hunter | d02a900b | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 33 | #include "hsmmc.h" |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 34 | |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 35 | #define OMAP_ZOOM_WLAN_PMENA_GPIO (101) |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 36 | #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 37 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 38 | /* Zoom2 has Qwerty keyboard*/ |
Manjunath Kondaiah G | bead437 | 2010-10-08 10:01:13 -0700 | [diff] [blame] | 39 | static uint32_t board_keymap[] = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 40 | KEY(0, 0, KEY_E), |
| 41 | KEY(0, 1, KEY_R), |
| 42 | KEY(0, 2, KEY_T), |
| 43 | KEY(0, 3, KEY_HOME), |
| 44 | KEY(0, 6, KEY_I), |
| 45 | KEY(0, 7, KEY_LEFTSHIFT), |
| 46 | KEY(1, 0, KEY_D), |
| 47 | KEY(1, 1, KEY_F), |
| 48 | KEY(1, 2, KEY_G), |
| 49 | KEY(1, 3, KEY_SEND), |
| 50 | KEY(1, 6, KEY_K), |
| 51 | KEY(1, 7, KEY_ENTER), |
| 52 | KEY(2, 0, KEY_X), |
| 53 | KEY(2, 1, KEY_C), |
| 54 | KEY(2, 2, KEY_V), |
| 55 | KEY(2, 3, KEY_END), |
| 56 | KEY(2, 6, KEY_DOT), |
| 57 | KEY(2, 7, KEY_CAPSLOCK), |
| 58 | KEY(3, 0, KEY_Z), |
| 59 | KEY(3, 1, KEY_KPPLUS), |
| 60 | KEY(3, 2, KEY_B), |
| 61 | KEY(3, 3, KEY_F1), |
| 62 | KEY(3, 6, KEY_O), |
| 63 | KEY(3, 7, KEY_SPACE), |
| 64 | KEY(4, 0, KEY_W), |
| 65 | KEY(4, 1, KEY_Y), |
| 66 | KEY(4, 2, KEY_U), |
| 67 | KEY(4, 3, KEY_F2), |
| 68 | KEY(4, 4, KEY_VOLUMEUP), |
| 69 | KEY(4, 6, KEY_L), |
| 70 | KEY(4, 7, KEY_LEFT), |
| 71 | KEY(5, 0, KEY_S), |
| 72 | KEY(5, 1, KEY_H), |
| 73 | KEY(5, 2, KEY_J), |
| 74 | KEY(5, 3, KEY_F3), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 75 | KEY(5, 4, KEY_UNKNOWN), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 76 | KEY(5, 5, KEY_VOLUMEDOWN), |
| 77 | KEY(5, 6, KEY_M), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 78 | KEY(5, 7, KEY_RIGHT), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 79 | KEY(6, 0, KEY_Q), |
| 80 | KEY(6, 1, KEY_A), |
| 81 | KEY(6, 2, KEY_N), |
| 82 | KEY(6, 3, KEY_BACKSPACE), |
| 83 | KEY(6, 6, KEY_P), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 84 | KEY(6, 7, KEY_UP), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 85 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ |
| 86 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ |
| 87 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ |
| 88 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 89 | KEY(7, 6, KEY_SELECT), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 90 | KEY(7, 7, KEY_DOWN) |
| 91 | }; |
| 92 | |
| 93 | static struct matrix_keymap_data board_map_data = { |
| 94 | .keymap = board_keymap, |
| 95 | .keymap_size = ARRAY_SIZE(board_keymap), |
| 96 | }; |
| 97 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 98 | static struct twl4030_keypad_data zoom_kp_twl4030_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 99 | .keymap_data = &board_map_data, |
| 100 | .rows = 8, |
| 101 | .cols = 8, |
| 102 | .rep = 1, |
| 103 | }; |
| 104 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 105 | static struct regulator_consumer_supply zoom_vmmc1_supply = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 106 | .supply = "vmmc", |
| 107 | }; |
| 108 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 109 | static struct regulator_consumer_supply zoom_vsim_supply = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 110 | .supply = "vmmc_aux", |
| 111 | }; |
| 112 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 113 | static struct regulator_consumer_supply zoom_vmmc2_supply = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 114 | .supply = "vmmc", |
| 115 | }; |
| 116 | |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 117 | static struct regulator_consumer_supply zoom_vmmc3_supply = { |
| 118 | .supply = "vmmc", |
| 119 | .dev_name = "mmci-omap-hs.2", |
| 120 | }; |
| 121 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 122 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 123 | static struct regulator_init_data zoom_vmmc1 = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 124 | .constraints = { |
| 125 | .min_uV = 1850000, |
| 126 | .max_uV = 3150000, |
| 127 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 128 | | REGULATOR_MODE_STANDBY, |
| 129 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 130 | | REGULATOR_CHANGE_MODE |
| 131 | | REGULATOR_CHANGE_STATUS, |
| 132 | }, |
| 133 | .num_consumer_supplies = 1, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 134 | .consumer_supplies = &zoom_vmmc1_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 135 | }; |
| 136 | |
| 137 | /* VMMC2 for MMC2 card */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 138 | static struct regulator_init_data zoom_vmmc2 = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 139 | .constraints = { |
| 140 | .min_uV = 1850000, |
| 141 | .max_uV = 1850000, |
| 142 | .apply_uV = true, |
| 143 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 144 | | REGULATOR_MODE_STANDBY, |
| 145 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 146 | | REGULATOR_CHANGE_STATUS, |
| 147 | }, |
| 148 | .num_consumer_supplies = 1, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 149 | .consumer_supplies = &zoom_vmmc2_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 150 | }; |
| 151 | |
| 152 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 153 | static struct regulator_init_data zoom_vsim = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 154 | .constraints = { |
| 155 | .min_uV = 1800000, |
| 156 | .max_uV = 3000000, |
| 157 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 158 | | REGULATOR_MODE_STANDBY, |
| 159 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 160 | | REGULATOR_CHANGE_MODE |
| 161 | | REGULATOR_CHANGE_STATUS, |
| 162 | }, |
| 163 | .num_consumer_supplies = 1, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 164 | .consumer_supplies = &zoom_vsim_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 165 | }; |
| 166 | |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 167 | static struct regulator_init_data zoom_vmmc3 = { |
| 168 | .constraints = { |
| 169 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 170 | }, |
| 171 | .num_consumer_supplies = 1, |
| 172 | .consumer_supplies = &zoom_vmmc3_supply, |
| 173 | }; |
| 174 | |
| 175 | static struct fixed_voltage_config zoom_vwlan = { |
| 176 | .supply_name = "vwl1271", |
| 177 | .microvolts = 1800000, /* 1.8V */ |
| 178 | .gpio = OMAP_ZOOM_WLAN_PMENA_GPIO, |
| 179 | .startup_delay = 70000, /* 70msec */ |
| 180 | .enable_high = 1, |
| 181 | .enabled_at_boot = 0, |
| 182 | .init_data = &zoom_vmmc3, |
| 183 | }; |
| 184 | |
| 185 | static struct platform_device omap_vwlan_device = { |
| 186 | .name = "reg-fixed-voltage", |
| 187 | .id = 1, |
| 188 | .dev = { |
| 189 | .platform_data = &zoom_vwlan, |
| 190 | }, |
| 191 | }; |
| 192 | |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 193 | struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { |
| 194 | .irq = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO), |
| 195 | /* ZOOM ref clock is 26 MHz */ |
| 196 | .board_ref_clock = 1, |
| 197 | }; |
| 198 | |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 199 | static struct omap2_hsmmc_info mmc[] __initdata = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 200 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 201 | .name = "external", |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 202 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 203 | .caps = MMC_CAP_4_BIT_DATA, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 204 | .gpio_wp = -EINVAL, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 205 | .power_saving = true, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 206 | }, |
| 207 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 208 | .name = "internal", |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 209 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 210 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 211 | .gpio_cd = -EINVAL, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 212 | .gpio_wp = -EINVAL, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 213 | .nonremovable = true, |
| 214 | .power_saving = true, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 215 | }, |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 216 | { |
| 217 | .name = "wl1271", |
| 218 | .mmc = 3, |
Ohad Ben-Cohen | f8110364 | 2010-11-26 23:59:24 +0000 | [diff] [blame^] | 219 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 220 | .gpio_wp = -EINVAL, |
| 221 | .gpio_cd = -EINVAL, |
| 222 | .nonremovable = true, |
| 223 | }, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 224 | {} /* Terminator */ |
| 225 | }; |
| 226 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 227 | static int zoom_twl_gpio_setup(struct device *dev, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 228 | unsigned gpio, unsigned ngpio) |
| 229 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 230 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 231 | mmc[0].gpio_cd = gpio + 0; |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 232 | omap2_hsmmc_init(mmc); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 233 | |
| 234 | /* link regulators to MMC adapters ... we "know" the |
| 235 | * regulators will be set up only *after* we return. |
| 236 | */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 237 | zoom_vmmc1_supply.dev = mmc[0].dev; |
| 238 | zoom_vsim_supply.dev = mmc[0].dev; |
| 239 | zoom_vmmc2_supply.dev = mmc[1].dev; |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 240 | |
| 241 | return 0; |
| 242 | } |
| 243 | |
Jarkko Nikula | 4b285c3 | 2010-09-23 19:11:54 +0300 | [diff] [blame] | 244 | /* EXTMUTE callback function */ |
| 245 | void zoom2_set_hs_extmute(int mute) |
| 246 | { |
| 247 | gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); |
| 248 | } |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 249 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 250 | static int zoom_batt_table[] = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 251 | /* 0 C*/ |
| 252 | 30800, 29500, 28300, 27100, |
| 253 | 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900, |
| 254 | 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100, |
| 255 | 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310, |
| 256 | 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830, |
| 257 | 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170, |
| 258 | 4040, 3910, 3790, 3670, 3550 |
| 259 | }; |
| 260 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 261 | static struct twl4030_bci_platform_data zoom_bci_data = { |
| 262 | .battery_tmp_tbl = zoom_batt_table, |
| 263 | .tblsize = ARRAY_SIZE(zoom_batt_table), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 264 | }; |
| 265 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 266 | static struct twl4030_usb_data zoom_usb_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 267 | .usb_mode = T2_USB_MODE_ULPI, |
| 268 | }; |
| 269 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 270 | static struct twl4030_gpio_platform_data zoom_gpio_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 271 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 272 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| 273 | .irq_end = TWL4030_GPIO_IRQ_END, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 274 | .setup = zoom_twl_gpio_setup, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 275 | }; |
| 276 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 277 | static struct twl4030_madc_platform_data zoom_madc_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 278 | .irq_line = 1, |
| 279 | }; |
| 280 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 281 | static struct twl4030_codec_audio_data zoom_audio_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 282 | .audio_mclk = 26000000, |
| 283 | }; |
| 284 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 285 | static struct twl4030_codec_data zoom_codec_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 286 | .audio_mclk = 26000000, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 287 | .audio = &zoom_audio_data, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 288 | }; |
| 289 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 290 | static struct twl4030_platform_data zoom_twldata = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 291 | .irq_base = TWL4030_IRQ_BASE, |
| 292 | .irq_end = TWL4030_IRQ_END, |
| 293 | |
| 294 | /* platform_data for children goes here */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 295 | .bci = &zoom_bci_data, |
| 296 | .madc = &zoom_madc_data, |
| 297 | .usb = &zoom_usb_data, |
| 298 | .gpio = &zoom_gpio_data, |
| 299 | .keypad = &zoom_kp_twl4030_data, |
| 300 | .codec = &zoom_codec_data, |
Anand Gadiyar | aed79bc | 2009-12-11 16:16:36 -0800 | [diff] [blame] | 301 | .vmmc1 = &zoom_vmmc1, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 302 | .vmmc2 = &zoom_vmmc2, |
| 303 | .vsim = &zoom_vsim, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 304 | |
| 305 | }; |
| 306 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 307 | static struct i2c_board_info __initdata zoom_i2c_boardinfo[] = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 308 | { |
vikram pandita | 6b61a83 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 309 | I2C_BOARD_INFO("twl5030", 0x48), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 310 | .flags = I2C_CLIENT_WAKE, |
| 311 | .irq = INT_34XX_SYS_NIRQ, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 312 | .platform_data = &zoom_twldata, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 313 | }, |
| 314 | }; |
| 315 | |
| 316 | static int __init omap_i2c_init(void) |
| 317 | { |
Jarkko Nikula | 4b285c3 | 2010-09-23 19:11:54 +0300 | [diff] [blame] | 318 | if (machine_is_omap_zoom2()) { |
| 319 | zoom_audio_data.ramp_delay_value = 3; /* 161 ms */ |
| 320 | zoom_audio_data.hs_extmute = 1; |
| 321 | zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute; |
| 322 | } |
vikram pandita | 6b61a83 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 323 | omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 324 | ARRAY_SIZE(zoom_i2c_boardinfo)); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 325 | omap_register_i2c_bus(2, 400, NULL, 0); |
| 326 | omap_register_i2c_bus(3, 400, NULL, 0); |
| 327 | return 0; |
| 328 | } |
| 329 | |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 330 | static struct omap_musb_board_data musb_board_data = { |
| 331 | .interface_type = MUSB_INTERFACE_ULPI, |
| 332 | .mode = MUSB_OTG, |
| 333 | .power = 100, |
| 334 | }; |
| 335 | |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 336 | static void enable_board_wakeup_source(void) |
| 337 | { |
| 338 | /* T2 interrupt line (keypad) */ |
| 339 | omap_mux_init_signal("sys_nirq", |
| 340 | OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); |
| 341 | } |
| 342 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 343 | void __init zoom_peripherals_init(void) |
| 344 | { |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 345 | if (wl12xx_set_platform_data(&omap_zoom_wlan_data)) |
| 346 | pr_err("error setting wl12xx data\n"); |
| 347 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 348 | omap_i2c_init(); |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 349 | platform_device_register(&omap_vwlan_device); |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 350 | usb_musb_init(&musb_board_data); |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 351 | enable_board_wakeup_source(); |
Govindraj.R | 257f23d | 2010-09-27 20:21:05 +0530 | [diff] [blame] | 352 | omap_serial_init(); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 353 | } |