diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 147 |
1 files changed, 144 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index bdb24db3600..5a886cd2c59 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) | ||
77 | static 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 | |||
108 | static int rx51_lp5523_setup(void) | ||
109 | { | ||
110 | return gpio_request_one(RX51_LP5523_CHIP_EN_GPIO, GPIOF_DIR_OUT, | ||
111 | "lp5523_enable"); | ||
112 | } | ||
113 | |||
114 | static void rx51_lp5523_release(void) | ||
115 | { | ||
116 | gpio_free(RX51_LP5523_CHIP_EN_GPIO); | ||
117 | } | ||
118 | |||
119 | static void rx51_lp5523_enable(bool state) | ||
120 | { | ||
121 | gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state); | ||
122 | } | ||
123 | |||
124 | static 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 | |||
74 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { | 134 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { |
75 | .turbo_mode = 0, | 135 | .turbo_mode = 0, |
76 | .single_channel = 1, | 136 | .single_channel = 1, |
@@ -358,6 +418,10 @@ static struct regulator_consumer_supply rx51_vmmc1_supply[] = { | |||
358 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | 418 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
359 | }; | 419 | }; |
360 | 420 | ||
421 | static struct regulator_consumer_supply rx51_vaux2_supply[] = { | ||
422 | REGULATOR_SUPPLY("vdds_csib", "omap3isp"), | ||
423 | }; | ||
424 | |||
361 | static struct regulator_consumer_supply rx51_vaux3_supply[] = { | 425 | static struct regulator_consumer_supply rx51_vaux3_supply[] = { |
362 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), | 426 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
363 | }; | 427 | }; |
@@ -419,6 +483,8 @@ static struct regulator_init_data rx51_vaux2 = { | |||
419 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 483 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
420 | | REGULATOR_CHANGE_STATUS, | 484 | | REGULATOR_CHANGE_STATUS, |
421 | }, | 485 | }, |
486 | .num_consumer_supplies = ARRAY_SIZE(rx51_vaux2_supply), | ||
487 | .consumer_supplies = rx51_vaux2_supply, | ||
422 | }; | 488 | }; |
423 | 489 | ||
424 | /* VAUX3 - adds more power to VIO_18 rail */ | 490 | /* VAUX3 - adds more power to VIO_18 rail */ |
@@ -495,6 +561,32 @@ static struct regulator_init_data rx51_vmmc2 = { | |||
495 | .consumer_supplies = rx51_vmmc2_supplies, | 561 | .consumer_supplies = rx51_vmmc2_supplies, |
496 | }; | 562 | }; |
497 | 563 | ||
564 | static struct regulator_init_data rx51_vpll1 = { | ||
565 | .constraints = { | ||
566 | .name = "VPLL", | ||
567 | .min_uV = 1800000, | ||
568 | .max_uV = 1800000, | ||
569 | .apply_uV = true, | ||
570 | .always_on = true, | ||
571 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
572 | | REGULATOR_MODE_STANDBY, | ||
573 | .valid_ops_mask = REGULATOR_CHANGE_MODE, | ||
574 | }, | ||
575 | }; | ||
576 | |||
577 | static struct regulator_init_data rx51_vpll2 = { | ||
578 | .constraints = { | ||
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 | |||
498 | static struct regulator_init_data rx51_vsim = { | 590 | static struct regulator_init_data rx51_vsim = { |
499 | .constraints = { | 591 | .constraints = { |
500 | .name = "VMMC2_IO_18", | 592 | .name = "VMMC2_IO_18", |
@@ -524,6 +616,43 @@ static struct regulator_init_data rx51_vio = { | |||
524 | .consumer_supplies = rx51_vio_supplies, | 616 | .consumer_supplies = rx51_vio_supplies, |
525 | }; | 617 | }; |
526 | 618 | ||
619 | static 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 | |||
631 | static 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 | |||
644 | static 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 | |||
527 | static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { | 656 | static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { |
528 | .gpio_reset = RX51_FMTX_RESET_GPIO, | 657 | .gpio_reset = RX51_FMTX_RESET_GPIO, |
529 | }; | 658 | }; |
@@ -741,11 +870,11 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = { | |||
741 | .resource_config = twl4030_rconfig, | 870 | .resource_config = twl4030_rconfig, |
742 | }; | 871 | }; |
743 | 872 | ||
744 | struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { | 873 | struct twl4030_vibra_data rx51_vibra_data __initdata = { |
745 | .coexist = 0, | 874 | .coexist = 0, |
746 | }; | 875 | }; |
747 | 876 | ||
748 | struct twl4030_codec_data rx51_codec_data __initdata = { | 877 | struct twl4030_audio_data rx51_audio_data __initdata = { |
749 | .audio_mclk = 26000000, | 878 | .audio_mclk = 26000000, |
750 | .vibra = &rx51_vibra_data, | 879 | .vibra = &rx51_vibra_data, |
751 | }; | 880 | }; |
@@ -755,13 +884,18 @@ static struct twl4030_platform_data rx51_twldata __initdata = { | |||
755 | .gpio = &rx51_gpio_data, | 884 | .gpio = &rx51_gpio_data, |
756 | .keypad = &rx51_kp_data, | 885 | .keypad = &rx51_kp_data, |
757 | .power = &rx51_t2scripts_data, | 886 | .power = &rx51_t2scripts_data, |
758 | .codec = &rx51_codec_data, | 887 | .audio = &rx51_audio_data, |
759 | 888 | ||
760 | .vaux1 = &rx51_vaux1, | 889 | .vaux1 = &rx51_vaux1, |
761 | .vaux2 = &rx51_vaux2, | 890 | .vaux2 = &rx51_vaux2, |
762 | .vaux4 = &rx51_vaux4, | 891 | .vaux4 = &rx51_vaux4, |
763 | .vmmc1 = &rx51_vmmc1, | 892 | .vmmc1 = &rx51_vmmc1, |
893 | .vpll1 = &rx51_vpll1, | ||
894 | .vpll2 = &rx51_vpll2, | ||
764 | .vsim = &rx51_vsim, | 895 | .vsim = &rx51_vsim, |
896 | .vintana1 = &rx51_vintana1, | ||
897 | .vintana2 = &rx51_vintana2, | ||
898 | .vintdig = &rx51_vintdig, | ||
765 | .vio = &rx51_vio, | 899 | .vio = &rx51_vio, |
766 | }; | 900 | }; |
767 | 901 | ||
@@ -800,6 +934,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { | |||
800 | .platform_data = &rx51_tsl2563_platform_data, | 934 | .platform_data = &rx51_tsl2563_platform_data, |
801 | }, | 935 | }, |
802 | #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 | ||
803 | { | 943 | { |
804 | I2C_BOARD_INFO("tpa6130a2", 0x60), | 944 | I2C_BOARD_INFO("tpa6130a2", 0x60), |
805 | .platform_data = &rx51_tpa6130a2_data, | 945 | .platform_data = &rx51_tpa6130a2_data, |
@@ -950,6 +1090,7 @@ error: | |||
950 | void __init rx51_peripherals_init(void) | 1090 | void __init rx51_peripherals_init(void) |
951 | { | 1091 | { |
952 | rx51_i2c_init(); | 1092 | rx51_i2c_init(); |
1093 | regulator_has_full_constraints(); | ||
953 | gpmc_onenand_init(board_onenand_data); | 1094 | gpmc_onenand_init(board_onenand_data); |
954 | board_smc91x_init(); | 1095 | board_smc91x_init(); |
955 | rx51_add_gpio_keys(); | 1096 | rx51_add_gpio_keys(); |