PSP-03.00.00.03
[linux-ginger.git] / arch / arm / mach-omap2 / board-3430sdp.c
blobe00598315793d275f7195c879e3b899c86ceee86
1 /*
2 * linux/arch/arm/mach-omap2/board-3430sdp.c
4 * Copyright (C) 2007 Texas Instruments
6 * Modified from mach-omap2/board-generic.c
8 * Initial code: Syed Mohammed Khasim
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.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/delay.h>
19 #include <linux/input.h>
20 #include <linux/input/matrix_keypad.h>
21 #include <linux/spi/spi.h>
22 #include <linux/spi/ads7846.h>
23 #include <linux/i2c/twl4030.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/io.h>
26 #include <linux/gpio.h>
28 #include <mach/hardware.h>
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
33 #include <plat/mcspi.h>
34 #include <plat/mux.h>
35 #include <plat/board.h>
36 #include <plat/usb.h>
37 #include <plat/common.h>
38 #include <plat/dma.h>
39 #include <plat/gpmc.h>
40 #include <plat/clock.h>
41 #include <plat/display.h>
43 #include <plat/control.h>
44 #include <plat/gpmc-smc91x.h>
45 #include <plat/omap-pm.h>
47 #include "sdram-qimonda-hyb18m512160af-6.h"
48 #include "mmc-twl4030.h"
49 #include "pm.h"
50 #include "omap3-opp.h"
52 #include <media/v4l2-int-device.h>
54 #if defined(CONFIG_VIDEO_MT9P012) || defined(CONFIG_VIDEO_MT9P012_MODULE)
55 #include <media/mt9p012.h>
56 extern struct mt9p012_platform_data sdp3430_mt9p012_platform_data;
57 #endif
59 #if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
60 #include <media/ov3640.h>
61 extern struct ov3640_platform_data sdp3430_ov3640_platform_data;
62 #endif
64 #ifdef CONFIG_VIDEO_DW9710
65 #include <media/dw9710.h>
66 extern struct dw9710_platform_data sdp3430_dw9710_platform_data;
67 #endif
69 #if defined(CONFIG_VIDEO_TPS61059) || defined(CONFIG_VIDEO_TPS61059_MODULE)
70 extern struct tps61059_platform_data sdp3430_tps61059_data;
72 static struct platform_device sdp3430_tps61059_device = {
73 .name = "tps61059",
74 .id = -1,
75 .dev = {
76 .platform_data = &sdp3430_tps61059_data,
79 #endif
81 extern void sdp3430_cam_init(void);
83 #define SDP3430_TS_GPIO_IRQ_SDPV1 3
84 #define SDP3430_TS_GPIO_IRQ_SDPV2 2
86 #define ENABLE_VAUX3_DEDICATED 0x03
87 #define ENABLE_VAUX3_DEV_GRP 0x20
89 #define TWL4030_MSECURE_GPIO 22
91 /* FIXME: These are not the optimal setup values to be used on 3430sdp*/
92 static struct prm_setup_vc omap3_setuptime_table = {
93 .clksetup = 0xff,
94 .voltsetup_time1 = 0xfff,
95 .voltsetup_time2 = 0xfff,
96 .voltoffset = 0xff,
97 .voltsetup2 = 0xff,
98 .vdd0_on = 0x30,
99 .vdd0_onlp = 0x20,
100 .vdd0_ret = 0x1e,
101 .vdd0_off = 0x00,
102 .vdd1_on = 0x2c,
103 .vdd1_onlp = 0x20,
104 .vdd1_ret = 0x1e,
105 .vdd1_off = 0x00,
108 /* FIXME: These values need to be updated based on more profiling on 3430sdp*/
109 static struct cpuidle_params omap3_cpuidle_params_table[] = {
110 /* C1 */
111 {2, 2, 5},
112 /* C2 */
113 {10, 10, 30},
114 /* C3 */
115 {50, 50, 300},
116 /* C4 */
117 {1500, 1800, 4000},
118 /* C5 */
119 {2500, 7500, 12000},
120 /* C6 */
121 {3000, 8500, 15000},
122 /* C7 */
123 {10000, 30000, 300000},
126 static int board_keymap[] = {
127 KEY(0, 0, KEY_LEFT),
128 KEY(0, 1, KEY_RIGHT),
129 KEY(0, 2, KEY_A),
130 KEY(0, 3, KEY_B),
131 KEY(0, 4, KEY_C),
132 KEY(1, 0, KEY_DOWN),
133 KEY(1, 1, KEY_UP),
134 KEY(1, 2, KEY_E),
135 KEY(1, 3, KEY_F),
136 KEY(1, 4, KEY_G),
137 KEY(2, 0, KEY_ENTER),
138 KEY(2, 1, KEY_I),
139 KEY(2, 2, KEY_J),
140 KEY(2, 3, KEY_K),
141 KEY(2, 4, KEY_3),
142 KEY(3, 0, KEY_M),
143 KEY(3, 1, KEY_N),
144 KEY(3, 2, KEY_O),
145 KEY(3, 3, KEY_P),
146 KEY(3, 4, KEY_Q),
147 KEY(4, 0, KEY_R),
148 KEY(4, 1, KEY_4),
149 KEY(4, 2, KEY_T),
150 KEY(4, 3, KEY_U),
151 KEY(4, 4, KEY_D),
152 KEY(5, 0, KEY_V),
153 KEY(5, 1, KEY_W),
154 KEY(5, 2, KEY_L),
155 KEY(5, 3, KEY_S),
156 KEY(5, 4, KEY_H),
160 static struct matrix_keymap_data board_map_data = {
161 .keymap = board_keymap,
162 .keymap_size = ARRAY_SIZE(board_keymap),
165 static struct twl4030_keypad_data sdp3430_kp_data = {
166 .keymap_data = &board_map_data,
167 .rows = 5,
168 .cols = 6,
169 .rep = 1,
172 static int ts_gpio; /* Needed for ads7846_get_pendown_state */
175 * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
177 * @return - void. If request gpio fails then Flag KERN_ERR.
179 static void ads7846_dev_init(void)
181 if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
182 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
183 return;
186 gpio_direction_input(ts_gpio);
188 omap_set_gpio_debounce(ts_gpio, 1);
189 omap_set_gpio_debounce_time(ts_gpio, 0xa);
192 static int ads7846_get_pendown_state(void)
194 return !gpio_get_value(ts_gpio);
197 static struct ads7846_platform_data tsc2046_config __initdata = {
198 .get_pendown_state = ads7846_get_pendown_state,
199 .keep_vref_on = 1,
203 static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
204 .turbo_mode = 0,
205 .single_channel = 1, /* 0: slave, 1: master */
208 static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
209 [0] = {
211 * TSC2046 operates at a max freqency of 2MHz, so
212 * operate slightly below at 1.5MHz
214 .modalias = "ads7846",
215 .bus_num = 1,
216 .chip_select = 0,
217 .max_speed_hz = 1500000,
218 .controller_data = &tsc2046_mcspi_config,
219 .irq = 0,
220 .platform_data = &tsc2046_config,
225 #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
226 #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
228 static unsigned backlight_gpio;
229 static unsigned enable_gpio;
230 static int lcd_enabled;
231 static int dvi_enabled;
233 static void __init sdp3430_display_init(void)
235 int r;
237 enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO;
238 backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
240 r = gpio_request(enable_gpio, "LCD reset");
241 if (r) {
242 printk(KERN_ERR "failed to get LCD reset GPIO\n");
243 goto err0;
246 r = gpio_request(backlight_gpio, "LCD Backlight");
247 if (r) {
248 printk(KERN_ERR "failed to get LCD backlight GPIO\n");
249 goto err1;
252 gpio_direction_output(enable_gpio, 0);
253 gpio_direction_output(backlight_gpio, 0);
255 return;
256 err1:
257 gpio_free(enable_gpio);
258 err0:
259 return;
262 static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
264 if (dvi_enabled) {
265 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
266 return -EINVAL;
269 gpio_direction_output(enable_gpio, 1);
270 gpio_direction_output(backlight_gpio, 1);
272 lcd_enabled = 1;
274 return 0;
277 static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
279 lcd_enabled = 0;
281 gpio_direction_output(enable_gpio, 0);
282 gpio_direction_output(backlight_gpio, 0);
285 static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
287 if (lcd_enabled) {
288 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
289 return -EINVAL;
292 dvi_enabled = 1;
294 return 0;
297 static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
299 dvi_enabled = 0;
302 static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
304 return 0;
307 static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
312 static struct omap_dss_device sdp3430_lcd_device = {
313 .name = "lcd",
314 .driver_name = "sharp_ls_panel",
315 .type = OMAP_DISPLAY_TYPE_DPI,
316 .phy.dpi.data_lines = 16,
317 .platform_enable = sdp3430_panel_enable_lcd,
318 .platform_disable = sdp3430_panel_disable_lcd,
321 static struct omap_dss_device sdp3430_dvi_device = {
322 .name = "dvi",
323 .driver_name = "generic_panel",
324 .type = OMAP_DISPLAY_TYPE_DPI,
325 .phy.dpi.data_lines = 24,
326 .platform_enable = sdp3430_panel_enable_dvi,
327 .platform_disable = sdp3430_panel_disable_dvi,
330 static struct omap_dss_device sdp3430_tv_device = {
331 .name = "tv",
332 .driver_name = "venc",
333 .type = OMAP_DISPLAY_TYPE_VENC,
334 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
335 .platform_enable = sdp3430_panel_enable_tv,
336 .platform_disable = sdp3430_panel_disable_tv,
340 static struct omap_dss_device *sdp3430_dss_devices[] = {
341 &sdp3430_lcd_device,
342 &sdp3430_dvi_device,
343 &sdp3430_tv_device,
346 static struct omap_dss_board_info sdp3430_dss_data = {
347 .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
348 .devices = sdp3430_dss_devices,
349 .default_device = &sdp3430_lcd_device,
352 static struct platform_device sdp3430_dss_device = {
353 .name = "omapdss",
354 .id = -1,
355 .dev = {
356 .platform_data = &sdp3430_dss_data,
360 static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
361 .supply = "vdda_dac",
362 .dev = &sdp3430_dss_device.dev,
365 static struct platform_device sdp3430_camkit_device = {
366 .name = "sdp3430_camkit",
367 .id = -1,
370 static struct regulator_consumer_supply sdp3430_vaux2_supplies[] = {
372 .supply = "vaux2_1",
373 .dev = &sdp3430_camkit_device.dev,
376 .supply = "vaux2_2",
377 .dev = &sdp3430_camkit_device.dev,
380 .supply = "vaux2_3",
381 .dev = &sdp3430_camkit_device.dev,
385 static struct regulator_consumer_supply sdp3430_vaux4_supplies[] = {
387 .supply = "vaux4_1",
388 .dev = &sdp3430_camkit_device.dev,
392 static struct platform_device *sdp3430_devices[] __initdata = {
393 &sdp3430_dss_device,
394 &sdp3430_camkit_device,
395 #if defined(CONFIG_VIDEO_TPS61059) || defined(CONFIG_VIDEO_TPS61059_MODULE)
396 &sdp3430_tps61059_device,
397 #endif
400 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
403 static void __init omap_3430sdp_init_irq(void)
405 omap_board_config = sdp3430_config;
406 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
407 omap3_pm_init_vc(&omap3_setuptime_table);
408 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
409 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, omap3_mpu_rate_table,
410 omap3_dsp_rate_table, omap3_l3_rate_table);
411 omap_init_irq();
412 omap_gpio_init();
415 static int sdp3430_batt_table[] = {
416 /* 0 C*/
417 30800, 29500, 28300, 27100,
418 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
419 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
420 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
421 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
422 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
423 4040, 3910, 3790, 3670, 3550
426 static struct twl4030_bci_platform_data sdp3430_bci_data = {
427 .battery_tmp_tbl = sdp3430_batt_table,
428 .tblsize = ARRAY_SIZE(sdp3430_batt_table),
431 static struct twl4030_hsmmc_info mmc[] = {
433 .mmc = 1,
434 /* 8 bits (default) requires S6.3 == ON,
435 * so the SIM card isn't used; else 4 bits.
437 .wires = 8,
438 .gpio_wp = 4,
441 .mmc = 2,
442 .wires = 8,
443 .gpio_wp = 7,
445 {} /* Terminator */
448 static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
449 .supply = "vmmc",
452 static struct regulator_consumer_supply sdp3430_vsim_supply = {
453 .supply = "vmmc_aux",
456 static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
457 .supply = "vmmc",
460 static int sdp3430_twl_gpio_setup(struct device *dev,
461 unsigned gpio, unsigned ngpio)
463 /* gpio + 0 is "mmc0_cd" (input/IRQ),
464 * gpio + 1 is "mmc1_cd" (input/IRQ)
466 mmc[0].gpio_cd = gpio + 0;
467 mmc[1].gpio_cd = gpio + 1;
468 twl4030_mmc_init(mmc);
470 /* link regulators to MMC adapters ... we "know" the
471 * regulators will be set up only *after* we return.
473 sdp3430_vmmc1_supply.dev = mmc[0].dev;
474 sdp3430_vsim_supply.dev = mmc[0].dev;
475 sdp3430_vmmc2_supply.dev = mmc[1].dev;
477 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
478 gpio_request(gpio + 7, "sub_lcd_en_bkl");
479 gpio_direction_output(gpio + 7, 0);
481 /* gpio + 15 is "sub_lcd_nRST" (output) */
482 gpio_request(gpio + 15, "sub_lcd_nRST");
483 gpio_direction_output(gpio + 15, 0);
485 return 0;
488 static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
489 .gpio_base = OMAP_MAX_GPIO_LINES,
490 .irq_base = TWL4030_GPIO_IRQ_BASE,
491 .irq_end = TWL4030_GPIO_IRQ_END,
492 .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13)
493 | BIT(16) | BIT(17),
494 .setup = sdp3430_twl_gpio_setup,
497 static struct twl4030_usb_data sdp3430_usb_data = {
498 .usb_mode = T2_USB_MODE_ULPI,
501 static struct twl4030_madc_platform_data sdp3430_madc_data = {
502 .irq_line = 1,
506 static struct twl4030_ins __initdata sleep_on_seq[] = {
507 /* Turn off HFCLKOUT */
508 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 2},
509 /* Turn OFF VDD1 */
510 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 2},
511 /* Turn OFF VDD2 */
512 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
513 /* Turn OFF VPLL1 */
514 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 2},
517 static struct twl4030_script sleep_on_script __initdata = {
518 .script = sleep_on_seq,
519 .size = ARRAY_SIZE(sleep_on_seq),
520 .flags = TWL4030_SLEEP_SCRIPT,
523 static struct twl4030_ins wakeup_p12_seq[] __initdata = {
524 /* Turn on HFCLKOUT */
525 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
526 /* Turn ON VDD1 */
527 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 2},
528 /* Turn ON VDD2 */
529 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
530 /* Turn ON VPLL1 */
531 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 2},
534 static struct twl4030_script wakeup_p12_script __initdata = {
535 .script = wakeup_p12_seq,
536 .size = ARRAY_SIZE(wakeup_p12_seq),
537 .flags = TWL4030_WAKEUP12_SCRIPT,
540 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
541 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
544 static struct twl4030_script wakeup_p3_script __initdata = {
545 .script = wakeup_p3_seq,
546 .size = ARRAY_SIZE(wakeup_p3_seq),
547 .flags = TWL4030_WAKEUP3_SCRIPT,
550 static struct twl4030_ins wrst_seq[] __initdata = {
552 * Reset twl4030.
553 * Reset VDD1 regulator.
554 * Reset VDD2 regulator.
555 * Reset VPLL1 regulator.
556 * Enable sysclk output.
557 * Reenable twl4030.
559 {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
560 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
561 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
562 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
563 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
564 {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
566 static struct twl4030_script wrst_script __initdata = {
567 .script = wrst_seq,
568 .size = ARRAY_SIZE(wrst_seq),
569 .flags = TWL4030_WRST_SCRIPT,
572 static struct twl4030_script *twl4030_scripts[] __initdata = {
573 &sleep_on_script,
574 &wakeup_p12_script,
575 &wakeup_p3_script,
576 &wrst_script,
579 static struct twl4030_resconfig twl4030_rconfig[] = {
580 { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
581 .type2 = -1 },
582 { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
583 .type2 = -1 },
584 { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
585 .type2 = -1 },
586 { 0, 0},
589 static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
590 .scripts = twl4030_scripts,
591 .num = ARRAY_SIZE(twl4030_scripts),
592 .resource_config = twl4030_rconfig,
596 * Apply all the fixed voltages since most versions of U-Boot
597 * don't bother with that initialization.
600 /* VAUX1 for mainboard (irda and sub-lcd) */
601 static struct regulator_init_data sdp3430_vaux1 = {
602 .constraints = {
603 .min_uV = 2800000,
604 .max_uV = 2800000,
605 .apply_uV = true,
606 .valid_modes_mask = REGULATOR_MODE_NORMAL
607 | REGULATOR_MODE_STANDBY,
608 .valid_ops_mask = REGULATOR_CHANGE_MODE
609 | REGULATOR_CHANGE_STATUS,
613 /* VAUX2 for camera module */
614 static struct regulator_init_data sdp3430_vaux2 = {
615 .constraints = {
616 .min_uV = 2800000,
617 .max_uV = 2800000,
618 .apply_uV = true,
619 .valid_modes_mask = REGULATOR_MODE_NORMAL
620 | REGULATOR_MODE_STANDBY,
621 .valid_ops_mask = REGULATOR_CHANGE_MODE
622 | REGULATOR_CHANGE_STATUS,
624 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux2_supplies),
625 .consumer_supplies = sdp3430_vaux2_supplies,
628 /* VAUX3 for LCD board */
629 static struct regulator_init_data sdp3430_vaux3 = {
630 .constraints = {
631 .min_uV = 2800000,
632 .max_uV = 2800000,
633 .apply_uV = true,
634 .valid_modes_mask = REGULATOR_MODE_NORMAL
635 | REGULATOR_MODE_STANDBY,
636 .valid_ops_mask = REGULATOR_CHANGE_MODE
637 | REGULATOR_CHANGE_STATUS,
641 /* VAUX4 for OMAP VDD_CSI2 (camera) */
642 static struct regulator_init_data sdp3430_vaux4 = {
643 .constraints = {
644 .min_uV = 1800000,
645 .max_uV = 1800000,
646 .apply_uV = true,
647 .valid_modes_mask = REGULATOR_MODE_NORMAL
648 | REGULATOR_MODE_STANDBY,
649 .valid_ops_mask = REGULATOR_CHANGE_MODE
650 | REGULATOR_CHANGE_STATUS,
652 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux4_supplies),
653 .consumer_supplies = sdp3430_vaux4_supplies,
656 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
657 static struct regulator_init_data sdp3430_vmmc1 = {
658 .constraints = {
659 .min_uV = 1850000,
660 .max_uV = 3150000,
661 .valid_modes_mask = REGULATOR_MODE_NORMAL
662 | REGULATOR_MODE_STANDBY,
663 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
664 | REGULATOR_CHANGE_MODE
665 | REGULATOR_CHANGE_STATUS,
667 .num_consumer_supplies = 1,
668 .consumer_supplies = &sdp3430_vmmc1_supply,
671 /* VMMC2 for MMC2 card */
672 static struct regulator_init_data sdp3430_vmmc2 = {
673 .constraints = {
674 .min_uV = 1850000,
675 .max_uV = 1850000,
676 .apply_uV = true,
677 .valid_modes_mask = REGULATOR_MODE_NORMAL
678 | REGULATOR_MODE_STANDBY,
679 .valid_ops_mask = REGULATOR_CHANGE_MODE
680 | REGULATOR_CHANGE_STATUS,
682 .num_consumer_supplies = 1,
683 .consumer_supplies = &sdp3430_vmmc2_supply,
686 /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
687 static struct regulator_init_data sdp3430_vsim = {
688 .constraints = {
689 .min_uV = 1800000,
690 .max_uV = 3000000,
691 .valid_modes_mask = REGULATOR_MODE_NORMAL
692 | REGULATOR_MODE_STANDBY,
693 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
694 | REGULATOR_CHANGE_MODE
695 | REGULATOR_CHANGE_STATUS,
697 .num_consumer_supplies = 1,
698 .consumer_supplies = &sdp3430_vsim_supply,
701 /* VDAC for DSS driving S-Video */
702 static struct regulator_init_data sdp3430_vdac = {
703 .constraints = {
704 .min_uV = 1800000,
705 .max_uV = 1800000,
706 .apply_uV = true,
707 .valid_modes_mask = REGULATOR_MODE_NORMAL
708 | REGULATOR_MODE_STANDBY,
709 .valid_ops_mask = REGULATOR_CHANGE_MODE
710 | REGULATOR_CHANGE_STATUS,
712 .num_consumer_supplies = 1,
713 .consumer_supplies = &sdp3430_vdda_dac_supply,
716 /* VPLL2 for digital video outputs */
717 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
719 .supply = "vdvi",
720 .dev = &sdp3430_lcd_device.dev,
723 .supply = "vdds_dsi",
724 .dev = &sdp3430_dss_device.dev,
728 static struct regulator_init_data sdp3430_vpll2 = {
729 .constraints = {
730 .name = "VDVI",
731 .min_uV = 1800000,
732 .max_uV = 1800000,
733 .apply_uV = true,
734 .valid_modes_mask = REGULATOR_MODE_NORMAL
735 | REGULATOR_MODE_STANDBY,
736 .valid_ops_mask = REGULATOR_CHANGE_MODE
737 | REGULATOR_CHANGE_STATUS,
739 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
740 .consumer_supplies = sdp3430_vpll2_supplies,
743 static struct twl4030_platform_data sdp3430_twldata = {
744 .irq_base = TWL4030_IRQ_BASE,
745 .irq_end = TWL4030_IRQ_END,
747 /* platform_data for children goes here */
748 .bci = &sdp3430_bci_data,
749 .gpio = &sdp3430_gpio_data,
750 .madc = &sdp3430_madc_data,
751 .keypad = &sdp3430_kp_data,
752 .power = &sdp3430_t2scripts_data,
753 .usb = &sdp3430_usb_data,
755 .vaux1 = &sdp3430_vaux1,
756 .vaux2 = &sdp3430_vaux2,
757 .vaux3 = &sdp3430_vaux3,
758 .vaux4 = &sdp3430_vaux4,
759 .vmmc1 = &sdp3430_vmmc1,
760 .vmmc2 = &sdp3430_vmmc2,
761 .vsim = &sdp3430_vsim,
762 .vdac = &sdp3430_vdac,
763 .vpll2 = &sdp3430_vpll2,
766 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
768 I2C_BOARD_INFO("twl4030", 0x48),
769 .flags = I2C_CLIENT_WAKE,
770 .irq = INT_34XX_SYS_NIRQ,
771 .platform_data = &sdp3430_twldata,
775 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo_2[] = {
776 #if defined(CONFIG_VIDEO_MT9P012) || defined(CONFIG_VIDEO_MT9P012_MODULE)
778 I2C_BOARD_INFO("mt9p012", MT9P012_I2C_ADDR),
779 .platform_data = &sdp3430_mt9p012_platform_data,
781 #ifdef CONFIG_VIDEO_DW9710
783 I2C_BOARD_INFO("dw9710", DW9710_AF_I2C_ADDR),
784 .platform_data = &sdp3430_dw9710_platform_data,
786 #endif
787 #endif
788 #if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
790 I2C_BOARD_INFO("ov3640", OV3640_I2C_ADDR),
791 .platform_data = &sdp3430_ov3640_platform_data,
793 #endif
796 static int __init omap3430_i2c_init(void)
798 /* i2c1 for PMIC only */
799 omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
800 ARRAY_SIZE(sdp3430_i2c_boardinfo));
801 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
802 omap_register_i2c_bus(2, 400, sdp3430_i2c_boardinfo_2,
803 ARRAY_SIZE(sdp3430_i2c_boardinfo_2));
804 /* i2c3 on display connector (for DVI, tfp410) */
805 omap_register_i2c_bus(3, 400, NULL, 0);
806 return 0;
809 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
811 static struct omap_smc91x_platform_data board_smc91x_data = {
812 .cs = 3,
813 .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 |
814 IORESOURCE_IRQ_LOWLEVEL,
817 static void __init board_smc91x_init(void)
819 if (omap_rev() > OMAP3430_REV_ES1_0)
820 board_smc91x_data.gpio_irq = 6;
821 else
822 board_smc91x_data.gpio_irq = 29;
824 gpmc_smc91x_init(&board_smc91x_data);
827 #else
829 static inline void board_smc91x_init(void)
833 #endif
835 static void enable_board_wakeup_source(void)
837 omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */
840 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
842 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
843 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
844 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
846 .phy_reset = true,
847 .reset_gpio_port[0] = 57,
848 .reset_gpio_port[1] = 61,
849 .reset_gpio_port[2] = -EINVAL
852 static void __init omap_3430sdp_init(void)
854 omap3430_i2c_init();
855 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
856 if (omap_rev() > OMAP3430_REV_ES1_0)
857 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
858 else
859 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1;
860 sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
861 spi_register_board_info(sdp3430_spi_board_info,
862 ARRAY_SIZE(sdp3430_spi_board_info));
863 ads7846_dev_init();
864 omap_serial_init();
865 usb_musb_init();
866 board_smc91x_init();
868 sdp3430_cam_init();
870 sdp3430_display_init();
871 enable_board_wakeup_source();
872 usb_ehci_init(&ehci_pdata);
875 static void __init omap_3430sdp_map_io(void)
877 omap2_set_globals_343x();
878 omap2_map_common_io();
881 MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
882 /* Maintainer: Syed Khasim - Texas Instruments Inc */
883 .phys_io = 0x48000000,
884 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
885 .boot_params = 0x80000100,
886 .map_io = omap_3430sdp_map_io,
887 .init_irq = omap_3430sdp_init_irq,
888 .init_machine = omap_3430sdp_init,
889 .timer = &omap_timer,
890 MACHINE_END