aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-3430sdp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:28:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:28:15 -0400
commit0df0914d414a504b975f3cc66ace0c16ef55b7f3 (patch)
treec97ffa357943a8b226cdec1b9632c4cede813205 /arch/arm/mach-omap2/board-3430sdp.c
parent6899608533410557e6698cb9d4ff6df553916e98 (diff)
parent05f689400ea5fa3d71af82f910c8b140f87ad1f3 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (258 commits) omap: zoom: host should not pull up wl1271's irq line arm: plat-omap: iommu: fix request_mem_region() error path OMAP2+: Common CPU DIE ID reading code reads wrong registers for OMAP4430 omap4: mux: Remove duplicate mux modes omap: iovmm: don't check 'da' to set IOVMF_DA_FIXED flag omap: iovmm: disallow mapping NULL address when IOVMF_DA_ANON is set omap2+: mux: Fix compile when CONFIG_OMAP_MUX is not selected omap4: board-omap4panda: Initialise the serial pads omap3: board-3430sdp: Initialise the serial pads omap4: board-4430sdp: Initialise the serial pads omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init omap2+: mux: Remove the use of IDLE flag omap2+: Add separate list for dynamic pads to mux perf: add OMAP support for the new power events OMAP4: Add IVA OPP enteries. OMAP4: Update Voltage Rail Values for MPU, IVA and CORE OMAP4: Enable 800 MHz and 1 GHz MPU-OPP OMAP3+: OPP: Replace voltage values with Macros OMAP3: wdtimer: Fix CORE idle transition Watchdog: omap_wdt: add fine grain runtime-pm ... Fix up various conflicts in - arch/arm/mach-omap2/board-omap3evm.c - arch/arm/mach-omap2/clock3xxx_data.c - arch/arm/mach-omap2/usb-musb.c - arch/arm/plat-omap/include/plat/usb.h - drivers/usb/musb/musb_core.h
Diffstat (limited to 'arch/arm/mach-omap2/board-3430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c215
1 files changed, 151 insertions, 64 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 7542ba59f2b8..c06eb423c4e4 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,34 +307,16 @@ static struct omap_dss_board_info sdp3430_dss_data = {
307 .default_device = &sdp3430_lcd_device, 307 .default_device = &sdp3430_lcd_device,
308}; 308};
309 309
310static struct platform_device sdp3430_dss_device = { 310static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
311 .name = "omapdss", 311 REGULATOR_SUPPLY("vdda_dac", "omapdss");
312 .id = -1,
313 .dev = {
314 .platform_data = &sdp3430_dss_data,
315 },
316};
317
318static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
319 .supply = "vdda_dac",
320 .dev = &sdp3430_dss_device.dev,
321};
322
323static struct platform_device *sdp3430_devices[] __initdata = {
324 &sdp3430_dss_device,
325};
326 312
327static struct omap_board_config_kernel sdp3430_config[] __initdata = { 313static struct omap_board_config_kernel sdp3430_config[] __initdata = {
328}; 314};
329 315
330static void __init omap_3430sdp_init_irq(void) 316static void __init omap_3430sdp_init_early(void)
331{ 317{
332 omap_board_config = sdp3430_config;
333 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
334 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
335 omap2_init_common_infrastructure(); 318 omap2_init_common_infrastructure();
336 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); 319 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
337 omap_init_irq();
338} 320}
339 321
340static int sdp3430_batt_table[] = { 322static int sdp3430_batt_table[] = {
@@ -370,18 +352,6 @@ static struct omap2_hsmmc_info mmc[] = {
370 {} /* Terminator */ 352 {} /* Terminator */
371}; 353};
372 354
373static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
374 .supply = "vmmc",
375};
376
377static struct regulator_consumer_supply sdp3430_vsim_supply = {
378 .supply = "vmmc_aux",
379};
380
381static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
382 .supply = "vmmc",
383};
384
385static int sdp3430_twl_gpio_setup(struct device *dev, 355static int sdp3430_twl_gpio_setup(struct device *dev,
386 unsigned gpio, unsigned ngpio) 356 unsigned gpio, unsigned ngpio)
387{ 357{
@@ -392,13 +362,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
392 mmc[1].gpio_cd = gpio + 1; 362 mmc[1].gpio_cd = gpio + 1;
393 omap2_hsmmc_init(mmc); 363 omap2_hsmmc_init(mmc);
394 364
395 /* link regulators to MMC adapters ... we "know" the
396 * regulators will be set up only *after* we return.
397 */
398 sdp3430_vmmc1_supply.dev = mmc[0].dev;
399 sdp3430_vsim_supply.dev = mmc[0].dev;
400 sdp3430_vmmc2_supply.dev = mmc[1].dev;
401
402 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ 365 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
403 gpio_request(gpio + 7, "sub_lcd_en_bkl"); 366 gpio_request(gpio + 7, "sub_lcd_en_bkl");
404 gpio_direction_output(gpio + 7, 0); 367 gpio_direction_output(gpio + 7, 0);
@@ -427,6 +390,34 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
427 .irq_line = 1, 390 .irq_line = 1,
428}; 391};
429 392
393/* regulator consumer mappings */
394
395/* ads7846 on SPI */
396static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
397 REGULATOR_SUPPLY("vcc", "spi1.0"),
398};
399
400static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
401 REGULATOR_SUPPLY("vdda_dac", "omapdss"),
402};
403
404/* VPLL2 for digital video outputs */
405static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
406 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
407};
408
409static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
410 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
411};
412
413static struct regulator_consumer_supply sdp3430_vsim_supplies[] = {
414 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
415};
416
417static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = {
418 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
419};
420
430/* 421/*
431 * Apply all the fixed voltages since most versions of U-Boot 422 * Apply all the fixed voltages since most versions of U-Boot
432 * don't bother with that initialization. 423 * don't bother with that initialization.
@@ -469,6 +460,8 @@ static struct regulator_init_data sdp3430_vaux3 = {
469 .valid_ops_mask = REGULATOR_CHANGE_MODE 460 .valid_ops_mask = REGULATOR_CHANGE_MODE
470 | REGULATOR_CHANGE_STATUS, 461 | REGULATOR_CHANGE_STATUS,
471 }, 462 },
463 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies),
464 .consumer_supplies = sdp3430_vaux3_supplies,
472}; 465};
473 466
474/* VAUX4 for OMAP VDD_CSI2 (camera) */ 467/* VAUX4 for OMAP VDD_CSI2 (camera) */
@@ -495,8 +488,8 @@ static struct regulator_init_data sdp3430_vmmc1 = {
495 | REGULATOR_CHANGE_MODE 488 | REGULATOR_CHANGE_MODE
496 | REGULATOR_CHANGE_STATUS, 489 | REGULATOR_CHANGE_STATUS,
497 }, 490 },
498 .num_consumer_supplies = 1, 491 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies),
499 .consumer_supplies = &sdp3430_vmmc1_supply, 492 .consumer_supplies = sdp3430_vmmc1_supplies,
500}; 493};
501 494
502/* VMMC2 for MMC2 card */ 495/* VMMC2 for MMC2 card */
@@ -510,8 +503,8 @@ static struct regulator_init_data sdp3430_vmmc2 = {
510 .valid_ops_mask = REGULATOR_CHANGE_MODE 503 .valid_ops_mask = REGULATOR_CHANGE_MODE
511 | REGULATOR_CHANGE_STATUS, 504 | REGULATOR_CHANGE_STATUS,
512 }, 505 },
513 .num_consumer_supplies = 1, 506 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies),
514 .consumer_supplies = &sdp3430_vmmc2_supply, 507 .consumer_supplies = sdp3430_vmmc2_supplies,
515}; 508};
516 509
517/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ 510/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
@@ -525,8 +518,8 @@ static struct regulator_init_data sdp3430_vsim = {
525 | REGULATOR_CHANGE_MODE 518 | REGULATOR_CHANGE_MODE
526 | REGULATOR_CHANGE_STATUS, 519 | REGULATOR_CHANGE_STATUS,
527 }, 520 },
528 .num_consumer_supplies = 1, 521 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies),
529 .consumer_supplies = &sdp3430_vsim_supply, 522 .consumer_supplies = sdp3430_vsim_supplies,
530}; 523};
531 524
532/* VDAC for DSS driving S-Video */ 525/* VDAC for DSS driving S-Video */
@@ -540,16 +533,8 @@ static struct regulator_init_data sdp3430_vdac = {
540 .valid_ops_mask = REGULATOR_CHANGE_MODE 533 .valid_ops_mask = REGULATOR_CHANGE_MODE
541 | REGULATOR_CHANGE_STATUS, 534 | REGULATOR_CHANGE_STATUS,
542 }, 535 },
543 .num_consumer_supplies = 1, 536 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
544 .consumer_supplies = &sdp3430_vdda_dac_supply, 537 .consumer_supplies = sdp3430_vdda_dac_supplies,
545};
546
547/* VPLL2 for digital video outputs */
548static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
549 {
550 .supply = "vdds_dsi",
551 .dev = &sdp3430_dss_device.dev,
552 }
553}; 538};
554 539
555static struct regulator_init_data sdp3430_vpll2 = { 540static struct regulator_init_data sdp3430_vpll2 = {
@@ -567,9 +552,7 @@ static struct regulator_init_data sdp3430_vpll2 = {
567 .consumer_supplies = sdp3430_vpll2_supplies, 552 .consumer_supplies = sdp3430_vpll2_supplies,
568}; 553};
569 554
570static struct twl4030_codec_audio_data sdp3430_audio = { 555static struct twl4030_codec_audio_data sdp3430_audio;
571 .audio_mclk = 26000000,
572};
573 556
574static struct twl4030_codec_data sdp3430_codec = { 557static struct twl4030_codec_data sdp3430_codec = {
575 .audio_mclk = 26000000, 558 .audio_mclk = 26000000,
@@ -669,6 +652,106 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
669static struct omap_board_mux board_mux[] __initdata = { 652static struct omap_board_mux board_mux[] __initdata = {
670 { .reg_offset = OMAP_MUX_TERMINATOR }, 653 { .reg_offset = OMAP_MUX_TERMINATOR },
671}; 654};
655
656static struct omap_device_pad serial1_pads[] __initdata = {
657 /*
658 * Note that off output enable is an active low
659 * signal. So setting this means pin is a
660 * input enabled in off mode
661 */
662 OMAP_MUX_STATIC("uart1_cts.uart1_cts",
663 OMAP_PIN_INPUT |
664 OMAP_PIN_OFF_INPUT_PULLDOWN |
665 OMAP_OFFOUT_EN |
666 OMAP_MUX_MODE0),
667 OMAP_MUX_STATIC("uart1_rts.uart1_rts",
668 OMAP_PIN_OUTPUT |
669 OMAP_OFF_EN |
670 OMAP_MUX_MODE0),
671 OMAP_MUX_STATIC("uart1_rx.uart1_rx",
672 OMAP_PIN_INPUT |
673 OMAP_PIN_OFF_INPUT_PULLDOWN |
674 OMAP_OFFOUT_EN |
675 OMAP_MUX_MODE0),
676 OMAP_MUX_STATIC("uart1_tx.uart1_tx",
677 OMAP_PIN_OUTPUT |
678 OMAP_OFF_EN |
679 OMAP_MUX_MODE0),
680};
681
682static struct omap_device_pad serial2_pads[] __initdata = {
683 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
684 OMAP_PIN_INPUT_PULLUP |
685 OMAP_PIN_OFF_INPUT_PULLDOWN |
686 OMAP_OFFOUT_EN |
687 OMAP_MUX_MODE0),
688 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
689 OMAP_PIN_OUTPUT |
690 OMAP_OFF_EN |
691 OMAP_MUX_MODE0),
692 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
693 OMAP_PIN_INPUT |
694 OMAP_PIN_OFF_INPUT_PULLDOWN |
695 OMAP_OFFOUT_EN |
696 OMAP_MUX_MODE0),
697 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
698 OMAP_PIN_OUTPUT |
699 OMAP_OFF_EN |
700 OMAP_MUX_MODE0),
701};
702
703static struct omap_device_pad serial3_pads[] __initdata = {
704 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
705 OMAP_PIN_INPUT_PULLDOWN |
706 OMAP_PIN_OFF_INPUT_PULLDOWN |
707 OMAP_OFFOUT_EN |
708 OMAP_MUX_MODE0),
709 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
710 OMAP_PIN_OUTPUT |
711 OMAP_OFF_EN |
712 OMAP_MUX_MODE0),
713 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
714 OMAP_PIN_INPUT |
715 OMAP_PIN_OFF_INPUT_PULLDOWN |
716 OMAP_OFFOUT_EN |
717 OMAP_MUX_MODE0),
718 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
719 OMAP_PIN_OUTPUT |
720 OMAP_OFF_EN |
721 OMAP_MUX_MODE0),
722};
723
724static struct omap_board_data serial1_data = {
725 .id = 0,
726 .pads = serial1_pads,
727 .pads_cnt = ARRAY_SIZE(serial1_pads),
728};
729
730static struct omap_board_data serial2_data = {
731 .id = 1,
732 .pads = serial2_pads,
733 .pads_cnt = ARRAY_SIZE(serial2_pads),
734};
735
736static struct omap_board_data serial3_data = {
737 .id = 2,
738 .pads = serial3_pads,
739 .pads_cnt = ARRAY_SIZE(serial3_pads),
740};
741
742static inline void board_serial_init(void)
743{
744 omap_serial_init_port(&serial1_data);
745 omap_serial_init_port(&serial2_data);
746 omap_serial_init_port(&serial3_data);
747}
748#else
749#define board_mux NULL
750
751static inline void board_serial_init(void)
752{
753 omap_serial_init();
754}
672#endif 755#endif
673 756
674/* 757/*
@@ -800,8 +883,11 @@ static struct omap_musb_board_data musb_board_data = {
800static void __init omap_3430sdp_init(void) 883static void __init omap_3430sdp_init(void)
801{ 884{
802 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 885 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
886 omap_board_config = sdp3430_config;
887 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
888 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
803 omap3430_i2c_init(); 889 omap3430_i2c_init();
804 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); 890 omap_display_init(&sdp3430_dss_data);
805 if (omap_rev() > OMAP3430_REV_ES1_0) 891 if (omap_rev() > OMAP3430_REV_ES1_0)
806 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; 892 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
807 else 893 else
@@ -810,10 +896,10 @@ static void __init omap_3430sdp_init(void)
810 spi_register_board_info(sdp3430_spi_board_info, 896 spi_register_board_info(sdp3430_spi_board_info,
811 ARRAY_SIZE(sdp3430_spi_board_info)); 897 ARRAY_SIZE(sdp3430_spi_board_info));
812 ads7846_dev_init(); 898 ads7846_dev_init();
813 omap_serial_init(); 899 board_serial_init();
814 usb_musb_init(&musb_board_data); 900 usb_musb_init(&musb_board_data);
815 board_smc91x_init(); 901 board_smc91x_init();
816 board_flash_init(sdp_flash_partitions, chip_sel_3430); 902 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
817 sdp3430_display_init(); 903 sdp3430_display_init();
818 enable_board_wakeup_source(); 904 enable_board_wakeup_source();
819 usbhs_init(&usbhs_bdata); 905 usbhs_init(&usbhs_bdata);
@@ -822,9 +908,10 @@ static void __init omap_3430sdp_init(void)
822MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") 908MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
823 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 909 /* Maintainer: Syed Khasim - Texas Instruments Inc */
824 .boot_params = 0x80000100, 910 .boot_params = 0x80000100,
825 .map_io = omap3_map_io,
826 .reserve = omap_reserve, 911 .reserve = omap_reserve,
827 .init_irq = omap_3430sdp_init_irq, 912 .map_io = omap3_map_io,
913 .init_early = omap_3430sdp_init_early,
914 .init_irq = omap_init_irq,
828 .init_machine = omap_3430sdp_init, 915 .init_machine = omap_3430sdp_init,
829 .timer = &omap_timer, 916 .timer = &omap_timer,
830MACHINE_END 917MACHINE_END