summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-21 12:50:06 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-21 12:50:06 +0000
commitc0b43a5ac2fcda473800b9c9a4036c5348ac5084 (patch)
tree0fdf827d5f65e26da35341c4a67a006e36ca5dc2 /firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
parent0a61b71f73556592af6e1f127a42a27d48564b72 (diff)
downloadrockbox-c0b43a5ac2fcda473800b9c9a4036c5348ac5084.tar.gz
rockbox-c0b43a5ac2fcda473800b9c9a4036c5348ac5084.tar.bz2
rockbox-c0b43a5ac2fcda473800b9c9a4036c5348ac5084.zip
Commit some USB and ATA rework/refactoring (+ USB GPIO detection).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19165 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/usb-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index 7cefdadbe3..f0b4eb4694 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -25,6 +25,7 @@
#include "usb_ch9.h"
#include "usb_drv.h"
#include "usb_core.h"
+#include "usb-target.h"
#include "jz4740.h"
#include "thread.h"
@@ -33,10 +34,6 @@
#define EP1_INTR_BIT 2
#define EP_FIFO_NOEMPTY 2
-#define GPIO_UDC_DETE_PIN (32 * 3 + 6)
-#define GPIO_UDC_DETE GPIO_UDC_DETE_PIN
-#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
-
#define IS_CACHE(x) (x < 0xa0000000)
#define USB_EP0_IDLE 0
@@ -81,7 +78,7 @@ static inline void select_endpoint(int ep)
}
static void readFIFO(struct usb_endpoint *ep, unsigned int size)
-{
+{
unsigned int *d = (unsigned int *)ep->ptr;
unsigned int s;
s = (size + 3) >> 2;
@@ -90,7 +87,7 @@ static void readFIFO(struct usb_endpoint *ep, unsigned int size)
}
static void writeFIFO(struct usb_endpoint *ep, unsigned int size)
-{
+{
unsigned int *d = (unsigned int *)ep->ptr;
unsigned char *c;
int s, q;
@@ -359,7 +356,7 @@ bool usb_drv_connected(void)
int usb_detect(void)
{
- if(__gpio_get_pin(GPIO_UDC_DETE) == 1)
+ if(usb_drv_connected())
return USB_INSERTED;
else
return USB_EXTRACTED;
@@ -367,9 +364,7 @@ int usb_detect(void)
void usb_init_device(void)
{
- system_enable_irq(IRQ_UDC);
- __gpio_as_input(GPIO_UDC_DETE_PIN);
- return;
+ usb_init_gpio();
}
void usb_enable(bool on)
@@ -442,6 +437,40 @@ void usb_drv_set_address(int address)
REG_USB_REG_FADDR = address;
}
+int usb_drv_send(int endpoint, void* ptr, int length)
+{
+ return 0;
+}
+
+int usb_drv_recv(int endpoint, void* ptr, int length)
+{
+ return 0;
+}
+
+void usb_drv_set_test_mode(int mode)
+{
+
+}
+
+int usb_drv_port_speed(void)
+{
+ return ((REG_USB_REG_POWER & USB_POWER_HSMODE) != 0) ? 1 : 0;
+}
+
+void usb_drv_cancel_all_transfers(void)
+{
+ int i;
+ for(i=0; i<5; i++)
+ {
+ endpoints[i].ptr = endpoints[i].buf;
+ endpoints[i].length = 0;
+ }
+}
+
+void usb_drv_release_endpoint(int ep)
+{
+
+}
#else