static void reconfig_usbd(struct dwc2_udc *dev);
static void set_max_pktsize(struct dwc2_udc *dev, enum usb_device_speed speed);
static void nuke(struct dwc2_ep *ep, int status);
-static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
-static void s3c_udc_set_nak(struct dwc2_ep *ep);
+static int dwc2_udc_set_halt(struct usb_ep *_ep, int value);
+static void dwc2_udc_set_nak(struct dwc2_ep *ep);
void set_udc_gadget_private_data(void *p)
{
.queue = s3c_queue,
.dequeue = s3c_dequeue,
- .set_halt = s3c_udc_set_halt,
+ .set_halt = dwc2_udc_set_halt,
.fifo_status = s3c_fifo_status,
.fifo_flush = s3c_fifo_flush,
};
ep->ep.maxpacket = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
/* Reset halt state */
- s3c_udc_set_nak(ep);
- s3c_udc_set_halt(_ep, 0);
+ dwc2_udc_set_nak(ep);
+ dwc2_udc_set_halt(_ep, 0);
spin_lock_irqsave(&ep->dev->lock, flags);
- s3c_udc_ep_activate(ep);
+ dwc2_udc_ep_activate(ep);
spin_unlock_irqrestore(&ep->dev->lock, flags);
debug("%s: enabled %s, stopped = %d, maxpacket = %d\n",
debug("%s: %d\n", __func__, ep_index(ep));
}
-static const struct usb_gadget_ops s3c_udc_ops = {
+static const struct usb_gadget_ops dwc2_udc_ops = {
/* current versions must always be self-powered */
};
static struct dwc2_udc memory = {
.usb_address = 0,
.gadget = {
- .ops = &s3c_udc_ops,
+ .ops = &dwc2_udc_ops,
.ep0 = &memory.ep[0].ep,
.name = driver_name,
},
u32 gintmsk = readl(®->gintmsk);
if (intr_status & gintmsk)
- return s3c_udc_irq(1, (void *)the_controller);
+ return dwc2_udc_irq(1, (void *)the_controller);
return 0;
}
#define GET_MAX_LUN_REQUEST 0xFE
#define BOT_RESET_REQUEST 0xFF
-static inline void s3c_udc_ep0_zlp(struct dwc2_udc *dev)
+static inline void dwc2_udc_ep0_zlp(struct dwc2_udc *dev)
{
u32 ep_ctrl;
dev->ep0state = WAIT_FOR_IN_COMPLETE;
}
-static void s3c_udc_pre_setup(void)
+static void dwc2_udc_pre_setup(void)
{
u32 ep_ctrl;
if (is_short || req->req.actual == req->req.length) {
if (ep_num == EP0_CON && dev->ep0state == DATA_STATE_RECV) {
debug_cond(DEBUG_OUT_EP != 0, " => Send ZLP\n");
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
/* packet will be completed in complete_tx() */
dev->ep0state = WAIT_FOR_IN_COMPLETE;
} else {
}
}
-static inline void s3c_udc_check_tx_queue(struct dwc2_udc *dev, u8 ep_num)
+static inline void dwc2_udc_check_tx_queue(struct dwc2_udc *dev, u8 ep_num)
{
struct dwc2_ep *ep = &dev->ep[ep_num];
struct dwc2_request *req;
dev->ep0state = WAIT_FOR_SETUP;
if (dev->ep0state == WAIT_FOR_SETUP)
- s3c_udc_pre_setup();
+ dwc2_udc_pre_setup();
/* continue transfer after
set_clear_halt for DMA mode */
if (clear_feature_flag == 1) {
- s3c_udc_check_tx_queue(dev,
+ dwc2_udc_check_tx_queue(dev,
clear_feature_num);
clear_feature_flag = 0;
}
complete_rx(dev, ep_num);
else {
dev->ep0state = WAIT_FOR_SETUP;
- s3c_udc_pre_setup();
+ dwc2_udc_pre_setup();
}
}
/*
* usb client interrupt handler.
*/
-static int s3c_udc_irq(int irq, void *_dev)
+static int dwc2_udc_irq(int irq, void *_dev)
{
struct dwc2_udc *dev = _dev;
u32 intr_status;
reconfig_usbd(dev);
dev->ep0state = WAIT_FOR_SETUP;
reset_available = 0;
- s3c_udc_pre_setup();
+ dwc2_udc_pre_setup();
} else
reset_available = 1;
u32 ctrl = readl(®->dcfg);
writel(DEVICE_ADDRESS(address) | ctrl, ®->dcfg);
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
debug_cond(DEBUG_EP0 != 0,
"%s: USB OTG 2.0 Device address=%d, DCFG=0x%x\n",
dev->usb_address = address;
}
-static inline void s3c_udc_ep0_set_stall(struct dwc2_ep *ep)
+static inline void dwc2_udc_ep0_set_stall(struct dwc2_ep *ep)
{
struct dwc2_udc *dev;
u32 ep_ctrl = 0;
*/
dev->ep0state = WAIT_FOR_SETUP;
- s3c_udc_pre_setup();
+ dwc2_udc_pre_setup();
}
static void dwc2_ep0_read(struct dwc2_udc *dev)
* or Bulk-Only mass storge reset */
ep->len = 0;
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
debug_cond(DEBUG_EP0 != 0,
"%s: req.length = 0, bRequest = %d\n",
return 1;
}
-static int s3c_udc_get_status(struct dwc2_udc *dev,
+static int dwc2_udc_get_status(struct dwc2_udc *dev,
struct usb_ctrlrequest *crq)
{
u8 ep_num = crq->wIndex & 0x7F;
return 0;
}
-static void s3c_udc_set_nak(struct dwc2_ep *ep)
+static void dwc2_udc_set_nak(struct dwc2_ep *ep)
{
u8 ep_num;
u32 ep_ctrl = 0;
}
-static void s3c_udc_ep_set_stall(struct dwc2_ep *ep)
+static void dwc2_udc_ep_set_stall(struct dwc2_ep *ep)
{
u8 ep_num;
u32 ep_ctrl = 0;
return;
}
-static void s3c_udc_ep_clear_stall(struct dwc2_ep *ep)
+static void dwc2_udc_ep_clear_stall(struct dwc2_ep *ep)
{
u8 ep_num;
u32 ep_ctrl = 0;
return;
}
-static int s3c_udc_set_halt(struct usb_ep *_ep, int value)
+static int dwc2_udc_set_halt(struct usb_ep *_ep, int value)
{
struct dwc2_ep *ep;
struct dwc2_udc *dev;
if (value == 0) {
ep->stopped = 0;
- s3c_udc_ep_clear_stall(ep);
+ dwc2_udc_ep_clear_stall(ep);
} else {
if (ep_num == 0)
dev->ep0state = WAIT_FOR_SETUP;
ep->stopped = 1;
- s3c_udc_ep_set_stall(ep);
+ dwc2_udc_ep_set_stall(ep);
}
spin_unlock_irqrestore(&dev->lock, flags);
return 0;
}
-static void s3c_udc_ep_activate(struct dwc2_ep *ep)
+static void dwc2_udc_ep_activate(struct dwc2_ep *ep)
{
u8 ep_num;
u32 ep_ctrl = 0, daintmsk = 0;
}
-static int s3c_udc_clear_feature(struct usb_ep *_ep)
+static int dwc2_udc_clear_feature(struct usb_ep *_ep)
{
struct dwc2_udc *dev;
struct dwc2_ep *ep;
break;
}
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
break;
case USB_RECIP_ENDPOINT:
if (usb_ctrl->wValue == USB_ENDPOINT_HALT) {
if (ep_num == 0) {
- s3c_udc_ep0_set_stall(ep);
+ dwc2_udc_ep0_set_stall(ep);
return 0;
}
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
- s3c_udc_ep_clear_stall(ep);
- s3c_udc_ep_activate(ep);
+ dwc2_udc_ep_clear_stall(ep);
+ dwc2_udc_ep_activate(ep);
ep->stopped = 0;
clear_feature_num = ep_num;
return 0;
}
-static int s3c_udc_set_feature(struct usb_ep *_ep)
+static int dwc2_udc_set_feature(struct usb_ep *_ep)
{
struct dwc2_udc *dev;
struct dwc2_ep *ep;
break;
}
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
return 0;
case USB_RECIP_INTERFACE:
"\tSET_FEATURE: USB_RECIP_ENDPOINT\n");
if (usb_ctrl->wValue == USB_ENDPOINT_HALT) {
if (ep_num == 0) {
- s3c_udc_ep0_set_stall(ep);
+ dwc2_udc_ep0_set_stall(ep);
return 0;
}
ep->stopped = 1;
- s3c_udc_ep_set_stall(ep);
+ dwc2_udc_ep_set_stall(ep);
}
- s3c_udc_ep0_zlp(dev);
+ dwc2_udc_ep0_zlp(dev);
return 0;
}
"wLength = %d, setup returned\n",
usb_ctrl->wLength);
- s3c_udc_ep0_set_stall(ep);
+ dwc2_udc_ep0_set_stall(ep);
dev->ep0state = WAIT_FOR_SETUP;
return;
"%s:BOT Rest:invalid wLength =%d, setup returned\n",
__func__, usb_ctrl->wLength);
- s3c_udc_ep0_set_stall(ep);
+ dwc2_udc_ep0_set_stall(ep);
dev->ep0state = WAIT_FOR_SETUP;
return;
break;
case USB_REQ_GET_STATUS:
- if (!s3c_udc_get_status(dev, usb_ctrl))
+ if (!dwc2_udc_get_status(dev, usb_ctrl))
return;
break;
case USB_REQ_CLEAR_FEATURE:
ep_num = usb_ctrl->wIndex & 0x7f;
- if (!s3c_udc_clear_feature(&dev->ep[ep_num].ep))
+ if (!dwc2_udc_clear_feature(&dev->ep[ep_num].ep))
return;
break;
case USB_REQ_SET_FEATURE:
ep_num = usb_ctrl->wIndex & 0x7f;
- if (!s3c_udc_set_feature(&dev->ep[ep_num].ep))
+ if (!dwc2_udc_set_feature(&dev->ep[ep_num].ep))
return;
break;
if (i < 0) {
/* setup processing failed, force stall */
- s3c_udc_ep0_set_stall(ep);
+ dwc2_udc_ep0_set_stall(ep);
dev->ep0state = WAIT_FOR_SETUP;
debug_cond(DEBUG_SETUP != 0,