Skip to content

Commit

Permalink
usb: dwc3: gadget: make DWC3_EP_WEDGE do the right thing
Browse files Browse the repository at this point in the history
This makes DWC3_EP_WEDGE do the right thing, which is
prevent DWC3_EP_WEDGE from ever being cleared by a
ClearFeature(HALT) command.

[ balbi@ti.com : allowed set_wedge to send SetHalt command
	to controller ]

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Paul Zimmerman authored and Greg Kroah-Hartman committed Oct 4, 2011
1 parent 82828ca commit 5275455
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
else
dep->flags |= DWC3_EP_STALL;
} else {
if (dep->flags & DWC3_EP_WEDGE)
return 0;

ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
DWC3_DEPCMD_CLEARSTALL, &params);
if (ret)
Expand All @@ -903,6 +906,7 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
else
dep->flags &= ~DWC3_EP_STALL;
}

return ret;
}

Expand Down Expand Up @@ -936,7 +940,7 @@ static int dwc3_gadget_ep_set_wedge(struct usb_ep *ep)

dep->flags |= DWC3_EP_WEDGE;

return usb_ep_set_halt(ep);
return dwc3_gadget_ep_set_halt(ep, 1);
}

/* -------------------------------------------------------------------------- */
Expand Down

0 comments on commit 5275455

Please sign in to comment.