UDC_CTRL_REG = UDC_RESET_EP; 
UDC_CTRL_REG = ep->udc->clr_halt; 
static int omap_ep_set_halt(struct usb_ep *_ep, int value){	struct omap_ep	*ep = container_of(_ep, struct omap_ep, ep);	unsigned long	flags;	int		status = -EOPNOTSUPP;	spin_lock_irqsave(&ep->udc->lock, flags);	/* just use protocol stalls for ep0; real halts are annoying */	if (ep->bEndpointAddress == 0) {		if (!ep->udc->ep0_pending)			status = -EINVAL;		else if (value) {			if (ep->udc->ep0_set_config) {				WARN("error changing config?\n");				UDC_SYSCON2_REG = UDC_CLR_CFG;			}			UDC_SYSCON2_REG = UDC_STALL_CMD;			ep->udc->ep0_pending = 0;			status = 0;		} else /* NOP */			status = 0;	/* otherwise, all active non-ISO endpoints can halt */	} else if (ep->bmAttributes != USB_ENDPOINT_XFER_ISOC && ep->desc) {		/* IN endpoints must already be idle */		if ((ep->bEndpointAddress & USB_DIR_IN)				&& !list_empty(&ep->queue)) { 			status = -EAGAIN;			goto done;		}		if (value) {			int	channel;			if (use_dma && ep->dma_channel					&& !list_empty(&ep->queue)) {				channel = ep->dma_channel;				dma_channel_release(ep);			} else				channel = 0;			use_ep(ep, UDC_EP_SEL);			if (UDC_STAT_FLG_REG & UDC_NON_ISO_FIFO_EMPTY) {				UDC_CTRL_REG = UDC_SET_HALT;				status = 0;			} else				status = -EAGAIN;			deselect_ep();			if (channel)				dma_channel_claim(ep, channel);		} else {			use_ep(ep, 0);			UDC_CTRL_REG = UDC_RESET_EP;			ep->ackwait = 0;			if (!(ep->bEndpointAddress & USB_DIR_IN)) {				UDC_CTRL_REG = UDC_SET_FIFO_EN;				ep->ackwait = 1 + ep->double_buf;			}		}	}done:	VDBG("%s %s halt stat %d\n", ep->ep.name,		value ? "set" : "clear", status);	spin_unlock_irqrestore(&ep->udc->lock, flags);	return status;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/65111084c63d7674dc37833e8eb59cfdaa4d0bda/omap_udc.c/clean/drivers/usb/gadget/omap_udc.c