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-bf533 | |
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-bf533')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 43224ef00b8c..eccb82036c0c 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -80,6 +80,9 @@ static struct resource net2272_bfin_resources[] = { | |||
80 | .end = 0x20300000 + 0x100, | 80 | .end = 0x20300000 + 0x100, |
81 | .flags = IORESOURCE_MEM, | 81 | .flags = IORESOURCE_MEM, |
82 | }, { | 82 | }, { |
83 | .start = 1, | ||
84 | .flags = IORESOURCE_BUS, | ||
85 | }, { | ||
83 | .start = IRQ_PF10, | 86 | .start = IRQ_PF10, |
84 | .end = IRQ_PF10, | 87 | .end = IRQ_PF10, |
85 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 88 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
@@ -659,6 +662,41 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
659 | #endif | 662 | #endif |
660 | }; | 663 | }; |
661 | 664 | ||
665 | static int __init net2272_init(void) | ||
666 | { | ||
667 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
668 | int ret; | ||
669 | |||
670 | /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */ | ||
671 | ret = gpio_request(GPIO_PF0, "net2272"); | ||
672 | if (ret) | ||
673 | return ret; | ||
674 | |||
675 | ret = gpio_request(GPIO_PF1, "net2272"); | ||
676 | if (ret) { | ||
677 | gpio_free(GPIO_PF0); | ||
678 | return ret; | ||
679 | } | ||
680 | |||
681 | ret = gpio_request(GPIO_PF11, "net2272"); | ||
682 | if (ret) { | ||
683 | gpio_free(GPIO_PF0); | ||
684 | gpio_free(GPIO_PF1); | ||
685 | return ret; | ||
686 | } | ||
687 | |||
688 | gpio_direction_output(GPIO_PF0, 0); | ||
689 | gpio_direction_output(GPIO_PF1, 1); | ||
690 | |||
691 | /* Reset the USB chip */ | ||
692 | gpio_direction_output(GPIO_PF11, 0); | ||
693 | mdelay(2); | ||
694 | gpio_set_value(GPIO_PF11, 1); | ||
695 | #endif | ||
696 | |||
697 | return 0; | ||
698 | } | ||
699 | |||
662 | static int __init stamp_init(void) | 700 | static int __init stamp_init(void) |
663 | { | 701 | { |
664 | int ret; | 702 | int ret; |
@@ -685,6 +723,9 @@ static int __init stamp_init(void) | |||
685 | } | 723 | } |
686 | #endif | 724 | #endif |
687 | 725 | ||
726 | if (net2272_init()) | ||
727 | pr_warning("unable to configure net2272; it probably won't work\n"); | ||
728 | |||
688 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 729 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
689 | return 0; | 730 | return 0; |
690 | } | 731 | } |