Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Board support file for OMAP4430 SDP. |
| 3 | * |
| 4 | * Copyright (C) 2009 Texas Instruments |
| 5 | * |
| 6 | * Author: Santosh Shilimkar <santosh.shilimkar@ti.com> |
| 7 | * |
| 8 | * Based on mach-omap2/board-3430sdp.c |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/gpio.h> |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 20 | #include <linux/usb/otg.h> |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 21 | #include <linux/spi/spi.h> |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 22 | #include <linux/i2c/twl.h> |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 23 | #include <linux/gpio_keys.h> |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 24 | #include <linux/regulator/machine.h> |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 25 | #include <linux/regulator/fixed.h> |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 26 | #include <linux/leds.h> |
Hemanth V | f389f4c | 2010-12-17 18:15:08 -0800 | [diff] [blame] | 27 | #include <linux/leds_pwm.h> |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 28 | |
| 29 | #include <mach/hardware.h> |
Santosh Shilimkar | fbc9be1 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 30 | #include <mach/omap4-common.h> |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/mach/arch.h> |
| 33 | #include <asm/mach/map.h> |
| 34 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 35 | #include <plat/board.h> |
| 36 | #include <plat/common.h> |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 37 | #include <plat/usb.h> |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 38 | #include <plat/mmc.h> |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 39 | #include <plat/omap4-keypad.h> |
Tomi Valkeinen | a0b38cc | 2011-05-11 14:05:07 +0300 | [diff] [blame] | 40 | #include <video/omapdss.h> |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 41 | #include <video/omap-panel-nokia-dsi.h> |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 42 | #include <linux/wl12xx.h> |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 43 | |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 44 | #include "mux.h" |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 45 | #include "hsmmc.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 46 | #include "control.h" |
Mike Rapoport | fbd8071 | 2011-04-25 01:09:06 +0300 | [diff] [blame] | 47 | #include "common-board-devices.h" |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 48 | |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 49 | #define ETH_KS8851_IRQ 34 |
| 50 | #define ETH_KS8851_POWER_ON 48 |
| 51 | #define ETH_KS8851_QUART 138 |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 52 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 |
| 53 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 54 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ |
| 55 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 56 | #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */ |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 57 | |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 58 | #define GPIO_WIFI_PMENA 54 |
| 59 | #define GPIO_WIFI_IRQ 53 |
| 60 | |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 61 | static const int sdp4430_keymap[] = { |
| 62 | KEY(0, 0, KEY_E), |
| 63 | KEY(0, 1, KEY_R), |
| 64 | KEY(0, 2, KEY_T), |
| 65 | KEY(0, 3, KEY_HOME), |
| 66 | KEY(0, 4, KEY_F5), |
| 67 | KEY(0, 5, KEY_UNKNOWN), |
| 68 | KEY(0, 6, KEY_I), |
| 69 | KEY(0, 7, KEY_LEFTSHIFT), |
| 70 | |
| 71 | KEY(1, 0, KEY_D), |
| 72 | KEY(1, 1, KEY_F), |
| 73 | KEY(1, 2, KEY_G), |
| 74 | KEY(1, 3, KEY_SEND), |
| 75 | KEY(1, 4, KEY_F6), |
| 76 | KEY(1, 5, KEY_UNKNOWN), |
| 77 | KEY(1, 6, KEY_K), |
| 78 | KEY(1, 7, KEY_ENTER), |
| 79 | |
| 80 | KEY(2, 0, KEY_X), |
| 81 | KEY(2, 1, KEY_C), |
| 82 | KEY(2, 2, KEY_V), |
| 83 | KEY(2, 3, KEY_END), |
| 84 | KEY(2, 4, KEY_F7), |
| 85 | KEY(2, 5, KEY_UNKNOWN), |
| 86 | KEY(2, 6, KEY_DOT), |
| 87 | KEY(2, 7, KEY_CAPSLOCK), |
| 88 | |
| 89 | KEY(3, 0, KEY_Z), |
| 90 | KEY(3, 1, KEY_KPPLUS), |
| 91 | KEY(3, 2, KEY_B), |
| 92 | KEY(3, 3, KEY_F1), |
| 93 | KEY(3, 4, KEY_F8), |
| 94 | KEY(3, 5, KEY_UNKNOWN), |
| 95 | KEY(3, 6, KEY_O), |
| 96 | KEY(3, 7, KEY_SPACE), |
| 97 | |
| 98 | KEY(4, 0, KEY_W), |
| 99 | KEY(4, 1, KEY_Y), |
| 100 | KEY(4, 2, KEY_U), |
| 101 | KEY(4, 3, KEY_F2), |
| 102 | KEY(4, 4, KEY_VOLUMEUP), |
| 103 | KEY(4, 5, KEY_UNKNOWN), |
| 104 | KEY(4, 6, KEY_L), |
| 105 | KEY(4, 7, KEY_LEFT), |
| 106 | |
| 107 | KEY(5, 0, KEY_S), |
| 108 | KEY(5, 1, KEY_H), |
| 109 | KEY(5, 2, KEY_J), |
| 110 | KEY(5, 3, KEY_F3), |
| 111 | KEY(5, 4, KEY_F9), |
| 112 | KEY(5, 5, KEY_VOLUMEDOWN), |
| 113 | KEY(5, 6, KEY_M), |
| 114 | KEY(5, 7, KEY_RIGHT), |
| 115 | |
| 116 | KEY(6, 0, KEY_Q), |
| 117 | KEY(6, 1, KEY_A), |
| 118 | KEY(6, 2, KEY_N), |
| 119 | KEY(6, 3, KEY_BACK), |
| 120 | KEY(6, 4, KEY_BACKSPACE), |
| 121 | KEY(6, 5, KEY_UNKNOWN), |
| 122 | KEY(6, 6, KEY_P), |
| 123 | KEY(6, 7, KEY_UP), |
| 124 | |
| 125 | KEY(7, 0, KEY_PROG1), |
| 126 | KEY(7, 1, KEY_PROG2), |
| 127 | KEY(7, 2, KEY_PROG3), |
| 128 | KEY(7, 3, KEY_PROG4), |
| 129 | KEY(7, 4, KEY_F4), |
| 130 | KEY(7, 5, KEY_UNKNOWN), |
| 131 | KEY(7, 6, KEY_OK), |
| 132 | KEY(7, 7, KEY_DOWN), |
| 133 | }; |
Shubhrajyoti Datta | f67df6c | 2011-07-05 03:38:24 -0700 | [diff] [blame] | 134 | static struct omap_device_pad keypad_pads[] __initdata = { |
| 135 | { .name = "kpd_col1.kpd_col1", |
| 136 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 137 | }, |
| 138 | { .name = "kpd_col1.kpd_col1", |
| 139 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 140 | }, |
| 141 | { .name = "kpd_col2.kpd_col2", |
| 142 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 143 | }, |
| 144 | { .name = "kpd_col3.kpd_col3", |
| 145 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 146 | }, |
| 147 | { .name = "kpd_col4.kpd_col4", |
| 148 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 149 | }, |
| 150 | { .name = "kpd_col5.kpd_col5", |
| 151 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 152 | }, |
| 153 | { .name = "gpmc_a23.kpd_col7", |
| 154 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 155 | }, |
| 156 | { .name = "gpmc_a22.kpd_col6", |
| 157 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, |
| 158 | }, |
| 159 | { .name = "kpd_row0.kpd_row0", |
| 160 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 161 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 162 | }, |
| 163 | { .name = "kpd_row1.kpd_row1", |
| 164 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 165 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 166 | }, |
| 167 | { .name = "kpd_row2.kpd_row2", |
| 168 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 169 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 170 | }, |
| 171 | { .name = "kpd_row3.kpd_row3", |
| 172 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 173 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 174 | }, |
| 175 | { .name = "kpd_row4.kpd_row4", |
| 176 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 177 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 178 | }, |
| 179 | { .name = "kpd_row5.kpd_row5", |
| 180 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 181 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 182 | }, |
| 183 | { .name = "gpmc_a18.kpd_row6", |
| 184 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 185 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 186 | }, |
| 187 | { .name = "gpmc_a19.kpd_row7", |
| 188 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | |
| 189 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, |
| 190 | }, |
| 191 | }; |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 192 | |
| 193 | static struct matrix_keymap_data sdp4430_keymap_data = { |
| 194 | .keymap = sdp4430_keymap, |
| 195 | .keymap_size = ARRAY_SIZE(sdp4430_keymap), |
| 196 | }; |
| 197 | |
| 198 | static struct omap4_keypad_platform_data sdp4430_keypad_data = { |
| 199 | .keymap_data = &sdp4430_keymap_data, |
| 200 | .rows = 8, |
| 201 | .cols = 8, |
| 202 | }; |
Shubhrajyoti Datta | f67df6c | 2011-07-05 03:38:24 -0700 | [diff] [blame] | 203 | |
| 204 | static struct omap_board_data keypad_data = { |
| 205 | .id = 1, |
| 206 | .pads = keypad_pads, |
| 207 | .pads_cnt = ARRAY_SIZE(keypad_pads), |
| 208 | }; |
| 209 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 210 | static struct gpio_led sdp4430_gpio_leds[] = { |
| 211 | { |
| 212 | .name = "omap4:green:debug0", |
| 213 | .gpio = 61, |
| 214 | }, |
| 215 | { |
| 216 | .name = "omap4:green:debug1", |
| 217 | .gpio = 30, |
| 218 | }, |
| 219 | { |
| 220 | .name = "omap4:green:debug2", |
| 221 | .gpio = 7, |
| 222 | }, |
| 223 | { |
| 224 | .name = "omap4:green:debug3", |
| 225 | .gpio = 8, |
| 226 | }, |
| 227 | { |
| 228 | .name = "omap4:green:debug4", |
| 229 | .gpio = 50, |
| 230 | }, |
| 231 | { |
| 232 | .name = "omap4:blue:user", |
| 233 | .gpio = 169, |
| 234 | }, |
| 235 | { |
| 236 | .name = "omap4:red:user", |
| 237 | .gpio = 170, |
| 238 | }, |
| 239 | { |
| 240 | .name = "omap4:green:user", |
| 241 | .gpio = 139, |
| 242 | }, |
| 243 | |
| 244 | }; |
| 245 | |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 246 | static struct gpio_keys_button sdp4430_gpio_keys[] = { |
| 247 | { |
| 248 | .desc = "Proximity Sensor", |
| 249 | .type = EV_SW, |
| 250 | .code = SW_FRONT_PROXIMITY, |
| 251 | .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO, |
| 252 | .active_low = 0, |
| 253 | } |
| 254 | }; |
| 255 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 256 | static struct gpio_led_platform_data sdp4430_led_data = { |
| 257 | .leds = sdp4430_gpio_leds, |
| 258 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), |
| 259 | }; |
| 260 | |
Hemanth V | f389f4c | 2010-12-17 18:15:08 -0800 | [diff] [blame] | 261 | static struct led_pwm sdp4430_pwm_leds[] = { |
| 262 | { |
| 263 | .name = "omap4:green:chrg", |
| 264 | .pwm_id = 1, |
| 265 | .max_brightness = 255, |
| 266 | .pwm_period_ns = 7812500, |
| 267 | }, |
| 268 | }; |
| 269 | |
| 270 | static struct led_pwm_platform_data sdp4430_pwm_data = { |
| 271 | .num_leds = ARRAY_SIZE(sdp4430_pwm_leds), |
| 272 | .leds = sdp4430_pwm_leds, |
| 273 | }; |
| 274 | |
| 275 | static struct platform_device sdp4430_leds_pwm = { |
| 276 | .name = "leds_pwm", |
| 277 | .id = -1, |
| 278 | .dev = { |
| 279 | .platform_data = &sdp4430_pwm_data, |
| 280 | }, |
| 281 | }; |
| 282 | |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 283 | static int omap_prox_activate(struct device *dev) |
| 284 | { |
| 285 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); |
| 286 | return 0; |
| 287 | } |
| 288 | |
| 289 | static void omap_prox_deactivate(struct device *dev) |
| 290 | { |
| 291 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0); |
| 292 | } |
| 293 | |
| 294 | static struct gpio_keys_platform_data sdp4430_gpio_keys_data = { |
| 295 | .buttons = sdp4430_gpio_keys, |
| 296 | .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys), |
| 297 | .enable = omap_prox_activate, |
| 298 | .disable = omap_prox_deactivate, |
| 299 | }; |
| 300 | |
| 301 | static struct platform_device sdp4430_gpio_keys_device = { |
| 302 | .name = "gpio-keys", |
| 303 | .id = -1, |
| 304 | .dev = { |
| 305 | .platform_data = &sdp4430_gpio_keys_data, |
| 306 | }, |
| 307 | }; |
| 308 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 309 | static struct platform_device sdp4430_leds_gpio = { |
| 310 | .name = "leds-gpio", |
| 311 | .id = -1, |
| 312 | .dev = { |
| 313 | .platform_data = &sdp4430_led_data, |
| 314 | }, |
| 315 | }; |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 316 | static struct spi_board_info sdp4430_spi_board_info[] __initdata = { |
| 317 | { |
| 318 | .modalias = "ks8851", |
| 319 | .bus_num = 1, |
| 320 | .chip_select = 0, |
| 321 | .max_speed_hz = 24000000, |
| 322 | .irq = ETH_KS8851_IRQ, |
| 323 | }, |
| 324 | }; |
| 325 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 326 | static struct gpio sdp4430_eth_gpios[] __initdata = { |
| 327 | { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" }, |
| 328 | { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" }, |
| 329 | { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" }, |
| 330 | }; |
| 331 | |
Santosh Shilimkar | 89c4705 | 2011-05-30 00:11:45 -0700 | [diff] [blame] | 332 | static int __init omap_ethernet_init(void) |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 333 | { |
| 334 | int status; |
| 335 | |
| 336 | /* Request of GPIO lines */ |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 337 | status = gpio_request_array(sdp4430_eth_gpios, |
| 338 | ARRAY_SIZE(sdp4430_eth_gpios)); |
| 339 | if (status) |
| 340 | pr_err("Cannot request ETH GPIOs\n"); |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 341 | |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 342 | return status; |
| 343 | } |
| 344 | |
Peter Ujfalusi | 87b25c1 | 2011-06-01 11:30:38 +0300 | [diff] [blame] | 345 | static struct regulator_consumer_supply sdp4430_vbat_supply[] = { |
| 346 | REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), |
| 347 | REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), |
| 348 | }; |
| 349 | |
| 350 | static struct regulator_init_data sdp4430_vbat_data = { |
| 351 | .constraints = { |
| 352 | .always_on = 1, |
| 353 | }, |
| 354 | .num_consumer_supplies = ARRAY_SIZE(sdp4430_vbat_supply), |
| 355 | .consumer_supplies = sdp4430_vbat_supply, |
| 356 | }; |
| 357 | |
| 358 | static struct fixed_voltage_config sdp4430_vbat_pdata = { |
| 359 | .supply_name = "VBAT", |
| 360 | .microvolts = 3750000, |
| 361 | .init_data = &sdp4430_vbat_data, |
| 362 | .gpio = -EINVAL, |
| 363 | }; |
| 364 | |
| 365 | static struct platform_device sdp4430_vbat = { |
| 366 | .name = "reg-fixed-voltage", |
| 367 | .id = -1, |
| 368 | .dev = { |
| 369 | .platform_data = &sdp4430_vbat_pdata, |
| 370 | }, |
| 371 | }; |
| 372 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 373 | static struct platform_device *sdp4430_devices[] __initdata = { |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 374 | &sdp4430_gpio_keys_device, |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 375 | &sdp4430_leds_gpio, |
Hemanth V | f389f4c | 2010-12-17 18:15:08 -0800 | [diff] [blame] | 376 | &sdp4430_leds_pwm, |
Peter Ujfalusi | 87b25c1 | 2011-06-01 11:30:38 +0300 | [diff] [blame] | 377 | &sdp4430_vbat, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 378 | }; |
| 379 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 380 | static void __init omap_4430sdp_init_early(void) |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 381 | { |
Paul Walmsley | 4805734 | 2010-12-21 15:25:10 -0700 | [diff] [blame] | 382 | omap2_init_common_infrastructure(); |
| 383 | omap2_init_common_devices(NULL, NULL); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 384 | } |
| 385 | |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 386 | static struct omap_musb_board_data musb_board_data = { |
| 387 | .interface_type = MUSB_INTERFACE_UTMI, |
Hema HK | 09e7200 | 2010-12-10 18:11:42 +0530 | [diff] [blame] | 388 | .mode = MUSB_OTG, |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 389 | .power = 100, |
| 390 | }; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 391 | |
| 392 | static struct omap2_hsmmc_info mmc[] = { |
| 393 | { |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 394 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 395 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 396 | .gpio_cd = -EINVAL, |
| 397 | .gpio_wp = -EINVAL, |
| 398 | .nonremovable = true, |
kishore kadiyala | 64be978 | 2010-10-01 16:35:28 -0700 | [diff] [blame] | 399 | .ocr_mask = MMC_VDD_29_30, |
Balaji T K | b1c1df7 | 2011-05-30 19:55:34 +0530 | [diff] [blame] | 400 | .no_off_init = true, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 401 | }, |
Kishore Kadiyala | 0005ae7 | 2011-02-28 20:48:05 +0530 | [diff] [blame] | 402 | { |
| 403 | .mmc = 1, |
| 404 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
Silesh C V | 27a69d7 | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 405 | .gpio_cd = -EINVAL, |
Kishore Kadiyala | 0005ae7 | 2011-02-28 20:48:05 +0530 | [diff] [blame] | 406 | .gpio_wp = -EINVAL, |
| 407 | }, |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 408 | { |
| 409 | .mmc = 5, |
| 410 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, |
| 411 | .gpio_cd = -EINVAL, |
| 412 | .gpio_wp = -EINVAL, |
| 413 | .ocr_mask = MMC_VDD_165_195, |
| 414 | .nonremovable = true, |
| 415 | }, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 416 | {} /* Terminator */ |
| 417 | }; |
| 418 | |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 419 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 420 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 421 | }; |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 422 | |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 423 | static struct regulator_consumer_supply omap4_sdp4430_vmmc5_supply = { |
| 424 | .supply = "vmmc", |
| 425 | .dev_name = "omap_hsmmc.4", |
| 426 | }; |
| 427 | |
| 428 | static struct regulator_init_data sdp4430_vmmc5 = { |
| 429 | .constraints = { |
| 430 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 431 | }, |
| 432 | .num_consumer_supplies = 1, |
| 433 | .consumer_supplies = &omap4_sdp4430_vmmc5_supply, |
| 434 | }; |
| 435 | |
| 436 | static struct fixed_voltage_config sdp4430_vwlan = { |
| 437 | .supply_name = "vwl1271", |
| 438 | .microvolts = 1800000, /* 1.8V */ |
| 439 | .gpio = GPIO_WIFI_PMENA, |
| 440 | .startup_delay = 70000, /* 70msec */ |
| 441 | .enable_high = 1, |
| 442 | .enabled_at_boot = 0, |
| 443 | .init_data = &sdp4430_vmmc5, |
| 444 | }; |
| 445 | |
| 446 | static struct platform_device omap_vwlan_device = { |
| 447 | .name = "reg-fixed-voltage", |
| 448 | .id = 1, |
| 449 | .dev = { |
| 450 | .platform_data = &sdp4430_vwlan, |
| 451 | }, |
| 452 | }; |
| 453 | |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 454 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
| 455 | { |
| 456 | int ret = 0; |
| 457 | struct platform_device *pdev = container_of(dev, |
| 458 | struct platform_device, dev); |
| 459 | struct omap_mmc_platform_data *pdata = dev->platform_data; |
| 460 | |
| 461 | /* Setting MMC1 Card detect Irq */ |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 462 | if (pdev->id == 0) { |
| 463 | ret = twl6030_mmc_card_detect_config(); |
| 464 | if (ret) |
| 465 | pr_err("Failed configuring MMC1 card detect\n"); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 466 | pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + |
| 467 | MMCDETECT_INTR_OFFSET; |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 468 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; |
| 469 | } |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 470 | return ret; |
| 471 | } |
| 472 | |
| 473 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) |
| 474 | { |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 475 | struct omap_mmc_platform_data *pdata; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 476 | |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 477 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ |
| 478 | if (!dev) { |
| 479 | pr_err("Failed %s\n", __func__); |
| 480 | return; |
| 481 | } |
| 482 | pdata = dev->platform_data; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 483 | pdata->init = omap4_twl6030_hsmmc_late_init; |
| 484 | } |
| 485 | |
| 486 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) |
| 487 | { |
| 488 | struct omap2_hsmmc_info *c; |
| 489 | |
| 490 | omap2_hsmmc_init(controllers); |
| 491 | for (c = controllers; c->mmc; c++) |
| 492 | omap4_twl6030_hsmmc_set_late_init(c->dev); |
| 493 | |
| 494 | return 0; |
| 495 | } |
| 496 | |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 497 | static struct regulator_init_data sdp4430_vaux1 = { |
| 498 | .constraints = { |
| 499 | .min_uV = 1000000, |
| 500 | .max_uV = 3000000, |
| 501 | .apply_uV = true, |
| 502 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 503 | | REGULATOR_MODE_STANDBY, |
| 504 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 505 | | REGULATOR_CHANGE_MODE |
| 506 | | REGULATOR_CHANGE_STATUS, |
| 507 | }, |
Oleg Drokin | 786b01a | 2011-06-06 18:57:07 +0000 | [diff] [blame] | 508 | .num_consumer_supplies = ARRAY_SIZE(sdp4430_vaux_supply), |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 509 | .consumer_supplies = sdp4430_vaux_supply, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 510 | }; |
| 511 | |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 512 | static struct regulator_init_data sdp4430_vusim = { |
| 513 | .constraints = { |
| 514 | .min_uV = 1200000, |
| 515 | .max_uV = 2900000, |
| 516 | .apply_uV = true, |
| 517 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 518 | | REGULATOR_MODE_STANDBY, |
| 519 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 520 | | REGULATOR_CHANGE_MODE |
| 521 | | REGULATOR_CHANGE_STATUS, |
| 522 | }, |
| 523 | }; |
| 524 | |
Misael Lopez Cruz | 1a4cdec | 2011-02-11 19:50:37 -0600 | [diff] [blame] | 525 | static struct twl4030_codec_data twl6040_codec = { |
| 526 | /* single-step ramp for headset and handsfree */ |
| 527 | .hs_left_step = 0x0f, |
| 528 | .hs_right_step = 0x0f, |
| 529 | .hf_left_step = 0x1d, |
| 530 | .hf_right_step = 0x1d, |
| 531 | }; |
| 532 | |
Peter Ujfalusi | 87b25c1 | 2011-06-01 11:30:38 +0300 | [diff] [blame] | 533 | static struct twl4030_vibra_data twl6040_vibra = { |
| 534 | .vibldrv_res = 8, |
| 535 | .vibrdrv_res = 3, |
| 536 | .viblmotor_res = 10, |
| 537 | .vibrmotor_res = 10, |
| 538 | .vddvibl_uV = 0, /* fixed volt supply - VBAT */ |
| 539 | .vddvibr_uV = 0, /* fixed volt supply - VBAT */ |
| 540 | }; |
| 541 | |
| 542 | static struct twl4030_audio_data twl6040_audio = { |
Misael Lopez Cruz | 1a4cdec | 2011-02-11 19:50:37 -0600 | [diff] [blame] | 543 | .codec = &twl6040_codec, |
Peter Ujfalusi | 87b25c1 | 2011-06-01 11:30:38 +0300 | [diff] [blame] | 544 | .vibra = &twl6040_vibra, |
| 545 | .audpwron_gpio = 127, |
| 546 | .naudint_irq = OMAP44XX_IRQ_SYS_2N, |
| 547 | .irq_base = TWL6040_CODEC_IRQ_BASE, |
| 548 | }; |
| 549 | |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 550 | static struct twl4030_platform_data sdp4430_twldata = { |
Peter Ujfalusi | 87b25c1 | 2011-06-01 11:30:38 +0300 | [diff] [blame] | 551 | .audio = &twl6040_audio, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 552 | /* Regulators */ |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 553 | .vusim = &sdp4430_vusim, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 554 | .vaux1 = &sdp4430_vaux1, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 555 | }; |
| 556 | |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 557 | static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { |
| 558 | { |
| 559 | I2C_BOARD_INFO("tmp105", 0x48), |
| 560 | }, |
Hemanth V | d048aca | 2010-12-17 18:15:08 -0800 | [diff] [blame] | 561 | { |
| 562 | I2C_BOARD_INFO("bh1780", 0x29), |
| 563 | }, |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 564 | }; |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 565 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { |
| 566 | { |
| 567 | I2C_BOARD_INFO("hmc5843", 0x1e), |
| 568 | }, |
| 569 | }; |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 570 | static int __init omap4_i2c_init(void) |
| 571 | { |
Peter Ujfalusi | b22f954 | 2011-06-07 10:26:46 +0300 | [diff] [blame] | 572 | omap4_pmic_get_config(&sdp4430_twldata, TWL_COMMON_PDATA_USB, |
| 573 | TWL_COMMON_REGULATOR_VDAC | |
| 574 | TWL_COMMON_REGULATOR_VAUX2 | |
| 575 | TWL_COMMON_REGULATOR_VAUX3 | |
| 576 | TWL_COMMON_REGULATOR_VMMC | |
| 577 | TWL_COMMON_REGULATOR_VPP | |
| 578 | TWL_COMMON_REGULATOR_VANA | |
| 579 | TWL_COMMON_REGULATOR_VCXIO | |
| 580 | TWL_COMMON_REGULATOR_VUSB | |
| 581 | TWL_COMMON_REGULATOR_CLK32KG); |
Mike Rapoport | fbd8071 | 2011-04-25 01:09:06 +0300 | [diff] [blame] | 582 | omap4_pmic_init("twl6030", &sdp4430_twldata); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 583 | omap_register_i2c_bus(2, 400, NULL, 0); |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 584 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
| 585 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 586 | omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo, |
| 587 | ARRAY_SIZE(sdp4430_i2c_4_boardinfo)); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 588 | return 0; |
| 589 | } |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 590 | |
| 591 | static void __init omap_sfh7741prox_init(void) |
| 592 | { |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 593 | int error; |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 594 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 595 | error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO, |
| 596 | GPIOF_OUT_INIT_LOW, "sfh7741"); |
| 597 | if (error < 0) |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 598 | pr_err("%s:failed to request GPIO %d, error %d\n", |
| 599 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 600 | } |
| 601 | |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 602 | static void sdp4430_hdmi_mux_init(void) |
| 603 | { |
| 604 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ |
| 605 | omap_mux_init_signal("hdmi_hpd", |
| 606 | OMAP_PIN_INPUT_PULLUP); |
| 607 | omap_mux_init_signal("hdmi_cec", |
| 608 | OMAP_PIN_INPUT_PULLUP); |
| 609 | /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ |
| 610 | omap_mux_init_signal("hdmi_ddc_scl", |
| 611 | OMAP_PIN_INPUT_PULLUP); |
| 612 | omap_mux_init_signal("hdmi_ddc_sda", |
| 613 | OMAP_PIN_INPUT_PULLUP); |
| 614 | } |
| 615 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 616 | static struct gpio sdp4430_hdmi_gpios[] = { |
| 617 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, |
| 618 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, |
| 619 | }; |
| 620 | |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 621 | static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev) |
| 622 | { |
| 623 | int status; |
| 624 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 625 | status = gpio_request_array(sdp4430_hdmi_gpios, |
| 626 | ARRAY_SIZE(sdp4430_hdmi_gpios)); |
| 627 | if (status) |
| 628 | pr_err("%s: Cannot request HDMI GPIOs\n", __func__); |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 629 | |
| 630 | return status; |
| 631 | } |
| 632 | |
| 633 | static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) |
| 634 | { |
| 635 | gpio_free(HDMI_GPIO_LS_OE); |
| 636 | gpio_free(HDMI_GPIO_HPD); |
| 637 | } |
| 638 | |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 639 | static struct nokia_dsi_panel_data dsi1_panel = { |
| 640 | .name = "taal", |
| 641 | .reset_gpio = 102, |
| 642 | .use_ext_te = false, |
| 643 | .ext_te_gpio = 101, |
| 644 | .esd_interval = 0, |
| 645 | }; |
| 646 | |
| 647 | static struct omap_dss_device sdp4430_lcd_device = { |
| 648 | .name = "lcd", |
| 649 | .driver_name = "taal", |
| 650 | .type = OMAP_DISPLAY_TYPE_DSI, |
| 651 | .data = &dsi1_panel, |
| 652 | .phy.dsi = { |
| 653 | .clk_lane = 1, |
| 654 | .clk_pol = 0, |
| 655 | .data1_lane = 2, |
| 656 | .data1_pol = 0, |
| 657 | .data2_lane = 3, |
| 658 | .data2_pol = 0, |
| 659 | |
| 660 | .module = 0, |
| 661 | }, |
| 662 | |
| 663 | .clocks = { |
| 664 | .dispc = { |
| 665 | .channel = { |
| 666 | /* Logic Clock = 172.8 MHz */ |
| 667 | .lck_div = 1, |
| 668 | /* Pixel Clock = 34.56 MHz */ |
| 669 | .pck_div = 5, |
| 670 | .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, |
| 671 | }, |
| 672 | .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, |
| 673 | }, |
| 674 | |
| 675 | .dsi = { |
| 676 | .regn = 16, /* Fint = 2.4 MHz */ |
| 677 | .regm = 180, /* DDR Clock = 216 MHz */ |
| 678 | .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */ |
| 679 | .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */ |
| 680 | |
| 681 | .lp_clk_div = 10, /* LP Clock = 8.64 MHz */ |
| 682 | .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, |
| 683 | }, |
| 684 | }, |
| 685 | .channel = OMAP_DSS_CHANNEL_LCD, |
| 686 | }; |
| 687 | |
| 688 | static struct nokia_dsi_panel_data dsi2_panel = { |
| 689 | .name = "taal", |
| 690 | .reset_gpio = 104, |
| 691 | .use_ext_te = false, |
| 692 | .ext_te_gpio = 103, |
| 693 | .esd_interval = 0, |
| 694 | }; |
| 695 | |
| 696 | static struct omap_dss_device sdp4430_lcd2_device = { |
| 697 | .name = "lcd2", |
| 698 | .driver_name = "taal", |
| 699 | .type = OMAP_DISPLAY_TYPE_DSI, |
| 700 | .data = &dsi2_panel, |
| 701 | .phy.dsi = { |
| 702 | .clk_lane = 1, |
| 703 | .clk_pol = 0, |
| 704 | .data1_lane = 2, |
| 705 | .data1_pol = 0, |
| 706 | .data2_lane = 3, |
| 707 | .data2_pol = 0, |
| 708 | |
| 709 | .module = 1, |
| 710 | }, |
| 711 | |
| 712 | .clocks = { |
| 713 | .dispc = { |
| 714 | .channel = { |
| 715 | /* Logic Clock = 172.8 MHz */ |
| 716 | .lck_div = 1, |
| 717 | /* Pixel Clock = 34.56 MHz */ |
| 718 | .pck_div = 5, |
| 719 | .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, |
| 720 | }, |
| 721 | .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, |
| 722 | }, |
| 723 | |
| 724 | .dsi = { |
| 725 | .regn = 16, /* Fint = 2.4 MHz */ |
| 726 | .regm = 180, /* DDR Clock = 216 MHz */ |
| 727 | .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */ |
| 728 | .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */ |
| 729 | |
| 730 | .lp_clk_div = 10, /* LP Clock = 8.64 MHz */ |
| 731 | .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, |
| 732 | }, |
| 733 | }, |
| 734 | .channel = OMAP_DSS_CHANNEL_LCD2, |
| 735 | }; |
| 736 | |
| 737 | static void sdp4430_lcd_init(void) |
| 738 | { |
| 739 | int r; |
| 740 | |
| 741 | r = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT, |
| 742 | "lcd1_reset_gpio"); |
| 743 | if (r) |
| 744 | pr_err("%s: Could not get lcd1_reset_gpio\n", __func__); |
| 745 | |
| 746 | r = gpio_request_one(dsi2_panel.reset_gpio, GPIOF_DIR_OUT, |
| 747 | "lcd2_reset_gpio"); |
| 748 | if (r) |
| 749 | pr_err("%s: Could not get lcd2_reset_gpio\n", __func__); |
| 750 | } |
| 751 | |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 752 | static struct omap_dss_device sdp4430_hdmi_device = { |
| 753 | .name = "hdmi", |
| 754 | .driver_name = "hdmi_panel", |
| 755 | .type = OMAP_DISPLAY_TYPE_HDMI, |
| 756 | .platform_enable = sdp4430_panel_enable_hdmi, |
| 757 | .platform_disable = sdp4430_panel_disable_hdmi, |
| 758 | .channel = OMAP_DSS_CHANNEL_DIGIT, |
| 759 | }; |
| 760 | |
| 761 | static struct omap_dss_device *sdp4430_dss_devices[] = { |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 762 | &sdp4430_lcd_device, |
| 763 | &sdp4430_lcd2_device, |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 764 | &sdp4430_hdmi_device, |
| 765 | }; |
| 766 | |
| 767 | static struct omap_dss_board_info sdp4430_dss_data = { |
| 768 | .num_devices = ARRAY_SIZE(sdp4430_dss_devices), |
| 769 | .devices = sdp4430_dss_devices, |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 770 | .default_device = &sdp4430_lcd_device, |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 771 | }; |
| 772 | |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 773 | static void omap_4430sdp_display_init(void) |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 774 | { |
Tomi Valkeinen | 12595d4 | 2011-09-06 11:31:02 +0300 | [diff] [blame^] | 775 | int r; |
| 776 | |
| 777 | /* Enable LCD2 by default (instead of Pico DLP) */ |
| 778 | r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, |
| 779 | "display_sel"); |
| 780 | if (r) |
| 781 | pr_err("%s: Could not get display_sel GPIO\n", __func__); |
| 782 | |
| 783 | sdp4430_lcd_init(); |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 784 | sdp4430_hdmi_mux_init(); |
| 785 | omap_display_init(&sdp4430_dss_data); |
| 786 | } |
| 787 | |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 788 | #ifdef CONFIG_OMAP_MUX |
| 789 | static struct omap_board_mux board_mux[] __initdata = { |
Tony Lindgren | 7d4ca85 | 2011-01-11 15:31:45 -0800 | [diff] [blame] | 790 | OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 791 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 792 | }; |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 793 | |
| 794 | static struct omap_device_pad serial2_pads[] __initdata = { |
| 795 | OMAP_MUX_STATIC("uart2_cts.uart2_cts", |
| 796 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), |
| 797 | OMAP_MUX_STATIC("uart2_rts.uart2_rts", |
| 798 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), |
| 799 | OMAP_MUX_STATIC("uart2_rx.uart2_rx", |
| 800 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), |
| 801 | OMAP_MUX_STATIC("uart2_tx.uart2_tx", |
| 802 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), |
| 803 | }; |
| 804 | |
| 805 | static struct omap_device_pad serial3_pads[] __initdata = { |
| 806 | OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx", |
| 807 | OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), |
| 808 | OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd", |
| 809 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), |
| 810 | OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx", |
| 811 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), |
| 812 | OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx", |
| 813 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), |
| 814 | }; |
| 815 | |
| 816 | static struct omap_device_pad serial4_pads[] __initdata = { |
| 817 | OMAP_MUX_STATIC("uart4_rx.uart4_rx", |
| 818 | OMAP_PIN_INPUT | OMAP_MUX_MODE0), |
| 819 | OMAP_MUX_STATIC("uart4_tx.uart4_tx", |
| 820 | OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), |
| 821 | }; |
| 822 | |
Santosh Shilimkar | 89c4705 | 2011-05-30 00:11:45 -0700 | [diff] [blame] | 823 | static struct omap_board_data serial2_data __initdata = { |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 824 | .id = 1, |
| 825 | .pads = serial2_pads, |
| 826 | .pads_cnt = ARRAY_SIZE(serial2_pads), |
| 827 | }; |
| 828 | |
Santosh Shilimkar | 89c4705 | 2011-05-30 00:11:45 -0700 | [diff] [blame] | 829 | static struct omap_board_data serial3_data __initdata = { |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 830 | .id = 2, |
| 831 | .pads = serial3_pads, |
| 832 | .pads_cnt = ARRAY_SIZE(serial3_pads), |
| 833 | }; |
| 834 | |
Santosh Shilimkar | 89c4705 | 2011-05-30 00:11:45 -0700 | [diff] [blame] | 835 | static struct omap_board_data serial4_data __initdata = { |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 836 | .id = 3, |
| 837 | .pads = serial4_pads, |
| 838 | .pads_cnt = ARRAY_SIZE(serial4_pads), |
| 839 | }; |
| 840 | |
| 841 | static inline void board_serial_init(void) |
| 842 | { |
| 843 | struct omap_board_data bdata; |
| 844 | bdata.flags = 0; |
| 845 | bdata.pads = NULL; |
| 846 | bdata.pads_cnt = 0; |
| 847 | bdata.id = 0; |
| 848 | /* pass dummy data for UART1 */ |
| 849 | omap_serial_init_port(&bdata); |
| 850 | |
| 851 | omap_serial_init_port(&serial2_data); |
| 852 | omap_serial_init_port(&serial3_data); |
| 853 | omap_serial_init_port(&serial4_data); |
| 854 | } |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 855 | #else |
| 856 | #define board_mux NULL |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 857 | |
| 858 | static inline void board_serial_init(void) |
| 859 | { |
| 860 | omap_serial_init(); |
| 861 | } |
| 862 | #endif |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 863 | |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 864 | static void omap4_sdp4430_wifi_mux_init(void) |
| 865 | { |
| 866 | omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | |
| 867 | OMAP_PIN_OFF_WAKEUPENABLE); |
| 868 | omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT); |
| 869 | |
| 870 | omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd", |
| 871 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 872 | omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk", |
| 873 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 874 | omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0", |
| 875 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 876 | omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1", |
| 877 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 878 | omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2", |
| 879 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 880 | omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3", |
| 881 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); |
| 882 | |
| 883 | } |
| 884 | |
| 885 | static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = { |
| 886 | .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ), |
| 887 | .board_ref_clock = WL12XX_REFCLOCK_26, |
| 888 | .board_tcxo_clock = WL12XX_TCXOCLOCK_26, |
| 889 | }; |
| 890 | |
| 891 | static void omap4_sdp4430_wifi_init(void) |
| 892 | { |
| 893 | omap4_sdp4430_wifi_mux_init(); |
| 894 | if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data)) |
| 895 | pr_err("Error setting wl12xx data\n"); |
| 896 | platform_device_register(&omap_vwlan_device); |
| 897 | } |
| 898 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 899 | static void __init omap_4430sdp_init(void) |
| 900 | { |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 901 | int status; |
Benoit Cousson | 6fea7b0 | 2010-09-27 10:50:33 +0200 | [diff] [blame] | 902 | int package = OMAP_PACKAGE_CBS; |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 903 | |
Benoit Cousson | 6fea7b0 | 2010-09-27 10:50:33 +0200 | [diff] [blame] | 904 | if (omap_rev() == OMAP4430_REV_ES1_0) |
| 905 | package = OMAP_PACKAGE_CBL; |
Colin Cross | 21a42c9 | 2011-05-04 14:57:57 -0700 | [diff] [blame] | 906 | omap4_mux_init(board_mux, NULL, package); |
Benoit Cousson | 6fea7b0 | 2010-09-27 10:50:33 +0200 | [diff] [blame] | 907 | |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 908 | omap4_i2c_init(); |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 909 | omap_sfh7741prox_init(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 910 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
R Sricharan | dae3352 | 2011-03-11 06:04:44 +0000 | [diff] [blame] | 911 | board_serial_init(); |
Vishal Mahaveer | 6de8bae | 2011-07-05 03:38:23 -0700 | [diff] [blame] | 912 | omap4_sdp4430_wifi_init(); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 913 | omap4_twl6030_hsmmc_init(mmc); |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame] | 914 | |
Felipe Balbi | 4696084 | 2010-12-07 09:57:59 +0200 | [diff] [blame] | 915 | usb_musb_init(&musb_board_data); |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 916 | |
| 917 | status = omap_ethernet_init(); |
| 918 | if (status) { |
| 919 | pr_err("Ethernet initialization failed: %d\n", status); |
| 920 | } else { |
| 921 | sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); |
| 922 | spi_register_board_info(sdp4430_spi_board_info, |
| 923 | ARRAY_SIZE(sdp4430_spi_board_info)); |
| 924 | } |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 925 | |
Shubhrajyoti Datta | f67df6c | 2011-07-05 03:38:24 -0700 | [diff] [blame] | 926 | status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 927 | if (status) |
| 928 | pr_err("Keypad initialization failed: %d\n", status); |
Mythri P K | 0425b48 | 2011-03-08 18:50:09 +0530 | [diff] [blame] | 929 | |
| 930 | omap_4430sdp_display_init(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 931 | } |
| 932 | |
| 933 | static void __init omap_4430sdp_map_io(void) |
| 934 | { |
| 935 | omap2_set_globals_443x(); |
Tony Lindgren | 6fbd55d | 2010-02-12 12:26:47 -0800 | [diff] [blame] | 936 | omap44xx_map_common_io(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 937 | } |
| 938 | |
| 939 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
| 940 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 941 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 942 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 943 | .map_io = omap_4430sdp_map_io, |
| 944 | .init_early = omap_4430sdp_init_early, |
| 945 | .init_irq = gic_init_irq, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 946 | .init_machine = omap_4430sdp_init, |
Tony Lindgren | e74984e | 2011-03-29 15:54:48 -0700 | [diff] [blame] | 947 | .timer = &omap4_timer, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 948 | MACHINE_END |