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