diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-05-04 11:20:15 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-07-23 01:10:41 -0400 |
commit | 9be8631b8a7d11fa6d206fcf0a7a2005ed39f41b (patch) | |
tree | 21edc430dd9f98105f6b97adb76fd9332257d72b /arch/blackfin/mach-bf537 | |
parent | c6cb13f9fef2e401d9fbb0709d088e7c50fe7aea (diff) |
Blackfin: net2272: move pin setup to boards files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf537')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537e.c | 22 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537u.c | 34 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 24 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/tcm_bf537.c | 22 |
4 files changed, 102 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c index d582b810e7a7..f3ff4207b429 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c | |||
@@ -766,6 +766,24 @@ static struct platform_device *cm_bf537e_devices[] __initdata = { | |||
766 | #endif | 766 | #endif |
767 | }; | 767 | }; |
768 | 768 | ||
769 | static int __init net2272_init(void) | ||
770 | { | ||
771 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
772 | int ret; | ||
773 | |||
774 | ret = gpio_request(GPIO_PG14, "net2272"); | ||
775 | if (ret) | ||
776 | return ret; | ||
777 | |||
778 | /* Reset USB Chip, PG14 */ | ||
779 | gpio_direction_output(GPIO_PG14, 0); | ||
780 | mdelay(2); | ||
781 | gpio_set_value(GPIO_PG14, 1); | ||
782 | #endif | ||
783 | |||
784 | return 0; | ||
785 | } | ||
786 | |||
769 | static int __init cm_bf537e_init(void) | 787 | static int __init cm_bf537e_init(void) |
770 | { | 788 | { |
771 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | 789 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
@@ -777,6 +795,10 @@ static int __init cm_bf537e_init(void) | |||
777 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 795 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
778 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); | 796 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); |
779 | #endif | 797 | #endif |
798 | |||
799 | if (net2272_init()) | ||
800 | pr_warning("unable to configure net2272; it probably won't work\n"); | ||
801 | |||
780 | return 0; | 802 | return 0; |
781 | } | 803 | } |
782 | 804 | ||
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c index cbb8098604c5..e1b7287084f8 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c | |||
@@ -731,6 +731,36 @@ static struct platform_device *cm_bf537u_devices[] __initdata = { | |||
731 | #endif | 731 | #endif |
732 | }; | 732 | }; |
733 | 733 | ||
734 | static int __init net2272_init(void) | ||
735 | { | ||
736 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
737 | int ret; | ||
738 | |||
739 | ret = gpio_request(GPIO_PH15, driver_name); | ||
740 | if (ret) | ||
741 | return ret; | ||
742 | |||
743 | ret = gpio_request(GPIO_PH13, "net2272"); | ||
744 | if (ret) { | ||
745 | gpio_free(GPIO_PH15); | ||
746 | return ret; | ||
747 | } | ||
748 | |||
749 | /* Set PH15 Low make /AMS2 work properly */ | ||
750 | gpio_direction_output(GPIO_PH15, 0); | ||
751 | |||
752 | /* enable CLKBUF output */ | ||
753 | bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE); | ||
754 | |||
755 | /* Reset the USB chip */ | ||
756 | gpio_direction_output(GPIO_PH13, 0); | ||
757 | mdelay(2); | ||
758 | gpio_set_value(GPIO_PH13, 1); | ||
759 | #endif | ||
760 | |||
761 | return 0; | ||
762 | } | ||
763 | |||
734 | static int __init cm_bf537u_init(void) | 764 | static int __init cm_bf537u_init(void) |
735 | { | 765 | { |
736 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | 766 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
@@ -742,6 +772,10 @@ static int __init cm_bf537u_init(void) | |||
742 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 772 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
743 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); | 773 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); |
744 | #endif | 774 | #endif |
775 | |||
776 | if (net2272_init()) | ||
777 | pr_warning("unable to configure net2272; it probably won't work\n"); | ||
778 | |||
745 | return 0; | 779 | return 0; |
746 | } | 780 | } |
747 | 781 | ||
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 76db1d483173..3d166e362135 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -367,6 +367,9 @@ static struct resource net2272_bfin_resources[] = { | |||
367 | .end = 0x20300000 + 0x100, | 367 | .end = 0x20300000 + 0x100, |
368 | .flags = IORESOURCE_MEM, | 368 | .flags = IORESOURCE_MEM, |
369 | }, { | 369 | }, { |
370 | .start = 1, | ||
371 | .flags = IORESOURCE_BUS, | ||
372 | }, { | ||
370 | .start = IRQ_PF7, | 373 | .start = IRQ_PF7, |
371 | .end = IRQ_PF7, | 374 | .end = IRQ_PF7, |
372 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 375 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
@@ -2916,6 +2919,24 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
2916 | #endif | 2919 | #endif |
2917 | }; | 2920 | }; |
2918 | 2921 | ||
2922 | static int __init net2272_init(void) | ||
2923 | { | ||
2924 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
2925 | int ret; | ||
2926 | |||
2927 | ret = gpio_request(GPIO_PF6, "net2272"); | ||
2928 | if (ret) | ||
2929 | return ret; | ||
2930 | |||
2931 | /* Reset the USB chip */ | ||
2932 | gpio_direction_output(GPIO_PF6, 0); | ||
2933 | mdelay(2); | ||
2934 | gpio_set_value(GPIO_PF6, 1); | ||
2935 | #endif | ||
2936 | |||
2937 | return 0; | ||
2938 | } | ||
2939 | |||
2919 | static int __init stamp_init(void) | 2940 | static int __init stamp_init(void) |
2920 | { | 2941 | { |
2921 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | 2942 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
@@ -2926,6 +2947,9 @@ static int __init stamp_init(void) | |||
2926 | ARRAY_SIZE(bfin_i2c_board_info)); | 2947 | ARRAY_SIZE(bfin_i2c_board_info)); |
2927 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 2948 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
2928 | 2949 | ||
2950 | if (net2272_init()) | ||
2951 | pr_warning("unable to configure net2272; it probably won't work\n"); | ||
2952 | |||
2929 | return 0; | 2953 | return 0; |
2930 | } | 2954 | } |
2931 | 2955 | ||
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 164a7e02c022..6d4c1caaa945 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
@@ -733,6 +733,24 @@ static struct platform_device *cm_bf537_devices[] __initdata = { | |||
733 | #endif | 733 | #endif |
734 | }; | 734 | }; |
735 | 735 | ||
736 | static int __init net2272_init(void) | ||
737 | { | ||
738 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
739 | int ret; | ||
740 | |||
741 | ret = gpio_request(GPIO_PG14, "net2272"); | ||
742 | if (ret) | ||
743 | return ret; | ||
744 | |||
745 | /* Reset USB Chip, PG14 */ | ||
746 | gpio_direction_output(GPIO_PG14, 0); | ||
747 | mdelay(2); | ||
748 | gpio_set_value(GPIO_PG14, 1); | ||
749 | #endif | ||
750 | |||
751 | return 0; | ||
752 | } | ||
753 | |||
736 | static int __init tcm_bf537_init(void) | 754 | static int __init tcm_bf537_init(void) |
737 | { | 755 | { |
738 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | 756 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
@@ -744,6 +762,10 @@ static int __init tcm_bf537_init(void) | |||
744 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 762 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
745 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); | 763 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); |
746 | #endif | 764 | #endif |
765 | |||
766 | if (net2272_init()) | ||
767 | pr_warning("unable to configure net2272; it probably won't work\n"); | ||
768 | |||
747 | return 0; | 769 | return 0; |
748 | } | 770 | } |
749 | 771 | ||