aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-08-28 20:11:02 +0800
committerEric Miao <eric.miao@linaro.org>2011-10-14 09:57:02 +0800
commita2b3e75b9101fef2970123873539b06b94534d0b (patch)
tree2d5826d5a98ed497e3161e57b43129c4abd2afe8
parent70ba3d3027840186c06fb77ded87e02a16bfa465 (diff)
downloadlinux-linaro-a2b3e75b9101fef2970123873539b06b94534d0b.tar.gz
usb: convert arcotg_udc.c to the new udc infrastructure
Signed-off-by: Eric Miao <eric.miao@linaro.org>
-rw-r--r--drivers/usb/gadget/arcotg_udc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c
index 9d4e29e2da3..309b13995b8 100644
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -1464,6 +1464,11 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
return 0;
}
+static int fsl_udc_start(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *));
+static int fsl_udc_stop(struct usb_gadget_driver *driver);
+
+
/* defined in gadget.h */
static struct usb_gadget_ops fsl_gadget_ops = {
.get_frame = fsl_get_frame,
@@ -1472,6 +1477,8 @@ static struct usb_gadget_ops fsl_gadget_ops = {
.vbus_session = fsl_vbus_session,
.vbus_draw = fsl_vbus_draw,
.pullup = fsl_pullup,
+ .start = fsl_udc_start,
+ .stop = fsl_udc_stop,
};
/* Set protocol stall on ep0, protocol stall will automatically be cleared
@@ -2285,8 +2292,8 @@ irq_end:
* Hook to gadget drivers
* Called by initialization code of gadget drivers
*----------------------------------------------------------------*/
-int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
- int (*bind)(struct usb_gadget *))
+static int fsl_udc_start(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
int retval = -ENODEV;
unsigned long flags = 0;
@@ -2367,10 +2374,9 @@ out:
}
return retval;
}
-EXPORT_SYMBOL(usb_gadget_probe_driver);
/* Disconnect from gadget driver */
-int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+static int fsl_udc_stop(struct usb_gadget_driver *driver)
{
struct fsl_ep *loop_ep;
unsigned long flags;
@@ -2422,7 +2428,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
driver->driver.name);
return 0;
}
-EXPORT_SYMBOL(usb_gadget_unregister_driver);
/*-------------------------------------------------------------------------
PROC File System Support
@@ -2994,8 +2999,12 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
dr_clk_gate(false);
create_proc_file();
- return 0;
+ ret = usb_add_gadget_udc(&pdev->dev, &udc_controller->gadget);
+ if (!ret)
+ return ret;
+
+ remove_proc_file();
err4:
device_unregister(&udc_controller->gadget.dev);
err3:
@@ -3023,6 +3032,8 @@ static int __exit fsl_udc_remove(struct platform_device *pdev)
DECLARE_COMPLETION(done);
+ usb_del_gadget_udc(&udc_controller->gadget);
+
if (!udc_controller)
return -ENODEV;
udc_controller->done = &done;