diff options
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/usb-jz4740.c | 25 |
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) | |||
854 | 854 | ||
855 | int usb_drv_request_endpoint(int type, int dir) | 855 | int usb_drv_request_endpoint(int type, int dir) |
856 | { | 856 | { |
857 | logf("usb_drv_request_endpoint(%s)", (dir == USB_DIR_IN) ? "IN" : "OUT"); | 857 | logf("usb_drv_request_endpoint(%d, %s)", type, (dir == USB_DIR_IN) ? "IN" : "OUT"); |
858 | 858 | ||
859 | if (type != USB_ENDPOINT_XFER_BULK) | 859 | dir &= USB_ENDPOINT_DIR_MASK; |
860 | return -1; | 860 | type &= USB_ENDPOINT_XFERTYPE_MASK; |
861 | 861 | ||
862 | /* There are only 3+2 endpoints, so hardcode this ... */ | 862 | /* There are only 3+2 endpoints, so hardcode this ... */ |
863 | /* Currently only BULK endpoints ... */ | 863 | switch(type) |
864 | if(dir == USB_DIR_OUT) | 864 | { |
865 | return (1 | USB_DIR_OUT); | 865 | case USB_ENDPOINT_XFER_BULK: |
866 | else if(dir == USB_DIR_IN) | 866 | return (1 | dir); |
867 | return (1 | USB_DIR_IN); | 867 | |
868 | else | 868 | case USB_ENDPOINT_XFER_INT: |
869 | return -1; | 869 | if(dir == USB_DIR_IN) |
870 | return (2 | USB_DIR_IN); | ||
871 | |||
872 | default: | ||
873 | return -1; | ||
874 | } | ||
870 | } | 875 | } |