]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-3430sdp.c
Merge branch 'omap-fixes'
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-3430sdp.c
1 /*
2  * linux/arch/arm/mach-omap2/board-3430sdp.c
3  *
4  * Copyright (C) 2007 Texas Instruments
5  *
6  * Modified from mach-omap2/board-generic.c
7  *
8  * Initial code: Syed Mohammed Khasim
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/delay.h>
19 #include <linux/input.h>
20 #include <linux/err.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
27 #include <mach/hardware.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/map.h>
31
32 #include <mach/mcspi.h>
33 #include <mach/gpio.h>
34 #include <mach/mux.h>
35 #include <mach/board.h>
36 #include <mach/usb.h>
37 #include <mach/common.h>
38 #include <mach/dma.h>
39 #include <mach/gpmc.h>
40
41 #include <mach/control.h>
42
43 #include "sdram-qimonda-hyb18m512160af-6.h"
44 #include "mmc-twl4030.h"
45
46 #define CONFIG_DISABLE_HFCLK 1
47
48 #define SDP3430_ETHR_START              DEBUG_BASE
49 #define SDP3430_ETHR_GPIO_IRQ_SDPV1     29
50 #define SDP3430_ETHR_GPIO_IRQ_SDPV2     6
51 #define SDP3430_SMC91X_CS               3
52
53 #define SDP3430_TS_GPIO_IRQ_SDPV1       3
54 #define SDP3430_TS_GPIO_IRQ_SDPV2       2
55
56 #define ENABLE_VAUX3_DEDICATED  0x03
57 #define ENABLE_VAUX3_DEV_GRP    0x20
58
59 #define ENABLE_VAUX3_DEDICATED  0x03
60 #define ENABLE_VAUX3_DEV_GRP    0x20
61
62 #define TWL4030_MSECURE_GPIO 22
63
64 extern void sdp3430_flash_init(void);
65
66 static struct resource sdp3430_smc91x_resources[] = {
67         [0] = {
68                 .flags  = IORESOURCE_MEM,
69         },
70         [1] = {
71                 .start  = 0,
72                 .end    = 0,
73                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
74         },
75 };
76
77 static struct platform_device sdp3430_smc91x_device = {
78         .name           = "smc91x",
79         .id             = -1,
80         .num_resources  = ARRAY_SIZE(sdp3430_smc91x_resources),
81         .resource       = sdp3430_smc91x_resources,
82 };
83
84 static int sdp3430_keymap[] = {
85         KEY(0, 0, KEY_LEFT),
86         KEY(0, 1, KEY_RIGHT),
87         KEY(0, 2, KEY_A),
88         KEY(0, 3, KEY_B),
89         KEY(0, 4, KEY_C),
90         KEY(1, 0, KEY_DOWN),
91         KEY(1, 1, KEY_UP),
92         KEY(1, 2, KEY_E),
93         KEY(1, 3, KEY_F),
94         KEY(1, 4, KEY_G),
95         KEY(2, 0, KEY_ENTER),
96         KEY(2, 1, KEY_I),
97         KEY(2, 2, KEY_J),
98         KEY(2, 3, KEY_K),
99         KEY(2, 4, KEY_3),
100         KEY(3, 0, KEY_M),
101         KEY(3, 1, KEY_N),
102         KEY(3, 2, KEY_O),
103         KEY(3, 3, KEY_P),
104         KEY(3, 4, KEY_Q),
105         KEY(4, 0, KEY_R),
106         KEY(4, 1, KEY_4),
107         KEY(4, 2, KEY_T),
108         KEY(4, 3, KEY_U),
109         KEY(4, 4, KEY_D),
110         KEY(5, 0, KEY_V),
111         KEY(5, 1, KEY_W),
112         KEY(5, 2, KEY_L),
113         KEY(5, 3, KEY_S),
114         KEY(5, 4, KEY_H),
115         0
116 };
117
118 static struct twl4030_keypad_data sdp3430_kp_data = {
119         .rows           = 5,
120         .cols           = 6,
121         .keymap         = sdp3430_keymap,
122         .keymapsize     = ARRAY_SIZE(sdp3430_keymap),
123         .rep            = 1,
124 };
125
126 static int ts_gpio;     /* Needed for ads7846_get_pendown_state */
127
128 static int __init msecure_init(void)
129 {
130         int ret = 0;
131
132 #ifdef CONFIG_RTC_DRV_TWL4030
133         /* 3430ES2.0 doesn't have msecure/gpio-22 line connected to T2 */
134         if (omap_type() == OMAP2_DEVICE_TYPE_GP &&
135                         omap_rev() < OMAP3430_REV_ES2_0) {
136                 void __iomem *msecure_pad_config_reg = omap_ctrl_base_get() +
137                         0xA3C;
138                 int mux_mask = 0x04;
139                 u16 tmp;
140
141                 ret = gpio_request(TWL4030_MSECURE_GPIO, "msecure");
142                 if (ret < 0) {
143                         printk(KERN_ERR "msecure_init: can't"
144                                 "reserve GPIO:%d !\n", TWL4030_MSECURE_GPIO);
145                         goto out;
146                 }
147                 /*
148                  * TWL4030 will be in secure mode if msecure line from OMAP
149                  * is low. Make msecure line high in order to change the
150                  * TWL4030 RTC time and calender registers.
151                  */
152                 tmp = __raw_readw(msecure_pad_config_reg);
153                 tmp &= 0xF8; /* To enable mux mode 03/04 = GPIO_RTC */
154                 tmp |= mux_mask;/* To enable mux mode 03/04 = GPIO_RTC */
155                 __raw_writew(tmp, msecure_pad_config_reg);
156
157                 gpio_direction_output(TWL4030_MSECURE_GPIO, 1);
158         }
159 out:
160 #endif
161         return ret;
162 }
163
164 /**
165  * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
166  *
167  * @return - void. If request gpio fails then Flag KERN_ERR.
168  */
169 static void ads7846_dev_init(void)
170 {
171         if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
172                 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
173                 return;
174         }
175
176         gpio_direction_input(ts_gpio);
177
178         omap_set_gpio_debounce(ts_gpio, 1);
179         omap_set_gpio_debounce_time(ts_gpio, 0xa);
180 }
181
182 static int ads7846_get_pendown_state(void)
183 {
184         return !gpio_get_value(ts_gpio);
185 }
186
187 /*
188  * This enable(1)/disable(0) the voltage for TS: uses twl4030 calls
189  */
190 static int ads7846_vaux_control(int vaux_cntrl)
191 {
192         int ret = 0;
193
194         /* FIXME use regulator calls */
195
196 #ifdef CONFIG_TWL4030_CORE
197         /* check for return value of ldo_use: if success it returns 0 */
198         if (vaux_cntrl == VAUX_ENABLE) {
199                 if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
200                         ENABLE_VAUX3_DEDICATED, TWL4030_VAUX3_DEDICATED))
201                         return -EIO;
202                 if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
203                         ENABLE_VAUX3_DEV_GRP, TWL4030_VAUX3_DEV_GRP))
204                         return -EIO;
205         } else if (vaux_cntrl == VAUX_DISABLE) {
206                 if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
207                         0x00, TWL4030_VAUX3_DEDICATED))
208                         return -EIO;
209                 if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
210                         0x00, TWL4030_VAUX3_DEV_GRP))
211                         return -EIO;
212         }
213 #else
214         ret = -EIO;
215 #endif
216         return ret;
217 }
218
219 static struct ads7846_platform_data tsc2046_config __initdata = {
220         .get_pendown_state      = ads7846_get_pendown_state,
221         .keep_vref_on           = 1,
222         .vaux_control           = ads7846_vaux_control,
223 };
224
225
226 static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
227         .turbo_mode     = 0,
228         .single_channel = 1,    /* 0: slave, 1: master */
229 };
230
231 static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
232         [0] = {
233                 /*
234                  * TSC2046 operates at a max freqency of 2MHz, so
235                  * operate slightly below at 1.5MHz
236                  */
237                 .modalias               = "ads7846",
238                 .bus_num                = 1,
239                 .chip_select            = 0,
240                 .max_speed_hz           = 1500000,
241                 .controller_data        = &tsc2046_mcspi_config,
242                 .irq                    = 0,
243                 .platform_data          = &tsc2046_config,
244         },
245 };
246
247 static struct platform_device sdp3430_lcd_device = {
248         .name           = "sdp2430_lcd",
249         .id             = -1,
250 };
251
252 static struct regulator_consumer_supply sdp3430_vdac_supply = {
253         .supply         = "vdac",
254         .dev            = &sdp3430_lcd_device.dev,
255 };
256
257 static struct regulator_consumer_supply sdp3430_vdvi_supply = {
258         .supply         = "vdvi",
259         .dev            = &sdp3430_lcd_device.dev,
260 };
261
262 static struct platform_device *sdp3430_devices[] __initdata = {
263         &sdp3430_smc91x_device,
264         &sdp3430_lcd_device,
265 };
266
267 static inline void __init sdp3430_init_smc91x(void)
268 {
269         int eth_cs;
270         unsigned long cs_mem_base;
271         int eth_gpio = 0;
272
273         eth_cs = SDP3430_SMC91X_CS;
274
275         if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
276                 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
277                 return;
278         }
279
280         sdp3430_smc91x_resources[0].start = cs_mem_base + 0x300;
281         sdp3430_smc91x_resources[0].end = cs_mem_base + 0x30f;
282         udelay(100);
283
284         if (omap_rev() > OMAP3430_REV_ES1_0)
285                 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV2;
286         else
287                 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV1;
288
289         sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio);
290
291         if (gpio_request(eth_gpio, "SMC91x irq") < 0) {
292                 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
293                         eth_gpio);
294                 return;
295         }
296         gpio_direction_input(eth_gpio);
297 }
298
299 static void __init omap_3430sdp_init_irq(void)
300 {
301         omap2_init_common_hw(hyb18m512160af6_sdrc_params);
302         omap_init_irq();
303         omap_gpio_init();
304         sdp3430_init_smc91x();
305 }
306
307 static struct omap_uart_config sdp3430_uart_config __initdata = {
308         .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
309 };
310
311 static struct omap_lcd_config sdp3430_lcd_config __initdata = {
312         .ctrl_name      = "internal",
313 };
314
315 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
316         { OMAP_TAG_UART,        &sdp3430_uart_config },
317         { OMAP_TAG_LCD,         &sdp3430_lcd_config },
318 };
319
320 static int sdp3430_batt_table[] = {
321 /* 0 C*/
322 30800, 29500, 28300, 27100,
323 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
324 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
325 11600, 11200, 10800, 10400, 10000, 9630,   9280,   8950,   8620,   8310,
326 8020,   7730,   7460,   7200,   6950,   6710,   6470,   6250,   6040,   5830,
327 5640,   5450,   5260,   5090,   4920,   4760,   4600,   4450,   4310,   4170,
328 4040,   3910,   3790,   3670,   3550
329 };
330
331 static struct twl4030_bci_platform_data sdp3430_bci_data = {
332         .battery_tmp_tbl        = sdp3430_batt_table,
333         .tblsize                = ARRAY_SIZE(sdp3430_batt_table),
334 };
335
336 static struct twl4030_hsmmc_info mmc[] = {
337         {
338                 .mmc            = 1,
339                 /* 8 bits (default) requires S6.3 == ON,
340                  * so the SIM card isn't used; else 4 bits.
341                  */
342                 .wires          = 8,
343                 .gpio_wp        = 4,
344         },
345         {
346                 .mmc            = 2,
347                 .wires          = 8,
348                 .gpio_wp        = 7,
349         },
350         {}      /* Terminator */
351 };
352
353 static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
354         .supply                 = "vmmc",
355 };
356
357 static struct regulator_consumer_supply sdp3430_vsim_supply = {
358         .supply                 = "vmmc_aux",
359 };
360
361 static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
362         .supply                 = "vmmc",
363 };
364
365 static int sdp3430_twl_gpio_setup(struct device *dev,
366                 unsigned gpio, unsigned ngpio)
367 {
368         /* gpio + 0 is "mmc0_cd" (input/IRQ),
369          * gpio + 1 is "mmc1_cd" (input/IRQ)
370          */
371         mmc[0].gpio_cd = gpio + 0;
372         mmc[1].gpio_cd = gpio + 1;
373         twl4030_mmc_init(mmc);
374
375         /* link regulators to MMC adapters ... we "know" the
376          * regulators will be set up only *after* we return.
377          */
378         sdp3430_vmmc1_supply.dev = mmc[0].dev;
379         sdp3430_vsim_supply.dev = mmc[0].dev;
380         sdp3430_vmmc2_supply.dev = mmc[1].dev;
381
382         /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
383         gpio_request(gpio + 7, "sub_lcd_en_bkl");
384         gpio_direction_output(gpio + 7, 0);
385
386         /* gpio + 15 is "sub_lcd_nRST" (output) */
387         gpio_request(gpio + 15, "sub_lcd_nRST");
388         gpio_direction_output(gpio + 15, 0);
389
390         return 0;
391 }
392
393 static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
394         .gpio_base      = OMAP_MAX_GPIO_LINES,
395         .irq_base       = TWL4030_GPIO_IRQ_BASE,
396         .irq_end        = TWL4030_GPIO_IRQ_END,
397         .pulldowns      = BIT(2) | BIT(6) | BIT(8) | BIT(13)
398                                 | BIT(16) | BIT(17),
399         .setup          = sdp3430_twl_gpio_setup,
400 };
401
402 static struct twl4030_usb_data sdp3430_usb_data = {
403         .usb_mode       = T2_USB_MODE_ULPI,
404 };
405
406 static struct twl4030_madc_platform_data sdp3430_madc_data = {
407         .irq_line       = 1,
408 };
409
410
411 static struct twl4030_ins __initdata sleep_on_seq[] = {
412 /*
413  * Turn off VDD1 and VDD2.
414  */
415         {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4},
416         {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
417 #ifdef CONFIG_DISABLE_HFCLK
418 /*
419  * And also turn off the OMAP3 PLLs and the sysclk output.
420  */
421         {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3},
422         {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 3},
423 #endif
424 };
425
426 static struct twl4030_script sleep_on_script __initdata = {
427         .script = sleep_on_seq,
428         .size   = ARRAY_SIZE(sleep_on_seq),
429         .flags  = TRITON_SLEEP_SCRIPT,
430 };
431
432 static struct twl4030_ins wakeup_seq[] __initdata = {
433 #ifndef CONFIG_DISABLE_HFCLK
434 /*
435  * Wakeup VDD1 and VDD2.
436  */
437         {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 4},
438         {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
439 #else
440 /*
441  * Reenable the OMAP3 PLLs.
442  * Wakeup VDD1 and VDD2.
443  * Reenable sysclk output.
444  */
445         {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30},
446         {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30},
447         {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37},
448         {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3},
449 #endif /* #ifndef CONFIG_DISABLE_HFCLK */
450 };
451
452 static struct twl4030_script wakeup_script __initdata = {
453         .script = wakeup_seq,
454         .size   = ARRAY_SIZE(wakeup_seq),
455         .flags  = TRITON_WAKEUP12_SCRIPT | TRITON_WAKEUP3_SCRIPT,
456 };
457
458 static struct twl4030_ins wrst_seq[] __initdata = {
459 /*
460  * Reset twl4030.
461  * Reset VDD1 regulator.
462  * Reset VDD2 regulator.
463  * Reset VPLL1 regulator.
464  * Enable sysclk output.
465  * Reenable twl4030.
466  */
467         {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
468         {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
469         {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
470         {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
471         {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
472         {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
473 };
474 static struct twl4030_script wrst_script __initdata = {
475         .script = wrst_seq,
476         .size   = ARRAY_SIZE(wakeup_seq),
477         .flags  = TRITON_WRST_SCRIPT,
478 };
479
480 static struct twl4030_script *twl4030_scripts[] __initdata = {
481         &sleep_on_script,
482         &wakeup_script,
483         &wrst_script,
484 };
485
486 static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
487         .scripts        = twl4030_scripts,
488         .size           = ARRAY_SIZE(twl4030_scripts),
489 };
490
491 /*
492  * Apply all the fixed voltages since most versions of U-Boot
493  * don't bother with that initialization.
494  */
495
496 /* VAUX1 for mainboard (irda and sub-lcd) */
497 static struct regulator_init_data sdp3430_vaux1 = {
498         .constraints = {
499                 .min_uV                 = 2800000,
500                 .max_uV                 = 2800000,
501                 .apply_uV               = true,
502                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
503                                         | REGULATOR_MODE_STANDBY,
504                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
505                                         | REGULATOR_CHANGE_STATUS,
506         },
507 };
508
509 /* VAUX2 for camera module */
510 static struct regulator_init_data sdp3430_vaux2 = {
511         .constraints = {
512                 .min_uV                 = 2800000,
513                 .max_uV                 = 2800000,
514                 .apply_uV               = true,
515                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
516                                         | REGULATOR_MODE_STANDBY,
517                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
518                                         | REGULATOR_CHANGE_STATUS,
519         },
520 };
521
522 /* VAUX3 for LCD board */
523 static struct regulator_init_data sdp3430_vaux3 = {
524         .constraints = {
525                 .min_uV                 = 2800000,
526                 .max_uV                 = 2800000,
527                 .apply_uV               = true,
528                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
529                                         | REGULATOR_MODE_STANDBY,
530                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
531                                         | REGULATOR_CHANGE_STATUS,
532         },
533 };
534
535 /* VAUX4 for OMAP VDD_CSI2 (camera) */
536 static struct regulator_init_data sdp3430_vaux4 = {
537         .constraints = {
538                 .min_uV                 = 1800000,
539                 .max_uV                 = 1800000,
540                 .apply_uV               = true,
541                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
542                                         | REGULATOR_MODE_STANDBY,
543                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
544                                         | REGULATOR_CHANGE_STATUS,
545         },
546 };
547
548 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
549 static struct regulator_init_data sdp3430_vmmc1 = {
550         .constraints = {
551                 .min_uV                 = 1850000,
552                 .max_uV                 = 3150000,
553                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
554                                         | REGULATOR_MODE_STANDBY,
555                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
556                                         | REGULATOR_CHANGE_MODE
557                                         | REGULATOR_CHANGE_STATUS,
558         },
559         .num_consumer_supplies  = 1,
560         .consumer_supplies      = &sdp3430_vmmc1_supply,
561 };
562
563 /* VMMC2 for MMC2 card */
564 static struct regulator_init_data sdp3430_vmmc2 = {
565         .constraints = {
566                 .min_uV                 = 1850000,
567                 .max_uV                 = 1850000,
568                 .apply_uV               = true,
569                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
570                                         | REGULATOR_MODE_STANDBY,
571                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
572                                         | REGULATOR_CHANGE_STATUS,
573         },
574         .num_consumer_supplies  = 1,
575         .consumer_supplies      = &sdp3430_vmmc2_supply,
576 };
577
578 /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
579 static struct regulator_init_data sdp3430_vsim = {
580         .constraints = {
581                 .min_uV                 = 1800000,
582                 .max_uV                 = 3000000,
583                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
584                                         | REGULATOR_MODE_STANDBY,
585                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
586                                         | REGULATOR_CHANGE_MODE
587                                         | REGULATOR_CHANGE_STATUS,
588         },
589         .num_consumer_supplies  = 1,
590         .consumer_supplies      = &sdp3430_vsim_supply,
591 };
592
593 /* VDAC for DSS driving S-Video */
594 static struct regulator_init_data sdp3430_vdac = {
595         .constraints = {
596                 .min_uV                 = 1800000,
597                 .max_uV                 = 1800000,
598                 .apply_uV               = true,
599                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
600                                         | REGULATOR_MODE_STANDBY,
601                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
602                                         | REGULATOR_CHANGE_STATUS,
603         },
604         .num_consumer_supplies  = 1,
605         .consumer_supplies      = &sdp3430_vdac_supply,
606 };
607
608 /* VPLL2 for digital video outputs */
609 static struct regulator_init_data sdp3430_vpll2 = {
610         .constraints = {
611                 .name                   = "VDVI",
612                 .min_uV                 = 1800000,
613                 .max_uV                 = 1800000,
614                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
615                                         | REGULATOR_MODE_STANDBY,
616                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
617                                         | REGULATOR_CHANGE_STATUS,
618         },
619         .num_consumer_supplies  = 1,
620         .consumer_supplies      = &sdp3430_vdvi_supply,
621 };
622
623 static struct twl4030_platform_data sdp3430_twldata = {
624         .irq_base       = TWL4030_IRQ_BASE,
625         .irq_end        = TWL4030_IRQ_END,
626
627         /* platform_data for children goes here */
628         .bci            = &sdp3430_bci_data,
629         .gpio           = &sdp3430_gpio_data,
630         .madc           = &sdp3430_madc_data,
631         .keypad         = &sdp3430_kp_data,
632         .power          = &sdp3430_t2scripts_data,
633         .usb            = &sdp3430_usb_data,
634
635         .vaux1          = &sdp3430_vaux1,
636         .vaux2          = &sdp3430_vaux2,
637         .vaux3          = &sdp3430_vaux3,
638         .vaux4          = &sdp3430_vaux4,
639         .vmmc1          = &sdp3430_vmmc1,
640         .vmmc2          = &sdp3430_vmmc2,
641         .vsim           = &sdp3430_vsim,
642         .vdac           = &sdp3430_vdac,
643         .vpll2          = &sdp3430_vpll2,
644 };
645
646 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
647         {
648                 I2C_BOARD_INFO("twl4030", 0x48),
649                 .flags = I2C_CLIENT_WAKE,
650                 .irq = INT_34XX_SYS_NIRQ,
651                 .platform_data = &sdp3430_twldata,
652         },
653 };
654
655 static int __init omap3430_i2c_init(void)
656 {
657         /* i2c1 for PMIC only */
658         omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
659                         ARRAY_SIZE(sdp3430_i2c_boardinfo));
660         /* i2c2 on camera connector (for sensor control) and optional isp1301 */
661         omap_register_i2c_bus(2, 400, NULL, 0);
662         /* i2c3 on display connector (for DVI, tfp410) */
663         omap_register_i2c_bus(3, 400, NULL, 0);
664         return 0;
665 }
666
667 static void __init omap_3430sdp_init(void)
668 {
669         omap3430_i2c_init();
670         platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
671         omap_board_config = sdp3430_config;
672         omap_board_config_size = ARRAY_SIZE(sdp3430_config);
673         if (omap_rev() > OMAP3430_REV_ES1_0)
674                 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
675         else
676                 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1;
677         sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
678         spi_register_board_info(sdp3430_spi_board_info,
679                                 ARRAY_SIZE(sdp3430_spi_board_info));
680         ads7846_dev_init();
681         sdp3430_flash_init();
682         msecure_init();
683         omap_serial_init();
684         usb_musb_init();
685         usb_ehci_init();
686 }
687
688 static void __init omap_3430sdp_map_io(void)
689 {
690         omap2_set_globals_343x();
691         omap2_map_common_io();
692 }
693
694 MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
695         /* Maintainer: Syed Khasim - Texas Instruments Inc */
696         .phys_io        = 0x48000000,
697         .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
698         .boot_params    = 0x80000100,
699         .map_io         = omap_3430sdp_map_io,
700         .init_irq       = omap_3430sdp_init_irq,
701         .init_machine   = omap_3430sdp_init,
702         .timer          = &omap_timer,
703 MACHINE_END