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> |
Tony Lindgren | 4b25408 | 2012-08-30 15:37:24 -0700 | [diff] [blame] | 22 | #include <linux/platform_data/gpio-omap.h> |
Peter Ujfalusi | c591393 | 2012-12-05 15:39:35 +0100 | [diff] [blame] | 23 | #include <linux/platform_data/omap-twl4030.h> |
Kishon Vijay Abraham I | 51482be | 2013-02-06 18:58:50 +0530 | [diff] [blame] | 24 | #include <linux/usb/phy.h> |
Peter Ujfalusi | 2014f26 | 2013-03-11 12:57:56 +0100 | [diff] [blame] | 25 | #include <linux/pwm.h> |
| 26 | #include <linux/leds_pwm.h> |
| 27 | #include <linux/pwm_backlight.h> |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 28 | |
| 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
| 31 | #include <asm/mach/map.h> |
| 32 | |
Tony Lindgren | 4e65331 | 2011-11-10 22:45:17 +0100 | [diff] [blame] | 33 | #include "common.h" |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 34 | |
Tony Lindgren | 8599e7c | 2012-10-08 09:11:22 -0700 | [diff] [blame] | 35 | #include "board-zoom.h" |
Jarkko Nikula | 4b285c3 | 2010-09-23 19:11:54 +0300 | [diff] [blame] | 36 | |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 37 | #include "mux.h" |
Adrian Hunter | d02a900b | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 38 | #include "hsmmc.h" |
Mike Rapoport | fbd8071 | 2011-04-25 01:09:06 +0300 | [diff] [blame] | 39 | #include "common-board-devices.h" |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 40 | |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 41 | #define OMAP_ZOOM_WLAN_PMENA_GPIO (101) |
Peter Ujfalusi | 98b0606 | 2012-12-05 11:35:32 +0100 | [diff] [blame] | 42 | #define OMAP_ZOOM_TSC2004_IRQ_GPIO (153) |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 43 | #define OMAP_ZOOM_WLAN_IRQ_GPIO (162) |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 44 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 45 | /* Zoom2 has Qwerty keyboard*/ |
Manjunath Kondaiah G | bead437 | 2010-10-08 10:01:13 -0700 | [diff] [blame] | 46 | static uint32_t board_keymap[] = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 47 | KEY(0, 0, KEY_E), |
| 48 | KEY(0, 1, KEY_R), |
| 49 | KEY(0, 2, KEY_T), |
| 50 | KEY(0, 3, KEY_HOME), |
| 51 | KEY(0, 6, KEY_I), |
| 52 | KEY(0, 7, KEY_LEFTSHIFT), |
| 53 | KEY(1, 0, KEY_D), |
| 54 | KEY(1, 1, KEY_F), |
| 55 | KEY(1, 2, KEY_G), |
| 56 | KEY(1, 3, KEY_SEND), |
| 57 | KEY(1, 6, KEY_K), |
| 58 | KEY(1, 7, KEY_ENTER), |
| 59 | KEY(2, 0, KEY_X), |
| 60 | KEY(2, 1, KEY_C), |
| 61 | KEY(2, 2, KEY_V), |
| 62 | KEY(2, 3, KEY_END), |
| 63 | KEY(2, 6, KEY_DOT), |
| 64 | KEY(2, 7, KEY_CAPSLOCK), |
| 65 | KEY(3, 0, KEY_Z), |
| 66 | KEY(3, 1, KEY_KPPLUS), |
| 67 | KEY(3, 2, KEY_B), |
| 68 | KEY(3, 3, KEY_F1), |
| 69 | KEY(3, 6, KEY_O), |
| 70 | KEY(3, 7, KEY_SPACE), |
| 71 | KEY(4, 0, KEY_W), |
| 72 | KEY(4, 1, KEY_Y), |
| 73 | KEY(4, 2, KEY_U), |
| 74 | KEY(4, 3, KEY_F2), |
| 75 | KEY(4, 4, KEY_VOLUMEUP), |
| 76 | KEY(4, 6, KEY_L), |
| 77 | KEY(4, 7, KEY_LEFT), |
| 78 | KEY(5, 0, KEY_S), |
| 79 | KEY(5, 1, KEY_H), |
| 80 | KEY(5, 2, KEY_J), |
| 81 | KEY(5, 3, KEY_F3), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 82 | KEY(5, 4, KEY_UNKNOWN), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 83 | KEY(5, 5, KEY_VOLUMEDOWN), |
| 84 | KEY(5, 6, KEY_M), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 85 | KEY(5, 7, KEY_RIGHT), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 86 | KEY(6, 0, KEY_Q), |
| 87 | KEY(6, 1, KEY_A), |
| 88 | KEY(6, 2, KEY_N), |
| 89 | KEY(6, 3, KEY_BACKSPACE), |
| 90 | KEY(6, 6, KEY_P), |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 91 | KEY(6, 7, KEY_UP), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 92 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ |
| 93 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ |
| 94 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ |
| 95 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ |
Vimal Singh | 6b06ebd | 2010-01-08 10:29:07 -0800 | [diff] [blame] | 96 | KEY(7, 6, KEY_SELECT), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 97 | KEY(7, 7, KEY_DOWN) |
| 98 | }; |
| 99 | |
| 100 | static struct matrix_keymap_data board_map_data = { |
| 101 | .keymap = board_keymap, |
| 102 | .keymap_size = ARRAY_SIZE(board_keymap), |
| 103 | }; |
| 104 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 105 | static struct twl4030_keypad_data zoom_kp_twl4030_data = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 106 | .keymap_data = &board_map_data, |
| 107 | .rows = 8, |
| 108 | .cols = 8, |
| 109 | .rep = 1, |
| 110 | }; |
| 111 | |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 112 | static struct regulator_consumer_supply zoom_vmmc1_supply[] = { |
| 113 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 114 | }; |
| 115 | |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 116 | static struct regulator_consumer_supply zoom_vsim_supply[] = { |
| 117 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 118 | }; |
| 119 | |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 120 | static struct regulator_consumer_supply zoom_vmmc2_supply[] = { |
| 121 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 122 | }; |
| 123 | |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 124 | static struct regulator_consumer_supply zoom_vmmc3_supply[] = { |
| 125 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 126 | }; |
| 127 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 128 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 129 | static struct regulator_init_data zoom_vmmc1 = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 130 | .constraints = { |
| 131 | .min_uV = 1850000, |
| 132 | .max_uV = 3150000, |
| 133 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 134 | | REGULATOR_MODE_STANDBY, |
| 135 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 136 | | REGULATOR_CHANGE_MODE |
| 137 | | REGULATOR_CHANGE_STATUS, |
| 138 | }, |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 139 | .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc1_supply), |
| 140 | .consumer_supplies = zoom_vmmc1_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 141 | }; |
| 142 | |
| 143 | /* VMMC2 for MMC2 card */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 144 | static struct regulator_init_data zoom_vmmc2 = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 145 | .constraints = { |
| 146 | .min_uV = 1850000, |
| 147 | .max_uV = 1850000, |
| 148 | .apply_uV = true, |
| 149 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 150 | | REGULATOR_MODE_STANDBY, |
| 151 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 152 | | REGULATOR_CHANGE_STATUS, |
| 153 | }, |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 154 | .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc2_supply), |
| 155 | .consumer_supplies = zoom_vmmc2_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 159 | static struct regulator_init_data zoom_vsim = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 160 | .constraints = { |
| 161 | .min_uV = 1800000, |
| 162 | .max_uV = 3000000, |
| 163 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 164 | | REGULATOR_MODE_STANDBY, |
| 165 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 166 | | REGULATOR_CHANGE_MODE |
| 167 | | REGULATOR_CHANGE_STATUS, |
| 168 | }, |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 169 | .num_consumer_supplies = ARRAY_SIZE(zoom_vsim_supply), |
| 170 | .consumer_supplies = zoom_vsim_supply, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 171 | }; |
| 172 | |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 173 | static struct regulator_init_data zoom_vmmc3 = { |
| 174 | .constraints = { |
| 175 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 176 | }, |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 177 | .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc3_supply), |
| 178 | .consumer_supplies = zoom_vmmc3_supply, |
Ohad Ben-Cohen | b642fde | 2010-09-16 01:32:09 +0200 | [diff] [blame] | 179 | }; |
| 180 | |
| 181 | static struct fixed_voltage_config zoom_vwlan = { |
| 182 | .supply_name = "vwl1271", |
| 183 | .microvolts = 1800000, /* 1.8V */ |
| 184 | .gpio = OMAP_ZOOM_WLAN_PMENA_GPIO, |
| 185 | .startup_delay = 70000, /* 70msec */ |
| 186 | .enable_high = 1, |
| 187 | .enabled_at_boot = 0, |
| 188 | .init_data = &zoom_vmmc3, |
| 189 | }; |
| 190 | |
| 191 | static struct platform_device omap_vwlan_device = { |
| 192 | .name = "reg-fixed-voltage", |
| 193 | .id = 1, |
| 194 | .dev = { |
| 195 | .platform_data = &zoom_vwlan, |
| 196 | }, |
| 197 | }; |
| 198 | |
Peter Ujfalusi | 2014f26 | 2013-03-11 12:57:56 +0100 | [diff] [blame] | 199 | static struct pwm_lookup zoom_pwm_lookup[] = { |
| 200 | PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"), |
| 201 | PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"), |
| 202 | }; |
| 203 | |
| 204 | static struct led_pwm zoom_pwm_leds[] = { |
| 205 | { |
| 206 | .name = "zoom::keypad", |
| 207 | .max_brightness = 127, |
| 208 | .pwm_period_ns = 7812500, |
| 209 | }, |
| 210 | }; |
| 211 | |
| 212 | static struct led_pwm_platform_data zoom_pwm_data = { |
| 213 | .num_leds = ARRAY_SIZE(zoom_pwm_leds), |
| 214 | .leds = zoom_pwm_leds, |
| 215 | }; |
| 216 | |
| 217 | static struct platform_device zoom_leds_pwm = { |
| 218 | .name = "leds_pwm", |
| 219 | .id = -1, |
| 220 | .dev = { |
| 221 | .platform_data = &zoom_pwm_data, |
| 222 | }, |
| 223 | }; |
| 224 | |
| 225 | static struct platform_pwm_backlight_data zoom_backlight_data = { |
| 226 | .pwm_id = 1, |
| 227 | .max_brightness = 127, |
| 228 | .dft_brightness = 127, |
| 229 | .pwm_period_ns = 7812500, |
| 230 | }; |
| 231 | |
| 232 | static struct platform_device zoom_backlight_pwm = { |
| 233 | .name = "pwm-backlight", |
| 234 | .id = -1, |
| 235 | .dev = { |
| 236 | .platform_data = &zoom_backlight_data, |
| 237 | }, |
| 238 | }; |
| 239 | |
| 240 | static struct platform_device *zoom_devices[] __initdata = { |
| 241 | &omap_vwlan_device, |
| 242 | &zoom_leds_pwm, |
| 243 | &zoom_backlight_pwm, |
| 244 | }; |
| 245 | |
Nishanth Menon | 0ce3bb7 | 2011-01-06 19:49:29 -0800 | [diff] [blame] | 246 | static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { |
Vikram Narayanan | 224cd71 | 2012-09-26 22:12:22 +0530 | [diff] [blame] | 247 | .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */ |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 248 | }; |
| 249 | |
Bryan Wu | 1a6b592 | 2010-12-08 02:41:25 +0000 | [diff] [blame] | 250 | static struct omap2_hsmmc_info mmc[] = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 251 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 252 | .name = "external", |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 253 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 254 | .caps = MMC_CAP_4_BIT_DATA, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 255 | .gpio_wp = -EINVAL, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 256 | .power_saving = true, |
Tony Lindgren | 3b972bf | 2012-02-20 09:43:29 -0800 | [diff] [blame] | 257 | .deferred = true, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 258 | }, |
| 259 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 260 | .name = "internal", |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 261 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 262 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 263 | .gpio_cd = -EINVAL, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 264 | .gpio_wp = -EINVAL, |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 265 | .nonremovable = true, |
| 266 | .power_saving = true, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 267 | }, |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 268 | { |
| 269 | .name = "wl1271", |
| 270 | .mmc = 3, |
Ohad Ben-Cohen | f8110364 | 2010-11-26 23:59:24 +0000 | [diff] [blame] | 271 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 272 | .gpio_wp = -EINVAL, |
| 273 | .gpio_cd = -EINVAL, |
| 274 | .nonremovable = true, |
| 275 | }, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 276 | {} /* Terminator */ |
| 277 | }; |
| 278 | |
Peter Ujfalusi | c591393 | 2012-12-05 15:39:35 +0100 | [diff] [blame] | 279 | static struct omap_tw4030_pdata omap_twl4030_audio_data = { |
| 280 | .voice_connected = true, |
| 281 | .custom_routing = true, |
| 282 | |
| 283 | .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, |
| 284 | .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, |
| 285 | |
| 286 | .has_mainmic = true, |
| 287 | .has_submic = true, |
| 288 | .has_hsmic = true, |
| 289 | .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT, |
| 290 | }; |
| 291 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 292 | static int zoom_twl_gpio_setup(struct device *dev, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 293 | unsigned gpio, unsigned ngpio) |
| 294 | { |
Madhusudhan Chikkature | ed32350 | 2009-12-11 16:16:37 -0800 | [diff] [blame] | 295 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 296 | mmc[0].gpio_cd = gpio + 0; |
Tony Lindgren | 3b972bf | 2012-02-20 09:43:29 -0800 | [diff] [blame] | 297 | omap_hsmmc_late_init(mmc); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 298 | |
Peter Ujfalusi | c591393 | 2012-12-05 15:39:35 +0100 | [diff] [blame] | 299 | /* Audio setup */ |
| 300 | omap_twl4030_audio_data.jack_detect = gpio + 2; |
| 301 | omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data); |
Kishore Y | a649033 | 2010-11-15 07:09:03 +0100 | [diff] [blame] | 302 | |
Peter Ujfalusi | e4f4e8b | 2012-11-30 14:40:51 +0100 | [diff] [blame] | 303 | return 0; |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 304 | } |
| 305 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 306 | static struct twl4030_gpio_platform_data zoom_gpio_data = { |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 307 | .setup = zoom_twl_gpio_setup, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 308 | }; |
| 309 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 310 | static struct twl4030_platform_data zoom_twldata = { |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 311 | /* platform_data for children goes here */ |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 312 | .gpio = &zoom_gpio_data, |
| 313 | .keypad = &zoom_kp_twl4030_data, |
Anand Gadiyar | aed79bc | 2009-12-11 16:16:36 -0800 | [diff] [blame] | 314 | .vmmc1 = &zoom_vmmc1, |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 315 | .vmmc2 = &zoom_vmmc2, |
| 316 | .vsim = &zoom_vsim, |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 317 | }; |
| 318 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 319 | static int __init omap_i2c_init(void) |
| 320 | { |
Peter Ujfalusi | 827ed9a | 2011-06-07 10:28:54 +0300 | [diff] [blame] | 321 | omap3_pmic_get_config(&zoom_twldata, |
Peter Ujfalusi | b252b0e | 2011-06-07 11:38:24 +0300 | [diff] [blame] | 322 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI | |
| 323 | TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, |
| 324 | TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); |
Peter Ujfalusi | 827ed9a | 2011-06-07 10:28:54 +0300 | [diff] [blame] | 325 | |
Peter Ujfalusi | 98b0606 | 2012-12-05 11:35:32 +0100 | [diff] [blame] | 326 | if (machine_is_omap_zoom2()) |
| 327 | zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */ |
Peter Ujfalusi | 827ed9a | 2011-06-07 10:28:54 +0300 | [diff] [blame] | 328 | |
Tony Lindgren | 7d7e1eb | 2012-08-27 17:43:01 -0700 | [diff] [blame] | 329 | omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 330 | omap_register_i2c_bus(2, 400, NULL, 0); |
| 331 | omap_register_i2c_bus(3, 400, NULL, 0); |
| 332 | return 0; |
| 333 | } |
| 334 | |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 335 | static void enable_board_wakeup_source(void) |
| 336 | { |
| 337 | /* T2 interrupt line (keypad) */ |
| 338 | omap_mux_init_signal("sys_nirq", |
| 339 | OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); |
| 340 | } |
| 341 | |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 342 | void __init zoom_peripherals_init(void) |
| 343 | { |
Tarun Kanti DebBarma | 46a0a54 | 2012-03-29 08:41:01 -0700 | [diff] [blame] | 344 | int ret; |
| 345 | |
| 346 | omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO); |
| 347 | ret = wl12xx_set_platform_data(&omap_zoom_wlan_data); |
Russell King | 70d669d | 2012-02-07 11:03:23 +0000 | [diff] [blame] | 348 | |
| 349 | if (ret) |
| 350 | pr_err("error setting wl12xx data: %d\n", ret); |
Ohad Ben-Cohen | 80b517f | 2010-09-16 01:32:30 +0200 | [diff] [blame] | 351 | |
Tony Lindgren | 3b972bf | 2012-02-20 09:43:29 -0800 | [diff] [blame] | 352 | omap_hsmmc_init(mmc); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 353 | omap_i2c_init(); |
Peter Ujfalusi | 2014f26 | 2013-03-11 12:57:56 +0100 | [diff] [blame] | 354 | pwm_add_table(zoom_pwm_lookup, ARRAY_SIZE(zoom_pwm_lookup)); |
| 355 | platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); |
Kishon Vijay Abraham I | 51482be | 2013-02-06 18:58:50 +0530 | [diff] [blame] | 356 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); |
Mike Rapoport | 9e18630 | 2011-04-27 11:56:12 +0300 | [diff] [blame] | 357 | usb_musb_init(NULL); |
Lesly A M | a1e6364 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 358 | enable_board_wakeup_source(); |
Govindraj.R | 257f23d | 2010-09-27 20:21:05 +0530 | [diff] [blame] | 359 | omap_serial_init(); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 360 | } |