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>
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)
{
/* 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);
/*
* 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;
/*
* 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;
/* 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);
}
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
*/
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);
/* 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;
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;
*/
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;
ep_control, ep_bulk_in, ep_bulk_out, ep_interrupt
};
-struct s3c_ep {
+struct dwc2_ep {
struct usb_ep ep;
struct dwc2_udc *dev;
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;
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__ */
}
-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;
}
-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;
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;
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;
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,
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;
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))) {
/****************************************************************/
/* 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;
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));
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;
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);
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))
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;
}
-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;
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;
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 ||
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;
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;
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;
*/
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;
}
}
-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));