Title: [7223] branches/2009R1/drivers/usb/gadget: added support for more bluetechnix modules to net2272 driver
Revision
7223
Author
bluetechnix
Date
2009-08-21 00:15:16 -0400 (Fri, 21 Aug 2009)

Log Message

added support for more bluetechnix modules to net2272 driver

Modified Paths


Diff

Modified: branches/2009R1/drivers/usb/gadget/net2272.c (7222 => 7223)


--- branches/2009R1/drivers/usb/gadget/net2272.c	2009-08-21 04:05:49 UTC (rev 7222)
+++ branches/2009R1/drivers/usb/gadget/net2272.c	2009-08-21 04:15:16 UTC (rev 7223)
@@ -2439,10 +2439,26 @@
 	gpio_free(GPIO_1);
 #endif
 
-#ifdef CONFIG_BFIN537_BLUETECHNIX_CM
+#ifdef CONFIG_BFIN537_BLUETECHNIX_CM_U
+	/* Set PH15 high */
+	gpio_direction_output(GPIO_47, 1);
 	gpio_free(GPIO_47);
+	/* Free reset line */
+	gpio_free(GPIO_45);
+	/* Disable CLKBUF out */
+	bfin_write_VR_CTL(bfin_read_VR_CTL() & ~CLKBUFOE);
 #endif
 
+#if defined(CONFIG_BFIN537_BLUETECHNIX_TCM) || defined(CONFIG_BFIN537_BLUETECHNIX_CM_E)
+	/* Free reset line */
+	gpio_free(GPIO_30);
+#endif
+
+#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
+	/* Free reset line */
+	gpio_free(GPIO_PF46);
+#endif
+
 	return 0;
 }
 
@@ -2509,16 +2525,52 @@
 	gpio_set_value(GPIO_6, 1);
 #endif
 
-#ifdef CONFIG_BFIN537_BLUETECHNIX_CM /* Set PH15 Low make /AMS2 work properly */
+#ifdef CONFIG_BFIN537_BLUETECHNIX_CM_U
+	/* Set PH15 Low make /AMS2 work properly */
 	if (gpio_request(GPIO_47, driver_name)) {
 		printk(KERN_ERR "net2272: Failed ro request GPIO_%d\n", GPIO_47);
 		return -EBUSY;
 	}
 	gpio_direction_output(GPIO_47, 0);
+	/* enable CLKBUF output */
+	bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE);
+	/* Reset USB Chip */
+	if (gpio_request(GPIO_45, driver_name)) {
+		printk(KERN_ERR "net2272: Failed to request GPIO_%d\n", GPIO_45);
+		return -EBUSY;
+	}
+	gpio_direction_output(GPIO_45, 0);
+	/* Hold it for 2ms */
+	mdelay(2);
+	gpio_set_value(GPIO_45, 1);
 #endif
+
+#if defined(CONFIG_BFIN537_BLUETECHNIX_TCM) || defined(CONFIG_BFIN537_BLUETECHNIX_CM_E)
+	/* Reset USB Chip, PG14 */
+	if (gpio_request(GPIO_30, driver_name)) {
+		printk(KERN_ERR "net2272: Failed to request GPIO_%d\n", GPIO_30);
+		return -EBUSY;
 	}
+	gpio_direction_output(GPIO_30, 0);
+	/* Hold it for 2ms */
+	mdelay(2);
+	gpio_set_value(GPIO_30, 1);
 #endif
 
+#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
+	/* Reset USB Chip, PF46 */
+	if (gpio_request(GPIO_PF46, driver_name)) {
+		printk(KERN_ERR "net2272: Failed to request GPIO_%d\n", GPIO_PF46);
+		return -EBUSY;
+	}
+	gpio_direction_output(GPIO_PF46, 0);
+	/* Hold it for 2ms */
+	mdelay(2);
+	gpio_set_value(GPIO_PF46, 1);
+#endif
+	}
+#endif
+
 	if (!base || !irq) {
 		printk ("must provide base/irq as parameters! %lu %d\n", base, irq);
 		return -EINVAL;

Modified: branches/2009R1/drivers/usb/gadget/net2272.h (7222 => 7223)


--- branches/2009R1/drivers/usb/gadget/net2272.h	2009-08-21 04:05:49 UTC (rev 7222)
+++ branches/2009R1/drivers/usb/gadget/net2272.h	2009-08-21 04:15:16 UTC (rev 7223)
@@ -376,7 +376,7 @@
 #else
         struct platform_device          *pdev;
 #endif
-#if defined(CONFIG_BLACKFIN) && !defined(CONFIG_BFIN537_BLUETECHNIX_CM)
+#if defined(CONFIG_BLACKFIN) && !defined(CONFIG_BFIN537_BLUETECHNIX_CM_U) && !defined(CONFIG_BFIN537_BLUETECHNIX_TCM) && !defined(CONFIG_BFIN561_BLUETECHNIX_CM) && !defined(CONFIG_BFIN537_BLUETECHNIX_CM_E)
 	u32				__iomem *base_addr;
 #else
         u16                             __iomem *base_addr;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to