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