Skip to content

Commit

Permalink
Fix DS3 support on C2. Fixes #54
Browse files Browse the repository at this point in the history
  • Loading branch information
kivutar committed Oct 24, 2017
1 parent 54fbcc1 commit aa68b6e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_queue.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_queue.c
index 3dd3ba7cacb..d809d903450 100644
--- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_queue.c
+++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_queue.c
@@ -367,13 +367,13 @@ static int check_periodic_bandwidth(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh)
* Max periodic usecs is 80% x 125 usec = 100 usec.
*/

- max_claimed_usecs = 100 - qh->usecs;
+ max_claimed_usecs = 125 - qh->usecs;
else
/*
* Full speed mode.
* Max periodic usecs is 90% x 1000 usec = 900 usec.
*/
- max_claimed_usecs = 900 - qh->usecs;
+ max_claimed_usecs = 1000 - qh->usecs;

if (hcd->periodic_usecs > max_claimed_usecs) {
DWC_INFO("%s: already claimed usecs %d, required usecs %d\n", __func__, hcd->periodic_usecs, qh->usecs);
@@ -724,4 +724,4 @@ int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t *qtd,
return retval;
}

-#endif /* DWC_DEVICE_ONLY */
\ No newline at end of file
+#endif /* DWC_DEVICE_ONLY */
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_intr.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_intr.c
index c888d0aa474..27c06935918 100644
--- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_intr.c
+++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_intr.c
@@ -1302,7 +1302,7 @@ static int32_t handle_hc_nak_intr(dwc_otg_hcd_t *hcd,
hcd->ssplit_lock = 0;

qtd->complete_split = 0;
- if (qtd->error_count > 200) {
+ if (qtd->error_count > 20000) {
DWC_ERROR("Can not read device info from hub.We take it error\n");
halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
} else {

0 comments on commit aa68b6e

Please sign in to comment.