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