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.c194
1 files changed, 153 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..cc503aa89c5e 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,17 @@ 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_vaux3_supply[] = {
365 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); 422 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
423};
366 424
367static struct regulator_consumer_supply rx51_vsim_supply = 425static struct regulator_consumer_supply rx51_vsim_supply[] = {
368 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); 426 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"),
427};
369 428
370static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { 429static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
371 /* tlv320aic3x analog supplies */ 430 /* tlv320aic3x analog supplies */
@@ -395,10 +454,6 @@ static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
395 REGULATOR_SUPPLY("vdd", "2-0063"), 454 REGULATOR_SUPPLY("vdd", "2-0063"),
396}; 455};
397 456
398static struct regulator_consumer_supply rx51_vdac_supply[] = {
399 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
400};
401
402static struct regulator_init_data rx51_vaux1 = { 457static struct regulator_init_data rx51_vaux1 = {
403 .constraints = { 458 .constraints = {
404 .name = "V28", 459 .name = "V28",
@@ -452,8 +507,8 @@ static struct regulator_init_data rx51_vaux3_mmc = {
452 | REGULATOR_CHANGE_MODE 507 | REGULATOR_CHANGE_MODE
453 | REGULATOR_CHANGE_STATUS, 508 | REGULATOR_CHANGE_STATUS,
454 }, 509 },
455 .num_consumer_supplies = 1, 510 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux3_supply),
456 .consumer_supplies = &rx51_vaux3_supply, 511 .consumer_supplies = rx51_vaux3_supply,
457}; 512};
458 513
459static struct regulator_init_data rx51_vaux4 = { 514static struct regulator_init_data rx51_vaux4 = {
@@ -479,8 +534,8 @@ static struct regulator_init_data rx51_vmmc1 = {
479 | REGULATOR_CHANGE_MODE 534 | REGULATOR_CHANGE_MODE
480 | REGULATOR_CHANGE_STATUS, 535 | REGULATOR_CHANGE_STATUS,
481 }, 536 },
482 .num_consumer_supplies = 1, 537 .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc1_supply),
483 .consumer_supplies = &rx51_vmmc1_supply, 538 .consumer_supplies = rx51_vmmc1_supply,
484}; 539};
485 540
486static struct regulator_init_data rx51_vmmc2 = { 541static struct regulator_init_data rx51_vmmc2 = {
@@ -500,24 +555,35 @@ static struct regulator_init_data rx51_vmmc2 = {
500 .consumer_supplies = rx51_vmmc2_supplies, 555 .consumer_supplies = rx51_vmmc2_supplies,
501}; 556};
502 557
503static struct regulator_init_data rx51_vsim = { 558static struct regulator_init_data rx51_vpll1 = {
504 .constraints = { 559 .constraints = {
505 .name = "VMMC2_IO_18", 560 .name = "VPLL",
506 .min_uV = 1800000, 561 .min_uV = 1800000,
507 .max_uV = 1800000, 562 .max_uV = 1800000,
508 .apply_uV = true, 563 .apply_uV = true,
564 .always_on = true,
509 .valid_modes_mask = REGULATOR_MODE_NORMAL 565 .valid_modes_mask = REGULATOR_MODE_NORMAL
510 | REGULATOR_MODE_STANDBY, 566 | REGULATOR_MODE_STANDBY,
511 .valid_ops_mask = REGULATOR_CHANGE_MODE 567 .valid_ops_mask = REGULATOR_CHANGE_MODE,
512 | REGULATOR_CHANGE_STATUS, 568 },
569};
570
571static struct regulator_init_data rx51_vpll2 = {
572 .constraints = {
573 .name = "VSDI_CSI",
574 .min_uV = 1800000,
575 .max_uV = 1800000,
576 .apply_uV = true,
577 .always_on = true,
578 .valid_modes_mask = REGULATOR_MODE_NORMAL
579 | REGULATOR_MODE_STANDBY,
580 .valid_ops_mask = REGULATOR_CHANGE_MODE,
513 }, 581 },
514 .num_consumer_supplies = 1,
515 .consumer_supplies = &rx51_vsim_supply,
516}; 582};
517 583
518static struct regulator_init_data rx51_vdac = { 584static struct regulator_init_data rx51_vsim = {
519 .constraints = { 585 .constraints = {
520 .name = "VDAC", 586 .name = "VMMC2_IO_18",
521 .min_uV = 1800000, 587 .min_uV = 1800000,
522 .max_uV = 1800000, 588 .max_uV = 1800000,
523 .apply_uV = true, 589 .apply_uV = true,
@@ -526,8 +592,8 @@ static struct regulator_init_data rx51_vdac = {
526 .valid_ops_mask = REGULATOR_CHANGE_MODE 592 .valid_ops_mask = REGULATOR_CHANGE_MODE
527 | REGULATOR_CHANGE_STATUS, 593 | REGULATOR_CHANGE_STATUS,
528 }, 594 },
529 .num_consumer_supplies = 1, 595 .num_consumer_supplies = ARRAY_SIZE(rx51_vsim_supply),
530 .consumer_supplies = rx51_vdac_supply, 596 .consumer_supplies = rx51_vsim_supply,
531}; 597};
532 598
533static struct regulator_init_data rx51_vio = { 599static struct regulator_init_data rx51_vio = {
@@ -544,6 +610,43 @@ static struct regulator_init_data rx51_vio = {
544 .consumer_supplies = rx51_vio_supplies, 610 .consumer_supplies = rx51_vio_supplies,
545}; 611};
546 612
613static struct regulator_init_data rx51_vintana1 = {
614 .constraints = {
615 .name = "VINTANA1",
616 .min_uV = 1500000,
617 .max_uV = 1500000,
618 .always_on = true,
619 .valid_modes_mask = REGULATOR_MODE_NORMAL
620 | REGULATOR_MODE_STANDBY,
621 .valid_ops_mask = REGULATOR_CHANGE_MODE,
622 },
623};
624
625static struct regulator_init_data rx51_vintana2 = {
626 .constraints = {
627 .name = "VINTANA2",
628 .min_uV = 2750000,
629 .max_uV = 2750000,
630 .apply_uV = true,
631 .always_on = true,
632 .valid_modes_mask = REGULATOR_MODE_NORMAL
633 | REGULATOR_MODE_STANDBY,
634 .valid_ops_mask = REGULATOR_CHANGE_MODE,
635 },
636};
637
638static struct regulator_init_data rx51_vintdig = {
639 .constraints = {
640 .name = "VINTDIG",
641 .min_uV = 1500000,
642 .max_uV = 1500000,
643 .always_on = true,
644 .valid_modes_mask = REGULATOR_MODE_NORMAL
645 | REGULATOR_MODE_STANDBY,
646 .valid_ops_mask = REGULATOR_CHANGE_MODE,
647 },
648};
649
547static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { 650static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
548 .gpio_reset = RX51_FMTX_RESET_GPIO, 651 .gpio_reset = RX51_FMTX_RESET_GPIO,
549}; 652};
@@ -600,10 +703,6 @@ static struct twl4030_gpio_platform_data rx51_gpio_data = {
600 .setup = rx51_twlgpio_setup, 703 .setup = rx51_twlgpio_setup,
601}; 704};
602 705
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 = { 706static struct twl4030_ins sleep_on_seq[] __initdata = {
608/* 707/*
609 * Turn off everything 708 * Turn off everything
@@ -765,33 +864,32 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
765 .resource_config = twl4030_rconfig, 864 .resource_config = twl4030_rconfig,
766}; 865};
767 866
768struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { 867struct twl4030_vibra_data rx51_vibra_data __initdata = {
769 .coexist = 0, 868 .coexist = 0,
770}; 869};
771 870
772struct twl4030_codec_data rx51_codec_data __initdata = { 871struct twl4030_audio_data rx51_audio_data __initdata = {
773 .audio_mclk = 26000000, 872 .audio_mclk = 26000000,
774 .vibra = &rx51_vibra_data, 873 .vibra = &rx51_vibra_data,
775}; 874};
776 875
777static struct twl4030_platform_data rx51_twldata __initdata = { 876static 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 */ 877 /* platform_data for children goes here */
782 .gpio = &rx51_gpio_data, 878 .gpio = &rx51_gpio_data,
783 .keypad = &rx51_kp_data, 879 .keypad = &rx51_kp_data,
784 .madc = &rx51_madc_data,
785 .usb = &rx51_usb_data,
786 .power = &rx51_t2scripts_data, 880 .power = &rx51_t2scripts_data,
787 .codec = &rx51_codec_data, 881 .audio = &rx51_audio_data,
788 882
789 .vaux1 = &rx51_vaux1, 883 .vaux1 = &rx51_vaux1,
790 .vaux2 = &rx51_vaux2, 884 .vaux2 = &rx51_vaux2,
791 .vaux4 = &rx51_vaux4, 885 .vaux4 = &rx51_vaux4,
792 .vmmc1 = &rx51_vmmc1, 886 .vmmc1 = &rx51_vmmc1,
887 .vpll1 = &rx51_vpll1,
888 .vpll2 = &rx51_vpll2,
793 .vsim = &rx51_vsim, 889 .vsim = &rx51_vsim,
794 .vdac = &rx51_vdac, 890 .vintana1 = &rx51_vintana1,
891 .vintana2 = &rx51_vintana2,
892 .vintdig = &rx51_vintdig,
795 .vio = &rx51_vio, 893 .vio = &rx51_vio,
796}; 894};
797 895
@@ -830,6 +928,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
830 .platform_data = &rx51_tsl2563_platform_data, 928 .platform_data = &rx51_tsl2563_platform_data,
831 }, 929 },
832#endif 930#endif
931#if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
932 {
933 I2C_BOARD_INFO("lp5523", 0x32),
934 .platform_data = &rx51_lp5523_platform_data,
935 },
936#endif
833 { 937 {
834 I2C_BOARD_INFO("tpa6130a2", 0x60), 938 I2C_BOARD_INFO("tpa6130a2", 0x60),
835 .platform_data = &rx51_tpa6130a2_data, 939 .platform_data = &rx51_tpa6130a2_data,
@@ -847,6 +951,13 @@ static int __init rx51_i2c_init(void)
847 rx51_twldata.vaux3 = &rx51_vaux3_cam; 951 rx51_twldata.vaux3 = &rx51_vaux3_cam;
848 } 952 }
849 rx51_twldata.vmmc2 = &rx51_vmmc2; 953 rx51_twldata.vmmc2 = &rx51_vmmc2;
954 omap3_pmic_get_config(&rx51_twldata,
955 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC,
956 TWL_COMMON_REGULATOR_VDAC);
957
958 rx51_twldata.vdac->constraints.apply_uV = true;
959 rx51_twldata.vdac->constraints.name = "VDAC";
960
850 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 961 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, 962 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
852 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 963 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
@@ -973,6 +1084,7 @@ error:
973void __init rx51_peripherals_init(void) 1084void __init rx51_peripherals_init(void)
974{ 1085{
975 rx51_i2c_init(); 1086 rx51_i2c_init();
1087 regulator_has_full_constraints();
976 gpmc_onenand_init(board_onenand_data); 1088 gpmc_onenand_init(board_onenand_data);
977 board_smc91x_init(); 1089 board_smc91x_init();
978 rx51_add_gpio_keys(); 1090 rx51_add_gpio_keys();