summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-17 15:41:05 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-17 15:41:05 +0000
commit649671eae32eb7bb43a9ece0654a78336194b654 (patch)
tree79a3156c47aabc7ee755fa9822159fcdfc522acd /firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
parent0023943439148f4c3bfdab2d437345bd87da5a60 (diff)
downloadrockbox-649671eae32eb7bb43a9ece0654a78336194b654.tar.gz
rockbox-649671eae32eb7bb43a9ece0654a78336194b654.tar.bz2
rockbox-649671eae32eb7bb43a9ece0654a78336194b654.zip
Get interrupt endpoints fully working on Ingenic Jz4740 targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20978 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.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index 31b7098945..59f7ec825f 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -20,6 +20,7 @@
****************************************************************************/
#include "config.h"
+#define LOGF_ENABLE
#include "logf.h"
#include "system.h"
#include "usb_ch9.h"
@@ -76,9 +77,9 @@ static struct usb_endpoint endpoints[] =
{/* buf length sent busy type use_dma wait fifo_addr fifo_size */
{&ep0_rx_buf, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 },
{NULL, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 },
+ {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP1, 64 },
{NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512},
- {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512},
- {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP2, 64 }
+ {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP2, 512}
};
static struct wakeup ep_wkup[TOTAL_EP()];
@@ -436,6 +437,9 @@ static void setup_endpoint(struct usb_endpoint *ep)
if(ep->use_dma)
csrh |= (USB_INCSRH_DMAREQENAB | USB_INCSRH_AUTOSET | USB_INCSRH_DMAREQMODE);
+ if(ep->type == ep_interrupt)
+ csrh |= USB_INCSRH_FRCDATATOG;
+
REG_USB_REG_INMAXP = ep->fifo_size;
REG_USB_REG_INCSR = csr;
REG_USB_REG_INCSRH = csrh;
@@ -860,14 +864,18 @@ int usb_drv_request_endpoint(int type, int dir)
type &= USB_ENDPOINT_XFERTYPE_MASK;
/* There are only 3+2 endpoints, so hardcode this ... */
+ /* Use the endpoint combinations from the Ingenic Linux USB driver */
switch(type)
{
case USB_ENDPOINT_XFER_BULK:
- return (1 | dir);
+ if(dir == USB_DIR_IN)
+ return (2 | USB_DIR_IN);
+ else
+ return (1 | USB_DIR_OUT);
case USB_ENDPOINT_XFER_INT:
if(dir == USB_DIR_IN)
- return (2 | USB_DIR_IN);
+ return (1 | USB_DIR_IN);
default:
return -1;