diff options
author | Marek Vasut <marex@denx.de> | 2015-12-04 01:48:57 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-12-17 21:54:39 +0100 |
commit | 627d929826af5a356ab3ad7198f2a13ce516512b (patch) | |
tree | c3f0f3d4b0ab7b16eba3fb9ea7aa5907c5f0cda1 /drivers | |
parent | 5f3a562a3ba145b2fb62ddb77f59bac5c4ab3ff6 (diff) |
usb: s3c-otg: Rename struct s3c_ep
The driver is actually for the Designware DWC2 controller.
This patch renames struct s3c_ep to reflect this.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/s3c_udc_otg.c | 38 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c_udc_otg_priv.h | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 48 |
3 files changed, 46 insertions, 46 deletions
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c index 99c6a1b1a7..4caa390773 100644 --- a/drivers/usb/gadget/s3c_udc_otg.c +++ b/drivers/usb/gadget/s3c_udc_otg.c @@ -96,20 +96,20 @@ static int s3c_dequeue(struct usb_ep *ep, struct usb_request *); static int s3c_fifo_status(struct usb_ep *ep); static void s3c_fifo_flush(struct usb_ep *ep); static void s3c_ep0_read(struct dwc2_udc *dev); -static void s3c_ep0_kick(struct dwc2_udc *dev, struct s3c_ep *ep); +static void s3c_ep0_kick(struct dwc2_udc *dev, struct dwc2_ep *ep); static void s3c_handle_ep0(struct dwc2_udc *dev); static int s3c_ep0_write(struct dwc2_udc *dev); -static int write_fifo_ep0(struct s3c_ep *ep, struct s3c_request *req); -static void done(struct s3c_ep *ep, struct s3c_request *req, int status); +static int write_fifo_ep0(struct dwc2_ep *ep, struct s3c_request *req); +static void done(struct dwc2_ep *ep, struct s3c_request *req, int status); static void stop_activity(struct dwc2_udc *dev, struct usb_gadget_driver *driver); static int udc_enable(struct dwc2_udc *dev); static void udc_set_address(struct dwc2_udc *dev, unsigned char address); 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 s3c_ep *ep, int status); +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 s3c_ep *ep); +static void s3c_udc_set_nak(struct dwc2_ep *ep); void set_udc_gadget_private_data(void *p) { @@ -191,7 +191,7 @@ static void udc_reinit(struct dwc2_udc *dev) /* basic endpoint records init */ for (i = 0; i < S3C_MAX_ENDPOINTS; i++) { - struct s3c_ep *ep = &dev->ep[i]; + struct dwc2_ep *ep = &dev->ep[i]; if (i != 0) list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); @@ -305,7 +305,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) /* * done - retire a request; caller blocked irqs */ -static void done(struct s3c_ep *ep, struct s3c_request *req, int status) +static void done(struct dwc2_ep *ep, struct s3c_request *req, int status) { unsigned int stopped = ep->stopped; @@ -356,7 +356,7 @@ static void done(struct s3c_ep *ep, struct s3c_request *req, int status) /* * nuke - dequeue ALL requests */ -static void nuke(struct s3c_ep *ep, int status) +static void nuke(struct dwc2_ep *ep, int status) { struct s3c_request *req; @@ -381,7 +381,7 @@ static void stop_activity(struct dwc2_udc *dev, /* prevent new request submissions, kill any outstanding requests */ for (i = 0; i < S3C_MAX_ENDPOINTS; i++) { - struct s3c_ep *ep = &dev->ep[i]; + struct dwc2_ep *ep = &dev->ep[i]; ep->stopped = 1; nuke(ep, -ESHUTDOWN); } @@ -530,13 +530,13 @@ static void set_max_pktsize(struct dwc2_udc *dev, enum usb_device_speed speed) static int s3c_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) { - struct s3c_ep *ep; + struct dwc2_ep *ep; struct dwc2_udc *dev; unsigned long flags = 0; debug("%s: %p\n", __func__, _ep); - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (!_ep || !desc || ep->desc || _ep->name == ep0name || desc->bDescriptorType != USB_DT_ENDPOINT || ep->bEndpointAddress != desc->bEndpointAddress @@ -595,12 +595,12 @@ static int s3c_ep_enable(struct usb_ep *_ep, */ static int s3c_ep_disable(struct usb_ep *_ep) { - struct s3c_ep *ep; + struct dwc2_ep *ep; unsigned long flags = 0; debug("%s: %p\n", __func__, _ep); - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (!_ep || !ep->desc) { debug("%s: %s not enabled\n", __func__, _ep ? ep->ep.name : NULL); @@ -652,13 +652,13 @@ static void s3c_free_request(struct usb_ep *ep, struct usb_request *_req) /* dequeue JUST ONE request */ static int s3c_dequeue(struct usb_ep *_ep, struct usb_request *_req) { - struct s3c_ep *ep; + struct dwc2_ep *ep; struct s3c_request *req; unsigned long flags = 0; debug("%s: %p\n", __func__, _ep); - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (!_ep || ep->ep.name == ep0name) return -EINVAL; @@ -686,9 +686,9 @@ static int s3c_dequeue(struct usb_ep *_ep, struct usb_request *_req) static int s3c_fifo_status(struct usb_ep *_ep) { int count = 0; - struct s3c_ep *ep; + struct dwc2_ep *ep; - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (!_ep) { debug("%s: bad ep\n", __func__); return -ENODEV; @@ -708,9 +708,9 @@ static int s3c_fifo_status(struct usb_ep *_ep) */ static void s3c_fifo_flush(struct usb_ep *_ep) { - struct s3c_ep *ep; + struct dwc2_ep *ep; - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) { debug("%s: bad ep\n", __func__); return; diff --git a/drivers/usb/gadget/s3c_udc_otg_priv.h b/drivers/usb/gadget/s3c_udc_otg_priv.h index 567fb4e263..a9b696902c 100644 --- a/drivers/usb/gadget/s3c_udc_otg_priv.h +++ b/drivers/usb/gadget/s3c_udc_otg_priv.h @@ -51,7 +51,7 @@ enum ep_type { ep_control, ep_bulk_in, ep_bulk_out, ep_interrupt }; -struct s3c_ep { +struct dwc2_ep { struct usb_ep ep; struct dwc2_udc *dev; @@ -81,7 +81,7 @@ struct dwc2_udc { struct s3c_plat_otg_data *pdata; int ep0state; - struct s3c_ep ep[S3C_MAX_ENDPOINTS]; + struct dwc2_ep ep[S3C_MAX_ENDPOINTS]; unsigned char usb_address; @@ -97,6 +97,6 @@ extern struct dwc2_udc *the_controller; extern void otg_phy_init(struct dwc2_udc *dev); extern void otg_phy_off(struct dwc2_udc *dev); -extern void s3c_udc_ep_set_stall(struct s3c_ep *ep); +extern void s3c_udc_ep_set_stall(struct dwc2_ep *ep); #endif /* __S3C_UDC_OTG_PRIV__ */ diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c index 6695444945..53c9d4e8b2 100644 --- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c +++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c @@ -90,7 +90,7 @@ static inline void s3c_ep0_complete_out(void) } -static int setdma_rx(struct s3c_ep *ep, struct s3c_request *req) +static int setdma_rx(struct dwc2_ep *ep, struct s3c_request *req) { u32 *buf, ctrl; u32 length, pktcnt; @@ -128,7 +128,7 @@ static int setdma_rx(struct s3c_ep *ep, struct s3c_request *req) } -int setdma_tx(struct s3c_ep *ep, struct s3c_request *req) +int setdma_tx(struct dwc2_ep *ep, struct s3c_request *req) { u32 *buf, ctrl = 0; u32 length, pktcnt; @@ -188,7 +188,7 @@ int setdma_tx(struct s3c_ep *ep, struct s3c_request *req) static void complete_rx(struct dwc2_udc *dev, u8 ep_num) { - struct s3c_ep *ep = &dev->ep[ep_num]; + struct dwc2_ep *ep = &dev->ep[ep_num]; struct s3c_request *req = NULL; u32 ep_tsr = 0, xfer_size = 0, is_short = 0; @@ -261,7 +261,7 @@ static void complete_rx(struct dwc2_udc *dev, u8 ep_num) static void complete_tx(struct dwc2_udc *dev, u8 ep_num) { - struct s3c_ep *ep = &dev->ep[ep_num]; + struct dwc2_ep *ep = &dev->ep[ep_num]; struct s3c_request *req; u32 ep_tsr = 0, xfer_size = 0, is_short = 0; u32 last; @@ -337,7 +337,7 @@ static void complete_tx(struct dwc2_udc *dev, u8 ep_num) static inline void s3c_udc_check_tx_queue(struct dwc2_udc *dev, u8 ep_num) { - struct s3c_ep *ep = &dev->ep[ep_num]; + struct dwc2_ep *ep = &dev->ep[ep_num]; struct s3c_request *req; debug_cond(DEBUG_IN_EP, @@ -583,7 +583,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) { struct s3c_request *req; - struct s3c_ep *ep; + struct dwc2_ep *ep; struct dwc2_udc *dev; unsigned long flags = 0; u32 ep_num, gintsts; @@ -596,7 +596,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req, return -EINVAL; } - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) { @@ -680,7 +680,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req, /****************************************************************/ /* return: 0 = still running, 1 = completed, negative = errno */ -static int write_fifo_ep0(struct s3c_ep *ep, struct s3c_request *req) +static int write_fifo_ep0(struct dwc2_ep *ep, struct s3c_request *req) { u32 max; unsigned count; @@ -718,7 +718,7 @@ static int write_fifo_ep0(struct s3c_ep *ep, struct s3c_request *req) return 0; } -int s3c_fifo_read(struct s3c_ep *ep, u32 *cp, int max) +int s3c_fifo_read(struct dwc2_ep *ep, u32 *cp, int max) { invalidate_dcache_range((unsigned long)cp, (unsigned long)cp + ROUND(max, CONFIG_SYS_CACHELINE_SIZE)); @@ -751,7 +751,7 @@ static void udc_set_address(struct dwc2_udc *dev, unsigned char address) dev->usb_address = address; } -static inline void s3c_udc_ep0_set_stall(struct s3c_ep *ep) +static inline void s3c_udc_ep0_set_stall(struct dwc2_ep *ep) { struct dwc2_udc *dev; u32 ep_ctrl = 0; @@ -782,7 +782,7 @@ static inline void s3c_udc_ep0_set_stall(struct s3c_ep *ep) static void s3c_ep0_read(struct dwc2_udc *dev) { struct s3c_request *req; - struct s3c_ep *ep = &dev->ep[0]; + struct dwc2_ep *ep = &dev->ep[0]; if (!list_empty(&ep->queue)) { req = list_entry(ep->queue.next, struct s3c_request, queue); @@ -819,7 +819,7 @@ static void s3c_ep0_read(struct dwc2_udc *dev) static int s3c_ep0_write(struct dwc2_udc *dev) { struct s3c_request *req; - struct s3c_ep *ep = &dev->ep[0]; + struct dwc2_ep *ep = &dev->ep[0]; int ret, need_zlp = 0; if (list_empty(&ep->queue)) @@ -920,7 +920,7 @@ int s3c_udc_get_status(struct dwc2_udc *dev, return 0; } -static void s3c_udc_set_nak(struct s3c_ep *ep) +static void s3c_udc_set_nak(struct dwc2_ep *ep) { u8 ep_num; u32 ep_ctrl = 0; @@ -946,7 +946,7 @@ static void s3c_udc_set_nak(struct s3c_ep *ep) } -void s3c_udc_ep_set_stall(struct s3c_ep *ep) +void s3c_udc_ep_set_stall(struct dwc2_ep *ep) { u8 ep_num; u32 ep_ctrl = 0; @@ -981,7 +981,7 @@ void s3c_udc_ep_set_stall(struct s3c_ep *ep) return; } -void s3c_udc_ep_clear_stall(struct s3c_ep *ep) +void s3c_udc_ep_clear_stall(struct dwc2_ep *ep) { u8 ep_num; u32 ep_ctrl = 0; @@ -1031,12 +1031,12 @@ void s3c_udc_ep_clear_stall(struct s3c_ep *ep) static int s3c_udc_set_halt(struct usb_ep *_ep, int value) { - struct s3c_ep *ep; + struct dwc2_ep *ep; struct dwc2_udc *dev; unsigned long flags = 0; u8 ep_num; - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); ep_num = ep_index(ep); if (unlikely(!_ep || !ep->desc || ep_num == EP0_CON || @@ -1076,7 +1076,7 @@ static int s3c_udc_set_halt(struct usb_ep *_ep, int value) return 0; } -void s3c_udc_ep_activate(struct s3c_ep *ep) +void s3c_udc_ep_activate(struct dwc2_ep *ep) { u8 ep_num; u32 ep_ctrl = 0, daintmsk = 0; @@ -1126,10 +1126,10 @@ void s3c_udc_ep_activate(struct s3c_ep *ep) static int s3c_udc_clear_feature(struct usb_ep *_ep) { struct dwc2_udc *dev; - struct s3c_ep *ep; + struct dwc2_ep *ep; u8 ep_num; - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); ep_num = ep_index(ep); dev = ep->dev; @@ -1190,10 +1190,10 @@ static int s3c_udc_clear_feature(struct usb_ep *_ep) static int s3c_udc_set_feature(struct usb_ep *_ep) { struct dwc2_udc *dev; - struct s3c_ep *ep; + struct dwc2_ep *ep; u8 ep_num; - ep = container_of(_ep, struct s3c_ep, ep); + ep = container_of(_ep, struct dwc2_ep, ep); ep_num = ep_index(ep); dev = ep->dev; @@ -1264,7 +1264,7 @@ static int s3c_udc_set_feature(struct usb_ep *_ep) */ void s3c_ep0_setup(struct dwc2_udc *dev) { - struct s3c_ep *ep = &dev->ep[0]; + struct dwc2_ep *ep = &dev->ep[0]; int i; u8 ep_num; @@ -1465,7 +1465,7 @@ static void s3c_handle_ep0(struct dwc2_udc *dev) } } -static void s3c_ep0_kick(struct dwc2_udc *dev, struct s3c_ep *ep) +static void s3c_ep0_kick(struct dwc2_udc *dev, struct dwc2_ep *ep) { debug_cond(DEBUG_EP0 != 0, "%s: ep_is_in = %d\n", __func__, ep_is_in(ep)); |