aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-09-18 21:37:17 -0400
committerShawn Guo <shawnguo@kernel.org>2016-09-20 10:34:57 -0400
commit347aa6c41317157b8f8333d058ca02e156748666 (patch)
tree3edad5b4cd36dc6689ba731bf28665eb11999195 /arch/arm/mach-imx
parent7880dcb25958a80f7afb5dff1b024fd22dfdfde8 (diff)
ARM: imx legacy: pcm037: move peripheral initialization to .init_late
The change moves some of peripheral registrations and initializations (all peripherals dependent on GPIOs) from .init_machine to .init_late level, this allows to safely shift the shared GPIO controller driver initialization level after init level of i.MX IOMUXC driver. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c67
1 files changed, 33 insertions, 34 deletions
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 6d879417db49..d071ced7425d 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -576,8 +576,6 @@ static struct regulator_consumer_supply dummy_supplies[] = {
576 */ 576 */
577static void __init pcm037_init(void) 577static void __init pcm037_init(void)
578{ 578{
579 int ret;
580
581 imx31_soc_init(); 579 imx31_soc_init();
582 580
583 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 581 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
@@ -621,20 +619,6 @@ static void __init pcm037_init(void)
621 619
622 imx31_add_mxc_w1(); 620 imx31_add_mxc_w1();
623 621
624 /* LAN9217 IRQ pin */
625 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq");
626 if (ret)
627 pr_warn("could not get LAN irq gpio\n");
628 else {
629 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
630 smsc911x_resources[1].start =
631 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
632 smsc911x_resources[1].end =
633 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
634 platform_device_register(&pcm037_eth);
635 }
636
637
638 /* I2C adapters and devices */ 622 /* I2C adapters and devices */
639 i2c_register_board_info(1, pcm037_i2c_devices, 623 i2c_register_board_info(1, pcm037_i2c_devices,
640 ARRAY_SIZE(pcm037_i2c_devices)); 624 ARRAY_SIZE(pcm037_i2c_devices));
@@ -643,26 +627,9 @@ static void __init pcm037_init(void)
643 imx31_add_imx_i2c2(&pcm037_i2c2_data); 627 imx31_add_imx_i2c2(&pcm037_i2c2_data);
644 628
645 imx31_add_mxc_nand(&pcm037_nand_board_info); 629 imx31_add_mxc_nand(&pcm037_nand_board_info);
646 imx31_add_mxc_mmc(0, &sdhc_pdata);
647 imx31_add_ipu_core(); 630 imx31_add_ipu_core();
648 imx31_add_mx3_sdc_fb(&mx3fb_pdata); 631 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
649 632
650 /* CSI */
651 /* Camera power: default - off */
652 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
653 if (!ret)
654 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
655 else
656 iclink_mt9t031.power = NULL;
657
658 pcm037_init_camera();
659
660 pcm970_sja1000_resources[1].start =
661 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
662 pcm970_sja1000_resources[1].end =
663 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
664 platform_device_register(&pcm970_sja1000);
665
666 if (otg_mode_host) { 633 if (otg_mode_host) {
667 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | 634 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
668 ULPI_OTG_DRVVBUS_EXT); 635 ULPI_OTG_DRVVBUS_EXT);
@@ -677,7 +644,6 @@ static void __init pcm037_init(void)
677 644
678 if (!otg_mode_host) 645 if (!otg_mode_host)
679 imx31_add_fsl_usb2_udc(&otg_device_pdata); 646 imx31_add_fsl_usb2_udc(&otg_device_pdata);
680
681} 647}
682 648
683static void __init pcm037_timer_init(void) 649static void __init pcm037_timer_init(void)
@@ -694,6 +660,39 @@ static void __init pcm037_reserve(void)
694 660
695static void __init pcm037_init_late(void) 661static void __init pcm037_init_late(void)
696{ 662{
663 int ret;
664
665 /* LAN9217 IRQ pin */
666 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq");
667 if (!ret) {
668 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
669 smsc911x_resources[1].start =
670 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
671 smsc911x_resources[1].end =
672 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
673 platform_device_register(&pcm037_eth);
674 } else {
675 pr_warn("could not get LAN irq gpio\n");
676 }
677
678 imx31_add_mxc_mmc(0, &sdhc_pdata);
679
680 /* CSI */
681 /* Camera power: default - off */
682 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
683 if (!ret)
684 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
685 else
686 iclink_mt9t031.power = NULL;
687
688 pcm037_init_camera();
689
690 pcm970_sja1000_resources[1].start =
691 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
692 pcm970_sja1000_resources[1].end =
693 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
694 platform_device_register(&pcm970_sja1000);
695
697 pcm037_eet_init_devices(); 696 pcm037_eet_init_devices();
698} 697}
699 698