aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-rx51-peripherals.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c200
1 files changed, 159 insertions, 41 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 88bd6f7705f0..5a886cd2c598 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -39,6 +39,7 @@
39#include <sound/tpa6130a2-plat.h> 39#include <sound/tpa6130a2-plat.h>
40#include <media/radio-si4713.h> 40#include <media/radio-si4713.h>
41#include <media/si4713.h> 41#include <media/si4713.h>
42#include <linux/leds-lp5523.h>
42 43
43#include <../drivers/staging/iio/light/tsl2563.h> 44#include <../drivers/staging/iio/light/tsl2563.h>
44 45
@@ -53,6 +54,7 @@
53#define RX51_WL1251_IRQ_GPIO 42 54#define RX51_WL1251_IRQ_GPIO 42
54#define RX51_FMTX_RESET_GPIO 163 55#define RX51_FMTX_RESET_GPIO 163
55#define RX51_FMTX_IRQ 53 56#define RX51_FMTX_IRQ 53
57#define RX51_LP5523_CHIP_EN_GPIO 41
56 58
57#define RX51_USB_TRANSCEIVER_RST_GPIO 67 59#define RX51_USB_TRANSCEIVER_RST_GPIO 67
58 60
@@ -71,6 +73,64 @@ static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
71}; 73};
72#endif 74#endif
73 75
76#if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
77static struct lp5523_led_config rx51_lp5523_led_config[] = {
78 {
79 .chan_nr = 0,
80 .led_current = 50,
81 }, {
82 .chan_nr = 1,
83 .led_current = 50,
84 }, {
85 .chan_nr = 2,
86 .led_current = 50,
87 }, {
88 .chan_nr = 3,
89 .led_current = 50,
90 }, {
91 .chan_nr = 4,
92 .led_current = 50,
93 }, {
94 .chan_nr = 5,
95 .led_current = 50,
96 }, {
97 .chan_nr = 6,
98 .led_current = 50,
99 }, {
100 .chan_nr = 7,
101 .led_current = 50,
102 }, {
103 .chan_nr = 8,
104 .led_current = 50,
105 }
106};
107
108static int rx51_lp5523_setup(void)
109{
110 return gpio_request_one(RX51_LP5523_CHIP_EN_GPIO, GPIOF_DIR_OUT,
111 "lp5523_enable");
112}
113
114static void rx51_lp5523_release(void)
115{
116 gpio_free(RX51_LP5523_CHIP_EN_GPIO);
117}
118
119static void rx51_lp5523_enable(bool state)
120{
121 gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state);
122}
123
124static struct lp5523_platform_data rx51_lp5523_platform_data = {
125 .led_config = rx51_lp5523_led_config,
126 .num_channels = ARRAY_SIZE(rx51_lp5523_led_config),
127 .clock_mode = LP5523_CLOCK_AUTO,
128 .setup_resources = rx51_lp5523_setup,
129 .release_resources = rx51_lp5523_release,
130 .enable = rx51_lp5523_enable,
131};
132#endif
133
74static struct omap2_mcspi_device_config wl1251_mcspi_config = { 134static struct omap2_mcspi_device_config wl1251_mcspi_config = {
75 .turbo_mode = 0, 135 .turbo_mode = 0,
76 .single_channel = 1, 136 .single_channel = 1,
@@ -288,10 +348,6 @@ static struct twl4030_keypad_data rx51_kp_data = {
288 .rep = 1, 348 .rep = 1,
289}; 349};
290 350
291static struct twl4030_madc_platform_data rx51_madc_data = {
292 .irq_line = 1,
293};
294
295/* Enable input logic and pull all lines up when eMMC is on. */ 351/* Enable input logic and pull all lines up when eMMC is on. */
296static struct omap_board_mux rx51_mmc2_on_mux[] = { 352static struct omap_board_mux rx51_mmc2_on_mux[] = {
297 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), 353 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
@@ -358,14 +414,21 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
358 {} /* Terminator */ 414 {} /* Terminator */
359}; 415};
360 416
361static struct regulator_consumer_supply rx51_vmmc1_supply = 417static struct regulator_consumer_supply rx51_vmmc1_supply[] = {
362 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); 418 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
419};
363 420
364static struct regulator_consumer_supply rx51_vaux3_supply = 421static struct regulator_consumer_supply rx51_vaux2_supply[] = {
365 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); 422 REGULATOR_SUPPLY("vdds_csib", "omap3isp"),
423};
366 424
367static struct regulator_consumer_supply rx51_vsim_supply = 425static struct regulator_consumer_supply rx51_vaux3_supply[] = {
368 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); 426 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
427};
428
429static struct regulator_consumer_supply rx51_vsim_supply[] = {
430 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"),
431};
369 432
370static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { 433static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
371 /* tlv320aic3x analog supplies */ 434 /* tlv320aic3x analog supplies */
@@ -395,10 +458,6 @@ static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
395 REGULATOR_SUPPLY("vdd", "2-0063"), 458 REGULATOR_SUPPLY("vdd", "2-0063"),
396}; 459};
397 460
398static struct regulator_consumer_supply rx51_vdac_supply[] = {
399 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
400};
401
402static struct regulator_init_data rx51_vaux1 = { 461static struct regulator_init_data rx51_vaux1 = {
403 .constraints = { 462 .constraints = {
404 .name = "V28", 463 .name = "V28",
@@ -424,6 +483,8 @@ static struct regulator_init_data rx51_vaux2 = {
424 .valid_ops_mask = REGULATOR_CHANGE_MODE 483 .valid_ops_mask = REGULATOR_CHANGE_MODE
425 | REGULATOR_CHANGE_STATUS, 484 | REGULATOR_CHANGE_STATUS,
426 }, 485 },
486 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux2_supply),
487 .consumer_supplies = rx51_vaux2_supply,
427}; 488};
428 489
429/* VAUX3 - adds more power to VIO_18 rail */ 490/* VAUX3 - adds more power to VIO_18 rail */
@@ -452,8 +513,8 @@ static struct regulator_init_data rx51_vaux3_mmc = {
452 | REGULATOR_CHANGE_MODE 513 | REGULATOR_CHANGE_MODE
453 | REGULATOR_CHANGE_STATUS, 514 | REGULATOR_CHANGE_STATUS,
454 }, 515 },
455 .num_consumer_supplies = 1, 516 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux3_supply),
456 .consumer_supplies = &rx51_vaux3_supply, 517 .consumer_supplies = rx51_vaux3_supply,
457}; 518};
458 519
459static struct regulator_init_data rx51_vaux4 = { 520static struct regulator_init_data rx51_vaux4 = {
@@ -479,8 +540,8 @@ static struct regulator_init_data rx51_vmmc1 = {
479 | REGULATOR_CHANGE_MODE 540 | REGULATOR_CHANGE_MODE
480 | REGULATOR_CHANGE_STATUS, 541 | REGULATOR_CHANGE_STATUS,
481 }, 542 },
482 .num_consumer_supplies = 1, 543 .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc1_supply),
483 .consumer_supplies = &rx51_vmmc1_supply, 544 .consumer_supplies = rx51_vmmc1_supply,
484}; 545};
485 546
486static struct regulator_init_data rx51_vmmc2 = { 547static struct regulator_init_data rx51_vmmc2 = {
@@ -500,24 +561,35 @@ static struct regulator_init_data rx51_vmmc2 = {
500 .consumer_supplies = rx51_vmmc2_supplies, 561 .consumer_supplies = rx51_vmmc2_supplies,
501}; 562};
502 563
503static struct regulator_init_data rx51_vsim = { 564static struct regulator_init_data rx51_vpll1 = {
504 .constraints = { 565 .constraints = {
505 .name = "VMMC2_IO_18", 566 .name = "VPLL",
506 .min_uV = 1800000, 567 .min_uV = 1800000,
507 .max_uV = 1800000, 568 .max_uV = 1800000,
508 .apply_uV = true, 569 .apply_uV = true,
570 .always_on = true,
509 .valid_modes_mask = REGULATOR_MODE_NORMAL 571 .valid_modes_mask = REGULATOR_MODE_NORMAL
510 | REGULATOR_MODE_STANDBY, 572 | REGULATOR_MODE_STANDBY,
511 .valid_ops_mask = REGULATOR_CHANGE_MODE 573 .valid_ops_mask = REGULATOR_CHANGE_MODE,
512 | REGULATOR_CHANGE_STATUS,
513 }, 574 },
514 .num_consumer_supplies = 1,
515 .consumer_supplies = &rx51_vsim_supply,
516}; 575};
517 576
518static struct regulator_init_data rx51_vdac = { 577static struct regulator_init_data rx51_vpll2 = {
519 .constraints = { 578 .constraints = {
520 .name = "VDAC", 579 .name = "VSDI_CSI",
580 .min_uV = 1800000,
581 .max_uV = 1800000,
582 .apply_uV = true,
583 .always_on = true,
584 .valid_modes_mask = REGULATOR_MODE_NORMAL
585 | REGULATOR_MODE_STANDBY,
586 .valid_ops_mask = REGULATOR_CHANGE_MODE,
587 },
588};
589
590static struct regulator_init_data rx51_vsim = {
591 .constraints = {
592 .name = "VMMC2_IO_18",
521 .min_uV = 1800000, 593 .min_uV = 1800000,
522 .max_uV = 1800000, 594 .max_uV = 1800000,
523 .apply_uV = true, 595 .apply_uV = true,
@@ -526,8 +598,8 @@ static struct regulator_init_data rx51_vdac = {
526 .valid_ops_mask = REGULATOR_CHANGE_MODE 598 .valid_ops_mask = REGULATOR_CHANGE_MODE
527 | REGULATOR_CHANGE_STATUS, 599 | REGULATOR_CHANGE_STATUS,
528 }, 600 },
529 .num_consumer_supplies = 1, 601 .num_consumer_supplies = ARRAY_SIZE(rx51_vsim_supply),
530 .consumer_supplies = rx51_vdac_supply, 602 .consumer_supplies = rx51_vsim_supply,
531}; 603};
532 604
533static struct regulator_init_data rx51_vio = { 605static struct regulator_init_data rx51_vio = {
@@ -544,6 +616,43 @@ static struct regulator_init_data rx51_vio = {
544 .consumer_supplies = rx51_vio_supplies, 616 .consumer_supplies = rx51_vio_supplies,
545}; 617};
546 618
619static struct regulator_init_data rx51_vintana1 = {
620 .constraints = {
621 .name = "VINTANA1",
622 .min_uV = 1500000,
623 .max_uV = 1500000,
624 .always_on = true,
625 .valid_modes_mask = REGULATOR_MODE_NORMAL
626 | REGULATOR_MODE_STANDBY,
627 .valid_ops_mask = REGULATOR_CHANGE_MODE,
628 },
629};
630
631static struct regulator_init_data rx51_vintana2 = {
632 .constraints = {
633 .name = "VINTANA2",
634 .min_uV = 2750000,
635 .max_uV = 2750000,
636 .apply_uV = true,
637 .always_on = true,
638 .valid_modes_mask = REGULATOR_MODE_NORMAL
639 | REGULATOR_MODE_STANDBY,
640 .valid_ops_mask = REGULATOR_CHANGE_MODE,
641 },
642};
643
644static struct regulator_init_data rx51_vintdig = {
645 .constraints = {
646 .name = "VINTDIG",
647 .min_uV = 1500000,
648 .max_uV = 1500000,
649 .always_on = true,
650 .valid_modes_mask = REGULATOR_MODE_NORMAL
651 | REGULATOR_MODE_STANDBY,
652 .valid_ops_mask = REGULATOR_CHANGE_MODE,
653 },
654};
655
547static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { 656static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
548 .gpio_reset = RX51_FMTX_RESET_GPIO, 657 .gpio_reset = RX51_FMTX_RESET_GPIO,
549}; 658};
@@ -600,10 +709,6 @@ static struct twl4030_gpio_platform_data rx51_gpio_data = {
600 .setup = rx51_twlgpio_setup, 709 .setup = rx51_twlgpio_setup,
601}; 710};
602 711
603static struct twl4030_usb_data rx51_usb_data = {
604 .usb_mode = T2_USB_MODE_ULPI,
605};
606
607static struct twl4030_ins sleep_on_seq[] __initdata = { 712static struct twl4030_ins sleep_on_seq[] __initdata = {
608/* 713/*
609 * Turn off everything 714 * Turn off everything
@@ -765,33 +870,32 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
765 .resource_config = twl4030_rconfig, 870 .resource_config = twl4030_rconfig,
766}; 871};
767 872
768struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { 873struct twl4030_vibra_data rx51_vibra_data __initdata = {
769 .coexist = 0, 874 .coexist = 0,
770}; 875};
771 876
772struct twl4030_codec_data rx51_codec_data __initdata = { 877struct twl4030_audio_data rx51_audio_data __initdata = {
773 .audio_mclk = 26000000, 878 .audio_mclk = 26000000,
774 .vibra = &rx51_vibra_data, 879 .vibra = &rx51_vibra_data,
775}; 880};
776 881
777static struct twl4030_platform_data rx51_twldata __initdata = { 882static struct twl4030_platform_data rx51_twldata __initdata = {
778 .irq_base = TWL4030_IRQ_BASE,
779 .irq_end = TWL4030_IRQ_END,
780
781 /* platform_data for children goes here */ 883 /* platform_data for children goes here */
782 .gpio = &rx51_gpio_data, 884 .gpio = &rx51_gpio_data,
783 .keypad = &rx51_kp_data, 885 .keypad = &rx51_kp_data,
784 .madc = &rx51_madc_data,
785 .usb = &rx51_usb_data,
786 .power = &rx51_t2scripts_data, 886 .power = &rx51_t2scripts_data,
787 .codec = &rx51_codec_data, 887 .audio = &rx51_audio_data,
788 888
789 .vaux1 = &rx51_vaux1, 889 .vaux1 = &rx51_vaux1,
790 .vaux2 = &rx51_vaux2, 890 .vaux2 = &rx51_vaux2,
791 .vaux4 = &rx51_vaux4, 891 .vaux4 = &rx51_vaux4,
792 .vmmc1 = &rx51_vmmc1, 892 .vmmc1 = &rx51_vmmc1,
893 .vpll1 = &rx51_vpll1,
894 .vpll2 = &rx51_vpll2,
793 .vsim = &rx51_vsim, 895 .vsim = &rx51_vsim,
794 .vdac = &rx51_vdac, 896 .vintana1 = &rx51_vintana1,
897 .vintana2 = &rx51_vintana2,
898 .vintdig = &rx51_vintdig,
795 .vio = &rx51_vio, 899 .vio = &rx51_vio,
796}; 900};
797 901
@@ -830,6 +934,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
830 .platform_data = &rx51_tsl2563_platform_data, 934 .platform_data = &rx51_tsl2563_platform_data,
831 }, 935 },
832#endif 936#endif
937#if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
938 {
939 I2C_BOARD_INFO("lp5523", 0x32),
940 .platform_data = &rx51_lp5523_platform_data,
941 },
942#endif
833 { 943 {
834 I2C_BOARD_INFO("tpa6130a2", 0x60), 944 I2C_BOARD_INFO("tpa6130a2", 0x60),
835 .platform_data = &rx51_tpa6130a2_data, 945 .platform_data = &rx51_tpa6130a2_data,
@@ -847,6 +957,13 @@ static int __init rx51_i2c_init(void)
847 rx51_twldata.vaux3 = &rx51_vaux3_cam; 957 rx51_twldata.vaux3 = &rx51_vaux3_cam;
848 } 958 }
849 rx51_twldata.vmmc2 = &rx51_vmmc2; 959 rx51_twldata.vmmc2 = &rx51_vmmc2;
960 omap3_pmic_get_config(&rx51_twldata,
961 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC,
962 TWL_COMMON_REGULATOR_VDAC);
963
964 rx51_twldata.vdac->constraints.apply_uV = true;
965 rx51_twldata.vdac->constraints.name = "VDAC";
966
850 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 967 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
851 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 968 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
852 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 969 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
@@ -973,6 +1090,7 @@ error:
973void __init rx51_peripherals_init(void) 1090void __init rx51_peripherals_init(void)
974{ 1091{
975 rx51_i2c_init(); 1092 rx51_i2c_init();
1093 regulator_has_full_constraints();
976 gpmc_onenand_init(board_onenand_data); 1094 gpmc_onenand_init(board_onenand_data);
977 board_smc91x_init(); 1095 board_smc91x_init();
978 rx51_add_gpio_keys(); 1096 rx51_add_gpio_keys();