diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-06-14 12:09:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-05 19:59:47 -0700 |
commit | d8bfbf6e0d3eb5309e077eac004efe01e6146beb (patch) | |
tree | 2ab21691207dba1b6769396159d84bd9233768c4 /drivers/staging/westbridge/astoria | |
parent | usbip: simplify port status saving (diff) | |
download | linux-dev-d8bfbf6e0d3eb5309e077eac004efe01e6146beb.tar.xz linux-dev-d8bfbf6e0d3eb5309e077eac004efe01e6146beb.zip |
staging/westbridge: convert cyasgadget to new udc core
This is not compile tested as I failed at it. I added an #if 0 block
because I did not find the struct device of the device.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/westbridge/astoria')
-rw-r--r-- | drivers/staging/westbridge/astoria/gadget/cyasgadget.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/staging/westbridge/astoria/gadget/cyasgadget.c b/drivers/staging/westbridge/astoria/gadget/cyasgadget.c index be851ca54cec..92015ecd7829 100644 --- a/drivers/staging/westbridge/astoria/gadget/cyasgadget.c +++ b/drivers/staging/westbridge/astoria/gadget/cyasgadget.c @@ -1595,12 +1595,18 @@ initsoj_safe_exit: return 0; } +static int cyasgadget_start(struct usb_gadget_driver *driver, + int (*bind)(struct usb_gadget *)); +static int cyasgadget_stop(struct usb_gadget_driver *driver); + static const struct usb_gadget_ops cyasgadget_ops = { .get_frame = cyasgadget_get_frame, .wakeup = cyasgadget_wakeup, .set_selfpowered = cyasgadget_set_selfpowered, .pullup = cyasgadget_pullup, .ioctl = cyasgadget_ioctl, + .start = cyasgadget_start, + .stop = cyasgadget_stop, }; @@ -1883,7 +1889,7 @@ static void cyas_ep0_start( * disconnect is reported. then a host may connect again, or * the driver might get unbound. */ -int usb_gadget_probe_driver(struct usb_gadget_driver *driver, +static int cyasgadget_start(struct usb_gadget_driver *driver, int (*bind)(struct usb_gadget *)) { cyasgadget *dev = cy_as_gadget_controller; @@ -1938,7 +1944,6 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, return 0; } -EXPORT_SYMBOL(usb_gadget_probe_driver); static void cyasgadget_nuke( cyasgadget_ep *an_ep @@ -2011,7 +2016,7 @@ static void cyasgadget_stop_activity( #endif } -int usb_gadget_unregister_driver( +static int cyasgadget_stop( struct usb_gadget_driver *driver ) { @@ -2040,7 +2045,6 @@ int usb_gadget_unregister_driver( return 0; } -EXPORT_SYMBOL(usb_gadget_unregister_driver); static void cyas_gadget_release( struct device *_dev @@ -2071,6 +2075,7 @@ static void cyasgadget_deinit( #endif return; } + usb_del_gadget_udc(&cy_as_dev->gadget); if (cy_as_dev->driver) { /* should have been done already by driver model core */ @@ -2131,6 +2136,13 @@ static int cyasgadget_initialize(void) /* We are done now */ cy_as_gadget_controller = cy_as_dev; +#if 0 + pdev is the platform_device or pci_device or whatever is used here + retval = usb_add_gadget_udc(&pdev->dev, &cy_as_dev->gadget); + if (retval) + goto done; +#endif + return 0; /* |