Skip to content

Commit

Permalink
usb: dwc2: host: implement test mode
Browse files Browse the repository at this point in the history
Add support for SetPortFeature(PORT_TEST) for root port.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Jingwu Lin <jingwu.lin@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Jingwu Lin authored and Felipe Balbi committed Apr 29, 2015
1 parent db62b9a commit 96d480e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/usb/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,15 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
/* Not supported */
break;

case USB_PORT_FEAT_TEST:
hprt0 = dwc2_read_hprt0(hsotg);
dev_dbg(hsotg->dev,
"SetPortFeature - USB_PORT_FEAT_TEST\n");
hprt0 &= ~HPRT0_TSTCTL_MASK;
hprt0 |= (windex >> 8) << HPRT0_TSTCTL_SHIFT;
writel(hprt0, hsotg->regs + HPRT0);
break;

default:
retval = -EINVAL;
dev_err(hsotg->dev,
Expand Down

0 comments on commit 96d480e

Please sign in to comment.