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