]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Blackfin: net2272: move pin setup to boards files
authorMike Frysinger <vapier@gentoo.org>
Wed, 4 May 2011 15:20:15 +0000 (11:20 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 23 Jul 2011 05:10:41 +0000 (01:10 -0400)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/mach-bf527/boards/ezkit.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf537/boards/cm_bf537e.c
arch/blackfin/mach-bf537/boards/cm_bf537u.c
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf537/boards/tcm_bf537.c
arch/blackfin/mach-bf561/boards/cm_bf561.c
arch/blackfin/mach-bf561/boards/ezkit.c

index e67ac772066894e18a8acd8512e188f56fba6812..3f967b1c57927eaa2bdcc41e098a0d9d0e02c20b 100644 (file)
@@ -408,6 +408,9 @@ static struct resource net2272_bfin_resources[] = {
                .start = 0x20300000,
                .end = 0x20300000 + 0x100,
                .flags = IORESOURCE_MEM,
+       }, {
+               .start = 1,
+               .flags = IORESOURCE_BUS,
        }, {
                .start = IRQ_PF7,
                .end = IRQ_PF7,
index 43224ef00b8cddff96024a89d791e08cfe39a9db..eccb82036c0c4c5432d78aeabace3a7aadf820e3 100644 (file)
@@ -79,6 +79,9 @@ static struct resource net2272_bfin_resources[] = {
                .start = 0x20300000,
                .end = 0x20300000 + 0x100,
                .flags = IORESOURCE_MEM,
+       }, {
+               .start = 1,
+               .flags = IORESOURCE_BUS,
        }, {
                .start = IRQ_PF10,
                .end = IRQ_PF10,
@@ -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;
 }
index d582b810e7a74b1bf3b0bd0a22946a3910845586..f3ff4207b42967b8e762dfab6c2e98668288d011 100644 (file)
@@ -766,6 +766,24 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
 #endif
 };
 
+static int __init net2272_init(void)
+{
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       int ret;
+
+       ret = gpio_request(GPIO_PG14, "net2272");
+       if (ret)
+               return ret;
+
+       /* Reset USB Chip, PG14 */
+       gpio_direction_output(GPIO_PG14, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PG14, 1);
+#endif
+
+       return 0;
+}
+
 static int __init cm_bf537e_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
@@ -777,6 +795,10 @@ static int __init cm_bf537e_init(void)
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
 #endif
+
+       if (net2272_init())
+               pr_warning("unable to configure net2272; it probably won't work\n");
+
        return 0;
 }
 
index cbb8098604c56834a520fe6885247be4220df3f7..e1b7287084f825f39e6b4e49b87f94006fd5a66e 100644 (file)
@@ -731,6 +731,36 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
 #endif
 };
 
+static int __init net2272_init(void)
+{
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       int ret;
+
+       ret = gpio_request(GPIO_PH15, driver_name);
+       if (ret)
+               return ret;
+
+       ret = gpio_request(GPIO_PH13, "net2272");
+       if (ret) {
+               gpio_free(GPIO_PH15);
+               return ret;
+       }
+
+       /* Set PH15 Low make /AMS2 work properly */
+       gpio_direction_output(GPIO_PH15, 0);
+
+       /* enable CLKBUF output */
+       bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE);
+
+       /* Reset the USB chip */
+       gpio_direction_output(GPIO_PH13, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PH13, 1);
+#endif
+
+       return 0;
+}
+
 static int __init cm_bf537u_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
@@ -742,6 +772,10 @@ static int __init cm_bf537u_init(void)
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
 #endif
+
+       if (net2272_init())
+               pr_warning("unable to configure net2272; it probably won't work\n");
+
        return 0;
 }
 
index 76db1d4831739027e32b38c4e8f5fc7762672b7f..3d166e362135b4feb0f9fc318793ef6d89ef309d 100644 (file)
@@ -366,6 +366,9 @@ static struct resource net2272_bfin_resources[] = {
                .start = 0x20300000,
                .end = 0x20300000 + 0x100,
                .flags = IORESOURCE_MEM,
+       }, {
+               .start = 1,
+               .flags = IORESOURCE_BUS,
        }, {
                .start = IRQ_PF7,
                .end = IRQ_PF7,
@@ -2916,6 +2919,24 @@ 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;
+
+       ret = gpio_request(GPIO_PF6, "net2272");
+       if (ret)
+               return ret;
+
+       /* Reset the USB chip */
+       gpio_direction_output(GPIO_PF6, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PF6, 1);
+#endif
+
+       return 0;
+}
+
 static int __init stamp_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
@@ -2926,6 +2947,9 @@ static int __init stamp_init(void)
                                ARRAY_SIZE(bfin_i2c_board_info));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
+       if (net2272_init())
+               pr_warning("unable to configure net2272; it probably won't work\n");
+
        return 0;
 }
 
index 164a7e02c022ccdb2971899682d89653c94e3a15..6d4c1caaa9450f95d6675467e6d22ccd8a37c808 100644 (file)
@@ -733,6 +733,24 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
 #endif
 };
 
+static int __init net2272_init(void)
+{
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       int ret;
+
+       ret = gpio_request(GPIO_PG14, "net2272");
+       if (ret)
+               return ret;
+
+       /* Reset USB Chip, PG14 */
+       gpio_direction_output(GPIO_PG14, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PG14, 1);
+#endif
+
+       return 0;
+}
+
 static int __init tcm_bf537_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
@@ -744,6 +762,10 @@ static int __init tcm_bf537_init(void)
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
 #endif
+
+       if (net2272_init())
+               pr_warning("unable to configure net2272; it probably won't work\n");
+
        return 0;
 }
 
index 87595cd38afe1edc0c0ac9bd2f366f21389187c3..2e481362065bcef1e0dff54ebc9f5234f8104018 100644 (file)
@@ -532,6 +532,24 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
 #endif
 };
 
+static int __init net2272_init(void)
+{
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       int ret;
+
+       ret = gpio_request(GPIO_PF46, "net2272");
+       if (ret)
+               return ret;
+
+       /* Reset USB Chip, PF46 */
+       gpio_direction_output(GPIO_PF46, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PF46, 1);
+#endif
+
+       return 0;
+}
+
 static int __init cm_bf561_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
@@ -543,6 +561,10 @@ static int __init cm_bf561_init(void)
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
 #endif
+
+       if (net2272_init())
+               pr_warning("unable to configure net2272; it probably won't work\n");
+
        return 0;
 }
 
index 5067984a62e78f669d4fbe99cc5eb0d62f251b4a..ba81498587145520af9ff08f4c79c10349283800 100644 (file)
@@ -107,6 +107,9 @@ static struct resource net2272_bfin_resources[] = {
                .start = 0x2C000000,
                .end = 0x2C000000 + 0x7F,
                .flags = IORESOURCE_MEM,
+       }, {
+               .start = 1,
+               .flags = IORESOURCE_BUS,
        }, {
                .start = IRQ_PF10,
                .end = IRQ_PF10,
@@ -516,6 +519,24 @@ static struct platform_device *ezkit_devices[] __initdata = {
 #endif
 };
 
+static int __init net2272_init(void)
+{
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       int ret;
+
+       ret = gpio_request(GPIO_PF11, "net2272");
+       if (ret)
+               return ret;
+
+       /* Reset the USB chip */
+       gpio_direction_output(GPIO_PF11, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PF11, 1);
+#endif
+
+       return 0;
+}
+
 static int __init ezkit_init(void)
 {
        int ret;
@@ -542,6 +563,9 @@ static int __init ezkit_init(void)
        udelay(400);
 #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;
 }