/* __cdns3_gadget_ep_set_halt Sets stall on selected endpoint Should be called after acquiring spin_lock and selecting ep @ep: endpoint object to set stall on.  */
void __cdns3_gadget_ep_set_halt(struct cdns3_endpoint *priv_ep)
/* __cdns3_gadget_ep_set_halt Sets stall on selected endpoint Should be called after acquiring spin_lock and selecting ep @ep: endpoint object to set stall on.  */
void __cdns3_gadget_ep_set_halt(struct cdns3_endpoint *priv_ep)
{
	struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
	trace_cdns3_halt(priv_ep, 1, 0);
	if (!(priv_ep->flags & EP_STALLED)) {
		u32 ep_sts_reg = readl(&priv_dev->regs->ep_sts);
		if (!(ep_sts_reg & EP_STS_DBUSY))
			cdns3_ep_stall_flush(priv_ep);
		else
			priv_ep->flags |= EP_STALL_PENDING;
	}
}