summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-16 23:04:54 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-16 23:04:54 +0000
commit03ea24929779fd29ac95cb0bfd8945d269f3733d (patch)
tree507f688e96eae61ff990bee90ef49e042fde72ea /firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
parent98b7da47e1c5c1e2b6b28193521161f99db74455 (diff)
downloadrockbox-03ea24929779fd29ac95cb0bfd8945d269f3733d.tar.gz
rockbox-03ea24929779fd29ac95cb0bfd8945d269f3733d.tar.bz2
rockbox-03ea24929779fd29ac95cb0bfd8945d269f3733d.zip
Try at implementing interrupt endpoints in the Ingenic Jz4740 USB driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20973 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.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index be245ede8c..31b7098945 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -854,17 +854,22 @@ void usb_drv_release_endpoint(int ep)
int usb_drv_request_endpoint(int type, int dir)
{
- logf("usb_drv_request_endpoint(%s)", (dir == USB_DIR_IN) ? "IN" : "OUT");
+ logf("usb_drv_request_endpoint(%d, %s)", type, (dir == USB_DIR_IN) ? "IN" : "OUT");
- if (type != USB_ENDPOINT_XFER_BULK)
- return -1;
+ dir &= USB_ENDPOINT_DIR_MASK;
+ type &= USB_ENDPOINT_XFERTYPE_MASK;
/* There are only 3+2 endpoints, so hardcode this ... */
- /* Currently only BULK endpoints ... */
- if(dir == USB_DIR_OUT)
- return (1 | USB_DIR_OUT);
- else if(dir == USB_DIR_IN)
- return (1 | USB_DIR_IN);
- else
- return -1;
+ switch(type)
+ {
+ case USB_ENDPOINT_XFER_BULK:
+ return (1 | dir);
+
+ case USB_ENDPOINT_XFER_INT:
+ if(dir == USB_DIR_IN)
+ return (2 | USB_DIR_IN);
+
+ default:
+ return -1;
+ }
}