mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
usb: dwc2: gadget: Corrected interval calculation
Calculate the interval according to the USB 2.0 specification section 9.6.6. Tested-by: John Keeping <john@metanate.com> Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
92d1635d78
commit
142bd33fcd
@ -166,7 +166,7 @@ struct dwc2_hsotg_req;
|
|||||||
* means that it is sending data to the Host.
|
* means that it is sending data to the Host.
|
||||||
* @index: The index for the endpoint registers.
|
* @index: The index for the endpoint registers.
|
||||||
* @mc: Multi Count - number of transactions per microframe
|
* @mc: Multi Count - number of transactions per microframe
|
||||||
* @interval - Interval for periodic endpoints
|
* @interval - Interval for periodic endpoints, in frames or microframes.
|
||||||
* @name: The name array passed to the USB core.
|
* @name: The name array passed to the USB core.
|
||||||
* @halted: Set if the endpoint has been halted.
|
* @halted: Set if the endpoint has been halted.
|
||||||
* @periodic: Set if this is a periodic ep, such as Interrupt
|
* @periodic: Set if this is a periodic ep, such as Interrupt
|
||||||
|
@ -2693,16 +2693,13 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
|
|||||||
hs_ep->periodic = 0;
|
hs_ep->periodic = 0;
|
||||||
hs_ep->halted = 0;
|
hs_ep->halted = 0;
|
||||||
hs_ep->interval = desc->bInterval;
|
hs_ep->interval = desc->bInterval;
|
||||||
hs_ep->has_correct_parity = 0;
|
|
||||||
|
|
||||||
if (hs_ep->interval > 1 && hs_ep->mc > 1)
|
|
||||||
dev_err(hsotg->dev, "MC > 1 when interval is not 1\n");
|
|
||||||
|
|
||||||
switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
|
switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
|
||||||
case USB_ENDPOINT_XFER_ISOC:
|
case USB_ENDPOINT_XFER_ISOC:
|
||||||
epctrl |= DXEPCTL_EPTYPE_ISO;
|
epctrl |= DXEPCTL_EPTYPE_ISO;
|
||||||
epctrl |= DXEPCTL_SETEVENFR;
|
epctrl |= DXEPCTL_SETEVENFR;
|
||||||
hs_ep->isochronous = 1;
|
hs_ep->isochronous = 1;
|
||||||
|
hs_ep->interval = 1 << (desc->bInterval - 1);
|
||||||
if (dir_in)
|
if (dir_in)
|
||||||
hs_ep->periodic = 1;
|
hs_ep->periodic = 1;
|
||||||
break;
|
break;
|
||||||
@ -2715,6 +2712,9 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
|
|||||||
if (dir_in)
|
if (dir_in)
|
||||||
hs_ep->periodic = 1;
|
hs_ep->periodic = 1;
|
||||||
|
|
||||||
|
if (hsotg->gadget.speed == USB_SPEED_HIGH)
|
||||||
|
hs_ep->interval = 1 << (desc->bInterval - 1);
|
||||||
|
|
||||||
epctrl |= DXEPCTL_EPTYPE_INTERRUPT;
|
epctrl |= DXEPCTL_EPTYPE_INTERRUPT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user