diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-05-04 17:20:15 +0200 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-07-23 07:10:41 +0200 |
commit | 9be8631b8a7d11fa6d206fcf0a7a2005ed39f41b (patch) | |
tree | 21edc430dd9f98105f6b97adb76fd9332257d72b /arch/blackfin/mach-bf533/boards | |
parent | Blackfin: convert to kbuild asm-generic support (diff) | |
download | linux-9be8631b8a7d11fa6d206fcf0a7a2005ed39f41b.tar.xz linux-9be8631b8a7d11fa6d206fcf0a7a2005ed39f41b.zip |
Blackfin: net2272: move pin setup to boards files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf533/boards')
-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[] = { .end = 0x20300000 + 0x100, .flags = IORESOURCE_MEM, }, { + .start = 1, + .flags = IORESOURCE_BUS, + }, { .start = IRQ_PF10, .end = IRQ_PF10, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, @@ -659,6 +662,41 @@ static struct platform_device *stamp_devices[] __initdata = { #endif }; +static int __init net2272_init(void) +{ +#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) + int ret; + + /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */ + ret = gpio_request(GPIO_PF0, "net2272"); + if (ret) + return ret; + + ret = gpio_request(GPIO_PF1, "net2272"); + if (ret) { + gpio_free(GPIO_PF0); + return ret; + } + + ret = gpio_request(GPIO_PF11, "net2272"); + if (ret) { + gpio_free(GPIO_PF0); + gpio_free(GPIO_PF1); + return ret; + } + + gpio_direction_output(GPIO_PF0, 0); + gpio_direction_output(GPIO_PF1, 1); + + /* Reset the USB chip */ + gpio_direction_output(GPIO_PF11, 0); + mdelay(2); + gpio_set_value(GPIO_PF11, 1); +#endif + + return 0; +} + static int __init stamp_init(void) { int ret; @@ -685,6 +723,9 @@ static int __init stamp_init(void) } #endif + if (net2272_init()) + pr_warning("unable to configure net2272; it probably won't work\n"); + spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); return 0; } |