diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-06-28 09:33:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 14:13:35 -0400 |
commit | 0f91349b89f37dfad7b77f7829a105b6a0f526ec (patch) | |
tree | 4a2b109d3d736318913d0209a5f4ce89aaad1d24 /drivers/usb/gadget/langwell_udc.c | |
parent | 2ccea03a8f7ec93641791f2760d7cdc6cab6205f (diff) |
usb: gadget: convert all users to the new udc infrastructure
peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
register/unregister to the udc-core.
The udc-core will take the first available gadget driver and attach
function driver which is calling usb_gadget_register_driver(). This is
the same behaviour we have right now.
Only dummy_hcd was tested, the others were compiled tested.
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Roy Huang <roy.huang@analog.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Cc: cxie4 <cxie4@marvell.com>
Cc: linux-geode@lists.infradead.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/langwell_udc.c')
-rw-r--r-- | drivers/usb/gadget/langwell_udc.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index 9cee88a43a73..d8403ae3c2b3 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c | |||
@@ -1321,7 +1321,9 @@ static int langwell_pullup(struct usb_gadget *_gadget, int is_on) | |||
1321 | return 0; | 1321 | return 0; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | 1324 | static int langwell_start(struct usb_gadget_driver *driver, | |
1325 | int (*bind)(struct usb_gadget *)); | ||
1326 | static int langwell_stop(struct usb_gadget_driver *driver); | ||
1325 | /* device controller usb_gadget_ops structure */ | 1327 | /* device controller usb_gadget_ops structure */ |
1326 | static const struct usb_gadget_ops langwell_ops = { | 1328 | static const struct usb_gadget_ops langwell_ops = { |
1327 | 1329 | ||
@@ -1342,6 +1344,9 @@ static const struct usb_gadget_ops langwell_ops = { | |||
1342 | 1344 | ||
1343 | /* D+ pullup, software-controlled connect/disconnect to USB host */ | 1345 | /* D+ pullup, software-controlled connect/disconnect to USB host */ |
1344 | .pullup = langwell_pullup, | 1346 | .pullup = langwell_pullup, |
1347 | |||
1348 | .start = langwell_start, | ||
1349 | .stop = langwell_stop, | ||
1345 | }; | 1350 | }; |
1346 | 1351 | ||
1347 | 1352 | ||
@@ -1852,7 +1857,7 @@ static DEVICE_ATTR(remote_wakeup, S_IWUSR, NULL, store_remote_wakeup); | |||
1852 | * the driver might get unbound. | 1857 | * the driver might get unbound. |
1853 | */ | 1858 | */ |
1854 | 1859 | ||
1855 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | 1860 | static int langwell_start(struct usb_gadget_driver *driver, |
1856 | int (*bind)(struct usb_gadget *)) | 1861 | int (*bind)(struct usb_gadget *)) |
1857 | { | 1862 | { |
1858 | struct langwell_udc *dev = the_controller; | 1863 | struct langwell_udc *dev = the_controller; |
@@ -1914,11 +1919,9 @@ err_unbind: | |||
1914 | dev_dbg(&dev->pdev->dev, "<--- %s()\n", __func__); | 1919 | dev_dbg(&dev->pdev->dev, "<--- %s()\n", __func__); |
1915 | return retval; | 1920 | return retval; |
1916 | } | 1921 | } |
1917 | EXPORT_SYMBOL(usb_gadget_probe_driver); | ||
1918 | |||
1919 | 1922 | ||
1920 | /* unregister gadget driver */ | 1923 | /* unregister gadget driver */ |
1921 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 1924 | static int langwell_stop(struct usb_gadget_driver *driver) |
1922 | { | 1925 | { |
1923 | struct langwell_udc *dev = the_controller; | 1926 | struct langwell_udc *dev = the_controller; |
1924 | unsigned long flags; | 1927 | unsigned long flags; |
@@ -1965,8 +1968,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1965 | dev_dbg(&dev->pdev->dev, "<--- %s()\n", __func__); | 1968 | dev_dbg(&dev->pdev->dev, "<--- %s()\n", __func__); |
1966 | return 0; | 1969 | return 0; |
1967 | } | 1970 | } |
1968 | EXPORT_SYMBOL(usb_gadget_unregister_driver); | ||
1969 | |||
1970 | 1971 | ||
1971 | /*-------------------------------------------------------------------------*/ | 1972 | /*-------------------------------------------------------------------------*/ |
1972 | 1973 | ||
@@ -3373,6 +3374,10 @@ static int langwell_udc_probe(struct pci_dev *pdev, | |||
3373 | if (retval) | 3374 | if (retval) |
3374 | goto error; | 3375 | goto error; |
3375 | 3376 | ||
3377 | retval = usb_add_gadget_udc(&pdev->dev, &dev->gadget); | ||
3378 | if (retval) | ||
3379 | goto error; | ||
3380 | |||
3376 | retval = device_create_file(&pdev->dev, &dev_attr_langwell_udc); | 3381 | retval = device_create_file(&pdev->dev, &dev_attr_langwell_udc); |
3377 | if (retval) | 3382 | if (retval) |
3378 | goto error; | 3383 | goto error; |
@@ -3403,6 +3408,7 @@ static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3403 | 3408 | ||
3404 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); | 3409 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); |
3405 | 3410 | ||
3411 | usb_del_gadget_udc(&dev->gadget); | ||
3406 | /* disable interrupt and set controller to stop state */ | 3412 | /* disable interrupt and set controller to stop state */ |
3407 | langwell_udc_stop(dev); | 3413 | langwell_udc_stop(dev); |
3408 | 3414 | ||