RK3288 USB触摸屏与USB摄像头同时使用时触摸卡顿
CPU:RK3288
系统:Android 5.1
当USB触摸屏与USB摄像头同时使用时,有时会出现触摸卡顿,看似按键按下没有弹起。
getevent 查看触摸屏上报,只有 DOWN,没有 UP,正常情况下是 DOWN 与 UP 成对出现。
出现此现象时,打下面补丁即可解决。
diff --git a/kernel/drivers/usb/dwc_otg_310/common_port/dwc_list.h b/kernel/drivers/usb/dwc_otg_310/common_port/dwc_list.h index 46f1da3..62e00c5 100755 --- a/kernel/drivers/usb/dwc_otg_310/common_port/dwc_list.h +++ b/kernel/drivers/usb/dwc_otg_310/common_port/dwc_list.h @@ -565,6 +565,18 @@ struct { \ (head)->cqh_last = (elm); \ } while (0) +#define DWC_CIRCLEQ_INSERT_COM(head, listelm, elm, field, com) do { \ + DWC_CIRCLEQ_FOREACH(listelm, head, field) { \ + if ((elm)->com < (listelm)->com) { \ + DWC_CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field); \ + break; \ + } else \ + continue; \ + } \ + if (DWC_CIRCLEQ_PREV(listelm, field) != elm) \ + DWC_CIRCLEQ_INSERT_TAIL(head, elm, field); \ +} while (0) + #define DWC_CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == DWC_CIRCLEQ_END(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ diff --git a/kernel/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c b/kernel/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c index 0e05b13..a1a067f 100755 --- a/kernel/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c +++ b/kernel/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c @@ -833,6 +833,7 @@ static void release_channel(dwc_otg_hcd_t *hcd, dwc_otg_transaction_type_e tr_type; int free_qtd; int continue_trans = 1; + dwc_hc_t *hc_tmp = NULL; DWC_DEBUGPL(DBG_HCDV, " %s: channel %d, halt_status %d\n", __func__, hc->hc_num, halt_status); @@ -893,7 +894,7 @@ cleanup: * there's no need to clear the Channel Halted interrupt separately. */ dwc_otg_hc_cleanup(hcd->core_if, hc); - DWC_CIRCLEQ_INSERT_TAIL(&hcd->free_hc_list, hc, hc_list_entry); + DWC_CIRCLEQ_INSERT_COM(&hcd->free_hc_list, hc_tmp, hc, hc_list_entry, hc_num); switch (hc->ep_type) { case DWC_OTG_EP_TYPE_CONTROL: