blob: 39a80624177bf5704b8fac7af8a52c75c2867309 [file] [log] [blame]
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -07001/*
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 Mankadbce06682010-02-17 14:09:32 -080020#include <linux/usb/otg.h>
Abraham Arceb2aa5e52010-05-14 12:05:26 -070021#include <linux/spi/spi.h>
Balaji T K6e30a7d2010-05-12 08:27:30 +000022#include <linux/i2c/twl.h>
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -070023#include <linux/gpio_keys.h>
Balaji T K6e30a7d2010-05-12 08:27:30 +000024#include <linux/regulator/machine.h>
Hemanth V509b6d92010-08-02 13:18:04 +030025#include <linux/leds.h>
Hemanth Vf389f4c2010-12-17 18:15:08 -080026#include <linux/leds_pwm.h>
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070027
28#include <mach/hardware.h>
Santosh Shilimkarfbc9be12010-05-14 12:05:26 -070029#include <mach/omap4-common.h>
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070030#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33
Tony Lindgrence491cf2009-10-20 09:40:47 -070034#include <plat/board.h>
35#include <plat/common.h>
Maulik Mankadbce06682010-02-17 14:09:32 -080036#include <plat/usb.h>
kishore kadiyala717c1fb2010-05-15 18:21:06 +000037#include <plat/mmc.h>
Syed Rafiuddin59556762010-12-27 05:51:45 +000038#include <plat/omap4-keypad.h>
Tomi Valkeinena0b38cc2011-05-11 14:05:07 +030039#include <video/omapdss.h>
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070040
Benoit Coussonfb6bf632010-08-10 17:43:15 +020041#include "mux.h"
kishore kadiyala717c1fb2010-05-15 18:21:06 +000042#include "hsmmc.h"
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070043#include "timer-gp.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060044#include "control.h"
Mike Rapoportfbd80712011-04-25 01:09:06 +030045#include "common-board-devices.h"
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070046
Abraham Arceb2aa5e52010-05-14 12:05:26 -070047#define ETH_KS8851_IRQ 34
48#define ETH_KS8851_POWER_ON 48
49#define ETH_KS8851_QUART 138
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -070050#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
51#define OMAP4_SFH7741_ENABLE_GPIO 188
Mythri P K0425b482011-03-08 18:50:09 +053052#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
53#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
Abraham Arceb2aa5e52010-05-14 12:05:26 -070054
Syed Rafiuddin59556762010-12-27 05:51:45 +000055static const int sdp4430_keymap[] = {
56 KEY(0, 0, KEY_E),
57 KEY(0, 1, KEY_R),
58 KEY(0, 2, KEY_T),
59 KEY(0, 3, KEY_HOME),
60 KEY(0, 4, KEY_F5),
61 KEY(0, 5, KEY_UNKNOWN),
62 KEY(0, 6, KEY_I),
63 KEY(0, 7, KEY_LEFTSHIFT),
64
65 KEY(1, 0, KEY_D),
66 KEY(1, 1, KEY_F),
67 KEY(1, 2, KEY_G),
68 KEY(1, 3, KEY_SEND),
69 KEY(1, 4, KEY_F6),
70 KEY(1, 5, KEY_UNKNOWN),
71 KEY(1, 6, KEY_K),
72 KEY(1, 7, KEY_ENTER),
73
74 KEY(2, 0, KEY_X),
75 KEY(2, 1, KEY_C),
76 KEY(2, 2, KEY_V),
77 KEY(2, 3, KEY_END),
78 KEY(2, 4, KEY_F7),
79 KEY(2, 5, KEY_UNKNOWN),
80 KEY(2, 6, KEY_DOT),
81 KEY(2, 7, KEY_CAPSLOCK),
82
83 KEY(3, 0, KEY_Z),
84 KEY(3, 1, KEY_KPPLUS),
85 KEY(3, 2, KEY_B),
86 KEY(3, 3, KEY_F1),
87 KEY(3, 4, KEY_F8),
88 KEY(3, 5, KEY_UNKNOWN),
89 KEY(3, 6, KEY_O),
90 KEY(3, 7, KEY_SPACE),
91
92 KEY(4, 0, KEY_W),
93 KEY(4, 1, KEY_Y),
94 KEY(4, 2, KEY_U),
95 KEY(4, 3, KEY_F2),
96 KEY(4, 4, KEY_VOLUMEUP),
97 KEY(4, 5, KEY_UNKNOWN),
98 KEY(4, 6, KEY_L),
99 KEY(4, 7, KEY_LEFT),
100
101 KEY(5, 0, KEY_S),
102 KEY(5, 1, KEY_H),
103 KEY(5, 2, KEY_J),
104 KEY(5, 3, KEY_F3),
105 KEY(5, 4, KEY_F9),
106 KEY(5, 5, KEY_VOLUMEDOWN),
107 KEY(5, 6, KEY_M),
108 KEY(5, 7, KEY_RIGHT),
109
110 KEY(6, 0, KEY_Q),
111 KEY(6, 1, KEY_A),
112 KEY(6, 2, KEY_N),
113 KEY(6, 3, KEY_BACK),
114 KEY(6, 4, KEY_BACKSPACE),
115 KEY(6, 5, KEY_UNKNOWN),
116 KEY(6, 6, KEY_P),
117 KEY(6, 7, KEY_UP),
118
119 KEY(7, 0, KEY_PROG1),
120 KEY(7, 1, KEY_PROG2),
121 KEY(7, 2, KEY_PROG3),
122 KEY(7, 3, KEY_PROG4),
123 KEY(7, 4, KEY_F4),
124 KEY(7, 5, KEY_UNKNOWN),
125 KEY(7, 6, KEY_OK),
126 KEY(7, 7, KEY_DOWN),
127};
128
129static struct matrix_keymap_data sdp4430_keymap_data = {
130 .keymap = sdp4430_keymap,
131 .keymap_size = ARRAY_SIZE(sdp4430_keymap),
132};
133
134static struct omap4_keypad_platform_data sdp4430_keypad_data = {
135 .keymap_data = &sdp4430_keymap_data,
136 .rows = 8,
137 .cols = 8,
138};
Hemanth V509b6d92010-08-02 13:18:04 +0300139static struct gpio_led sdp4430_gpio_leds[] = {
140 {
141 .name = "omap4:green:debug0",
142 .gpio = 61,
143 },
144 {
145 .name = "omap4:green:debug1",
146 .gpio = 30,
147 },
148 {
149 .name = "omap4:green:debug2",
150 .gpio = 7,
151 },
152 {
153 .name = "omap4:green:debug3",
154 .gpio = 8,
155 },
156 {
157 .name = "omap4:green:debug4",
158 .gpio = 50,
159 },
160 {
161 .name = "omap4:blue:user",
162 .gpio = 169,
163 },
164 {
165 .name = "omap4:red:user",
166 .gpio = 170,
167 },
168 {
169 .name = "omap4:green:user",
170 .gpio = 139,
171 },
172
173};
174
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700175static struct gpio_keys_button sdp4430_gpio_keys[] = {
176 {
177 .desc = "Proximity Sensor",
178 .type = EV_SW,
179 .code = SW_FRONT_PROXIMITY,
180 .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
181 .active_low = 0,
182 }
183};
184
Hemanth V509b6d92010-08-02 13:18:04 +0300185static struct gpio_led_platform_data sdp4430_led_data = {
186 .leds = sdp4430_gpio_leds,
187 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
188};
189
Hemanth Vf389f4c2010-12-17 18:15:08 -0800190static struct led_pwm sdp4430_pwm_leds[] = {
191 {
192 .name = "omap4:green:chrg",
193 .pwm_id = 1,
194 .max_brightness = 255,
195 .pwm_period_ns = 7812500,
196 },
197};
198
199static struct led_pwm_platform_data sdp4430_pwm_data = {
200 .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
201 .leds = sdp4430_pwm_leds,
202};
203
204static struct platform_device sdp4430_leds_pwm = {
205 .name = "leds_pwm",
206 .id = -1,
207 .dev = {
208 .platform_data = &sdp4430_pwm_data,
209 },
210};
211
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700212static int omap_prox_activate(struct device *dev)
213{
214 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
215 return 0;
216}
217
218static void omap_prox_deactivate(struct device *dev)
219{
220 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
221}
222
223static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
224 .buttons = sdp4430_gpio_keys,
225 .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
226 .enable = omap_prox_activate,
227 .disable = omap_prox_deactivate,
228};
229
230static struct platform_device sdp4430_gpio_keys_device = {
231 .name = "gpio-keys",
232 .id = -1,
233 .dev = {
234 .platform_data = &sdp4430_gpio_keys_data,
235 },
236};
237
Hemanth V509b6d92010-08-02 13:18:04 +0300238static struct platform_device sdp4430_leds_gpio = {
239 .name = "leds-gpio",
240 .id = -1,
241 .dev = {
242 .platform_data = &sdp4430_led_data,
243 },
244};
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700245static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
246 {
247 .modalias = "ks8851",
248 .bus_num = 1,
249 .chip_select = 0,
250 .max_speed_hz = 24000000,
251 .irq = ETH_KS8851_IRQ,
252 },
253};
254
Igor Grinbergbc593f52011-05-03 18:22:09 +0300255static struct gpio sdp4430_eth_gpios[] __initdata = {
256 { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
257 { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
258 { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
259};
260
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700261static int __init omap_ethernet_init(void)
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700262{
263 int status;
264
265 /* Request of GPIO lines */
Igor Grinbergbc593f52011-05-03 18:22:09 +0300266 status = gpio_request_array(sdp4430_eth_gpios,
267 ARRAY_SIZE(sdp4430_eth_gpios));
268 if (status)
269 pr_err("Cannot request ETH GPIOs\n");
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700270
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700271 return status;
272}
273
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700274static struct platform_device sdp4430_lcd_device = {
275 .name = "sdp4430_lcd",
276 .id = -1,
277};
278
279static struct platform_device *sdp4430_devices[] __initdata = {
280 &sdp4430_lcd_device,
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700281 &sdp4430_gpio_keys_device,
Hemanth V509b6d92010-08-02 13:18:04 +0300282 &sdp4430_leds_gpio,
Hemanth Vf389f4c2010-12-17 18:15:08 -0800283 &sdp4430_leds_pwm,
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700284};
285
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700286static struct omap_lcd_config sdp4430_lcd_config __initdata = {
287 .ctrl_name = "internal",
288};
289
290static struct omap_board_config_kernel sdp4430_config[] __initdata = {
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700291 { OMAP_TAG_LCD, &sdp4430_lcd_config },
292};
293
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800294static void __init omap_4430sdp_init_early(void)
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700295{
Paul Walmsley48057342010-12-21 15:25:10 -0700296 omap2_init_common_infrastructure();
297 omap2_init_common_devices(NULL, NULL);
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700298#ifdef CONFIG_OMAP_32K_TIMER
299 omap2_gp_clockevent_set_gptimer(1);
300#endif
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700301}
302
Maulik Mankadbce06682010-02-17 14:09:32 -0800303static struct omap_musb_board_data musb_board_data = {
304 .interface_type = MUSB_INTERFACE_UTMI,
Hema HK09e72002010-12-10 18:11:42 +0530305 .mode = MUSB_OTG,
Maulik Mankadbce06682010-02-17 14:09:32 -0800306 .power = 100,
307};
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000308
Hema HKe70357e2010-12-10 18:09:52 +0530309static struct twl4030_usb_data omap4_usbphy_data = {
310 .phy_init = omap4430_phy_init,
311 .phy_exit = omap4430_phy_exit,
312 .phy_power = omap4430_phy_power,
313 .phy_set_clock = omap4430_phy_set_clk,
Hema HKee896e32011-02-17 12:06:07 +0530314 .phy_suspend = omap4430_phy_suspend,
Hema HKe70357e2010-12-10 18:09:52 +0530315};
316
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000317static struct omap2_hsmmc_info mmc[] = {
318 {
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000319 .mmc = 2,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000320 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000321 .gpio_cd = -EINVAL,
322 .gpio_wp = -EINVAL,
323 .nonremovable = true,
kishore kadiyala64be9782010-10-01 16:35:28 -0700324 .ocr_mask = MMC_VDD_29_30,
Balaji T Kb1c1df72011-05-30 19:55:34 +0530325 .no_off_init = true,
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000326 },
Kishore Kadiyala0005ae72011-02-28 20:48:05 +0530327 {
328 .mmc = 1,
329 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
330 .gpio_wp = -EINVAL,
331 },
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000332 {} /* Terminator */
333};
334
Santosh Shilimkar50263912010-08-02 13:18:03 +0300335static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
Oleg Drokin786b01a2011-06-06 18:57:07 +0000336 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
Santosh Shilimkar50263912010-08-02 13:18:03 +0300337};
Oleg Drokin786b01a2011-06-06 18:57:07 +0000338
Balaji T K6e30a7d2010-05-12 08:27:30 +0000339static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
Oleg Drokin786b01a2011-06-06 18:57:07 +0000340 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
Balaji T K6e30a7d2010-05-12 08:27:30 +0000341};
342
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000343static int omap4_twl6030_hsmmc_late_init(struct device *dev)
344{
345 int ret = 0;
346 struct platform_device *pdev = container_of(dev,
347 struct platform_device, dev);
348 struct omap_mmc_platform_data *pdata = dev->platform_data;
349
350 /* Setting MMC1 Card detect Irq */
kishore kadiyala72f2e2c2010-09-24 17:13:20 +0000351 if (pdev->id == 0) {
352 ret = twl6030_mmc_card_detect_config();
353 if (ret)
354 pr_err("Failed configuring MMC1 card detect\n");
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000355 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
356 MMCDETECT_INTR_OFFSET;
kishore kadiyala72f2e2c2010-09-24 17:13:20 +0000357 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
358 }
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000359 return ret;
360}
361
362static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
363{
Benoit Cousson531c21b2010-10-01 16:35:26 -0700364 struct omap_mmc_platform_data *pdata;
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000365
Benoit Cousson531c21b2010-10-01 16:35:26 -0700366 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
367 if (!dev) {
368 pr_err("Failed %s\n", __func__);
369 return;
370 }
371 pdata = dev->platform_data;
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000372 pdata->init = omap4_twl6030_hsmmc_late_init;
373}
374
375static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
376{
377 struct omap2_hsmmc_info *c;
378
379 omap2_hsmmc_init(controllers);
380 for (c = controllers; c->mmc; c++)
381 omap4_twl6030_hsmmc_set_late_init(c->dev);
382
383 return 0;
384}
385
Balaji T K6e30a7d2010-05-12 08:27:30 +0000386static struct regulator_init_data sdp4430_vaux1 = {
387 .constraints = {
388 .min_uV = 1000000,
389 .max_uV = 3000000,
390 .apply_uV = true,
391 .valid_modes_mask = REGULATOR_MODE_NORMAL
392 | REGULATOR_MODE_STANDBY,
393 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
394 | REGULATOR_CHANGE_MODE
395 | REGULATOR_CHANGE_STATUS,
396 },
Oleg Drokin786b01a2011-06-06 18:57:07 +0000397 .num_consumer_supplies = ARRAY_SIZE(sdp4430_vaux_supply),
Santosh Shilimkar50263912010-08-02 13:18:03 +0300398 .consumer_supplies = sdp4430_vaux_supply,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000399};
400
401static struct regulator_init_data sdp4430_vaux2 = {
402 .constraints = {
403 .min_uV = 1200000,
404 .max_uV = 2800000,
405 .apply_uV = true,
406 .valid_modes_mask = REGULATOR_MODE_NORMAL
407 | REGULATOR_MODE_STANDBY,
408 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
409 | REGULATOR_CHANGE_MODE
410 | REGULATOR_CHANGE_STATUS,
411 },
412};
413
414static struct regulator_init_data sdp4430_vaux3 = {
415 .constraints = {
416 .min_uV = 1000000,
417 .max_uV = 3000000,
418 .apply_uV = true,
419 .valid_modes_mask = REGULATOR_MODE_NORMAL
420 | REGULATOR_MODE_STANDBY,
421 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
422 | REGULATOR_CHANGE_MODE
423 | REGULATOR_CHANGE_STATUS,
424 },
425};
426
427/* VMMC1 for MMC1 card */
428static struct regulator_init_data sdp4430_vmmc = {
429 .constraints = {
430 .min_uV = 1200000,
431 .max_uV = 3000000,
432 .apply_uV = true,
433 .valid_modes_mask = REGULATOR_MODE_NORMAL
434 | REGULATOR_MODE_STANDBY,
435 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
436 | REGULATOR_CHANGE_MODE
437 | REGULATOR_CHANGE_STATUS,
438 },
Santosh Shilimkar50263912010-08-02 13:18:03 +0300439 .num_consumer_supplies = 1,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000440 .consumer_supplies = sdp4430_vmmc_supply,
441};
442
443static struct regulator_init_data sdp4430_vpp = {
444 .constraints = {
445 .min_uV = 1800000,
446 .max_uV = 2500000,
447 .apply_uV = true,
448 .valid_modes_mask = REGULATOR_MODE_NORMAL
449 | REGULATOR_MODE_STANDBY,
450 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
451 | REGULATOR_CHANGE_MODE
452 | REGULATOR_CHANGE_STATUS,
453 },
454};
455
456static struct regulator_init_data sdp4430_vusim = {
457 .constraints = {
458 .min_uV = 1200000,
459 .max_uV = 2900000,
460 .apply_uV = true,
461 .valid_modes_mask = REGULATOR_MODE_NORMAL
462 | REGULATOR_MODE_STANDBY,
463 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
464 | REGULATOR_CHANGE_MODE
465 | REGULATOR_CHANGE_STATUS,
466 },
467};
468
469static struct regulator_init_data sdp4430_vana = {
470 .constraints = {
471 .min_uV = 2100000,
472 .max_uV = 2100000,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000473 .valid_modes_mask = REGULATOR_MODE_NORMAL
474 | REGULATOR_MODE_STANDBY,
475 .valid_ops_mask = REGULATOR_CHANGE_MODE
476 | REGULATOR_CHANGE_STATUS,
477 },
478};
479
480static struct regulator_init_data sdp4430_vcxio = {
481 .constraints = {
482 .min_uV = 1800000,
483 .max_uV = 1800000,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000484 .valid_modes_mask = REGULATOR_MODE_NORMAL
485 | REGULATOR_MODE_STANDBY,
486 .valid_ops_mask = REGULATOR_CHANGE_MODE
487 | REGULATOR_CHANGE_STATUS,
488 },
489};
490
491static struct regulator_init_data sdp4430_vdac = {
492 .constraints = {
493 .min_uV = 1800000,
494 .max_uV = 1800000,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000495 .valid_modes_mask = REGULATOR_MODE_NORMAL
496 | REGULATOR_MODE_STANDBY,
497 .valid_ops_mask = REGULATOR_CHANGE_MODE
498 | REGULATOR_CHANGE_STATUS,
499 },
500};
501
502static struct regulator_init_data sdp4430_vusb = {
503 .constraints = {
504 .min_uV = 3300000,
505 .max_uV = 3300000,
506 .apply_uV = true,
507 .valid_modes_mask = REGULATOR_MODE_NORMAL
508 | REGULATOR_MODE_STANDBY,
509 .valid_ops_mask = REGULATOR_CHANGE_MODE
510 | REGULATOR_CHANGE_STATUS,
511 },
512};
513
Balaji T K8af1b0d2011-02-10 18:45:26 +0530514static struct regulator_init_data sdp4430_clk32kg = {
515 .constraints = {
516 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
517 },
518};
519
Balaji T K6e30a7d2010-05-12 08:27:30 +0000520static struct twl4030_platform_data sdp4430_twldata = {
521 .irq_base = TWL6030_IRQ_BASE,
522 .irq_end = TWL6030_IRQ_END,
523
524 /* Regulators */
525 .vmmc = &sdp4430_vmmc,
526 .vpp = &sdp4430_vpp,
527 .vusim = &sdp4430_vusim,
528 .vana = &sdp4430_vana,
529 .vcxio = &sdp4430_vcxio,
530 .vdac = &sdp4430_vdac,
531 .vusb = &sdp4430_vusb,
532 .vaux1 = &sdp4430_vaux1,
533 .vaux2 = &sdp4430_vaux2,
534 .vaux3 = &sdp4430_vaux3,
Balaji T K8af1b0d2011-02-10 18:45:26 +0530535 .clk32kg = &sdp4430_clk32kg,
Hema HKe70357e2010-12-10 18:09:52 +0530536 .usb = &omap4_usbphy_data
Balaji T K6e30a7d2010-05-12 08:27:30 +0000537};
538
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300539static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
540 {
541 I2C_BOARD_INFO("tmp105", 0x48),
542 },
Hemanth Vd048aca2010-12-17 18:15:08 -0800543 {
544 I2C_BOARD_INFO("bh1780", 0x29),
545 },
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300546};
Shubhrajyoti Datta0df891b2010-09-23 18:22:47 -0700547static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
548 {
549 I2C_BOARD_INFO("hmc5843", 0x1e),
550 },
551};
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000552static int __init omap4_i2c_init(void)
553{
Mike Rapoportfbd80712011-04-25 01:09:06 +0300554 omap4_pmic_init("twl6030", &sdp4430_twldata);
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000555 omap_register_i2c_bus(2, 400, NULL, 0);
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300556 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
557 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
Shubhrajyoti Datta0df891b2010-09-23 18:22:47 -0700558 omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
559 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000560 return 0;
561}
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700562
563static void __init omap_sfh7741prox_init(void)
564{
Igor Grinbergbc593f52011-05-03 18:22:09 +0300565 int error;
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700566
Igor Grinbergbc593f52011-05-03 18:22:09 +0300567 error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
568 GPIOF_OUT_INIT_LOW, "sfh7741");
569 if (error < 0)
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700570 pr_err("%s:failed to request GPIO %d, error %d\n",
571 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700572}
573
Mythri P K0425b482011-03-08 18:50:09 +0530574static void sdp4430_hdmi_mux_init(void)
575{
576 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
577 omap_mux_init_signal("hdmi_hpd",
578 OMAP_PIN_INPUT_PULLUP);
579 omap_mux_init_signal("hdmi_cec",
580 OMAP_PIN_INPUT_PULLUP);
581 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
582 omap_mux_init_signal("hdmi_ddc_scl",
583 OMAP_PIN_INPUT_PULLUP);
584 omap_mux_init_signal("hdmi_ddc_sda",
585 OMAP_PIN_INPUT_PULLUP);
586}
587
Igor Grinbergbc593f52011-05-03 18:22:09 +0300588static struct gpio sdp4430_hdmi_gpios[] = {
589 { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
590 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
591};
592
Mythri P K0425b482011-03-08 18:50:09 +0530593static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
594{
595 int status;
596
Igor Grinbergbc593f52011-05-03 18:22:09 +0300597 status = gpio_request_array(sdp4430_hdmi_gpios,
598 ARRAY_SIZE(sdp4430_hdmi_gpios));
599 if (status)
600 pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
Mythri P K0425b482011-03-08 18:50:09 +0530601
602 return status;
603}
604
605static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
606{
607 gpio_free(HDMI_GPIO_LS_OE);
608 gpio_free(HDMI_GPIO_HPD);
609}
610
611static struct omap_dss_device sdp4430_hdmi_device = {
612 .name = "hdmi",
613 .driver_name = "hdmi_panel",
614 .type = OMAP_DISPLAY_TYPE_HDMI,
Archit Taneja6cb07b22011-04-12 13:52:25 +0530615 .clocks = {
616 .dispc = {
617 .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
618 },
619 .hdmi = {
620 .regn = 15,
621 .regm2 = 1,
622 },
623 },
Mythri P K0425b482011-03-08 18:50:09 +0530624 .platform_enable = sdp4430_panel_enable_hdmi,
625 .platform_disable = sdp4430_panel_disable_hdmi,
626 .channel = OMAP_DSS_CHANNEL_DIGIT,
627};
628
629static struct omap_dss_device *sdp4430_dss_devices[] = {
630 &sdp4430_hdmi_device,
631};
632
633static struct omap_dss_board_info sdp4430_dss_data = {
634 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
635 .devices = sdp4430_dss_devices,
636 .default_device = &sdp4430_hdmi_device,
637};
638
639void omap_4430sdp_display_init(void)
640{
641 sdp4430_hdmi_mux_init();
642 omap_display_init(&sdp4430_dss_data);
643}
644
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200645#ifdef CONFIG_OMAP_MUX
646static struct omap_board_mux board_mux[] __initdata = {
Tony Lindgren7d4ca852011-01-11 15:31:45 -0800647 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200648 { .reg_offset = OMAP_MUX_TERMINATOR },
649};
R Sricharandae33522011-03-11 06:04:44 +0000650
651static struct omap_device_pad serial2_pads[] __initdata = {
652 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
653 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
654 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
655 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
656 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
657 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
658 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
659 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
660};
661
662static struct omap_device_pad serial3_pads[] __initdata = {
663 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
664 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
665 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
666 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
667 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
668 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
669 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
670 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
671};
672
673static struct omap_device_pad serial4_pads[] __initdata = {
674 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
675 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
676 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
677 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
678};
679
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700680static struct omap_board_data serial2_data __initdata = {
R Sricharandae33522011-03-11 06:04:44 +0000681 .id = 1,
682 .pads = serial2_pads,
683 .pads_cnt = ARRAY_SIZE(serial2_pads),
684};
685
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700686static struct omap_board_data serial3_data __initdata = {
R Sricharandae33522011-03-11 06:04:44 +0000687 .id = 2,
688 .pads = serial3_pads,
689 .pads_cnt = ARRAY_SIZE(serial3_pads),
690};
691
Santosh Shilimkar89c47052011-05-30 00:11:45 -0700692static struct omap_board_data serial4_data __initdata = {
R Sricharandae33522011-03-11 06:04:44 +0000693 .id = 3,
694 .pads = serial4_pads,
695 .pads_cnt = ARRAY_SIZE(serial4_pads),
696};
697
698static inline void board_serial_init(void)
699{
700 struct omap_board_data bdata;
701 bdata.flags = 0;
702 bdata.pads = NULL;
703 bdata.pads_cnt = 0;
704 bdata.id = 0;
705 /* pass dummy data for UART1 */
706 omap_serial_init_port(&bdata);
707
708 omap_serial_init_port(&serial2_data);
709 omap_serial_init_port(&serial3_data);
710 omap_serial_init_port(&serial4_data);
711}
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200712#else
713#define board_mux NULL
R Sricharandae33522011-03-11 06:04:44 +0000714
715static inline void board_serial_init(void)
716{
717 omap_serial_init();
718}
719 #endif
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200720
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700721static void __init omap_4430sdp_init(void)
722{
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700723 int status;
Benoit Cousson6fea7b02010-09-27 10:50:33 +0200724 int package = OMAP_PACKAGE_CBS;
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700725
Benoit Cousson6fea7b02010-09-27 10:50:33 +0200726 if (omap_rev() == OMAP4430_REV_ES1_0)
727 package = OMAP_PACKAGE_CBL;
Colin Cross21a42c92011-05-04 14:57:57 -0700728 omap4_mux_init(board_mux, NULL, package);
Benoit Cousson6fea7b02010-09-27 10:50:33 +0200729
Tony Lindgrene41cccf2011-02-24 14:36:03 -0800730 omap_board_config = sdp4430_config;
731 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
732
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000733 omap4_i2c_init();
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700734 omap_sfh7741prox_init();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700735 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
R Sricharandae33522011-03-11 06:04:44 +0000736 board_serial_init();
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000737 omap4_twl6030_hsmmc_init(mmc);
Keshava Munegowda6aa85a52010-11-21 23:23:42 +0530738
Felipe Balbi46960842010-12-07 09:57:59 +0200739 usb_musb_init(&musb_board_data);
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700740
741 status = omap_ethernet_init();
742 if (status) {
743 pr_err("Ethernet initialization failed: %d\n", status);
744 } else {
745 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
746 spi_register_board_info(sdp4430_spi_board_info,
747 ARRAY_SIZE(sdp4430_spi_board_info));
748 }
Syed Rafiuddin59556762010-12-27 05:51:45 +0000749
750 status = omap4_keyboard_init(&sdp4430_keypad_data);
751 if (status)
752 pr_err("Keypad initialization failed: %d\n", status);
Mythri P K0425b482011-03-08 18:50:09 +0530753
754 omap_4430sdp_display_init();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700755}
756
757static void __init omap_4430sdp_map_io(void)
758{
759 omap2_set_globals_443x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800760 omap44xx_map_common_io();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700761}
762
763MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
764 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700765 .boot_params = 0x80000100,
Russell King71ee7da2010-05-23 10:18:16 +0100766 .reserve = omap_reserve,
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800767 .map_io = omap_4430sdp_map_io,
768 .init_early = omap_4430sdp_init_early,
769 .init_irq = gic_init_irq,
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700770 .init_machine = omap_4430sdp_init,
771 .timer = &omap_timer,
772MACHINE_END