diff options
| author | Pawel Laszczak <[email protected]> | 2020-12-07 10:32:20 +0000 |
|---|---|---|
| committer | Peter Chen <[email protected]> | 2020-12-29 04:36:13 +0000 |
| commit | 394c3a144de89e994c8a2c5ba5dc64fa4e5aa870 (patch) | |
| tree | 392480a1bd5bbaf285c68735f3251a50be2e4e03 /drivers/usb/cdns3/core.c | |
| parent | usb: cdns3: Split core.c into cdns3-plat and core.c file (diff) | |
| download | kernel-394c3a144de89e994c8a2c5ba5dc64fa4e5aa870.tar.gz kernel-394c3a144de89e994c8a2c5ba5dc64fa4e5aa870.zip | |
usb: cdns3: Moves reusable code to separate module
Patch moves common reusable code used by cdns3 and cdnsp driver
to cdns-usb-common library. This library include core.c, drd.c
and host.c files.
Signed-off-by: Pawel Laszczak <[email protected]>
Tested-by: Aswath Govindraju <[email protected]>
Signed-off-by: Peter Chen <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/core.c')
| -rw-r--r-- | drivers/usb/cdns3/core.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 7b67a7c74586..81ea035c0e11 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -19,10 +19,8 @@ #include <linux/io.h> #include <linux/pm_runtime.h> -#include "gadget.h" #include "core.h" #include "host-export.h" -#include "gadget-export.h" #include "drd.h" static int cdns3_idle_init(struct cdns3 *cdns); @@ -147,7 +145,11 @@ static int cdns3_core_init_role(struct cdns3 *cdns) } if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) { - ret = cdns3_gadget_init(cdns); + if (cdns->gadget_init) + ret = cdns->gadget_init(cdns); + else + ret = -ENXIO; + if (ret) { dev_err(dev, "Device initialization failed with %d\n", ret); @@ -477,6 +479,7 @@ role_switch_unregister: return ret; } +EXPORT_SYMBOL_GPL(cdns3_init); /** * cdns3_remove - unbind drd driver and clean up @@ -491,6 +494,7 @@ int cdns3_remove(struct cdns3 *cdns) return 0; } +EXPORT_SYMBOL_GPL(cdns3_remove); #ifdef CONFIG_PM_SLEEP int cdns3_suspend(struct cdns3 *cdns) @@ -509,6 +513,7 @@ int cdns3_suspend(struct cdns3 *cdns) return 0; } +EXPORT_SYMBOL_GPL(cdns3_suspend); int cdns3_resume(struct cdns3 *cdns, u8 set_active) { @@ -525,4 +530,11 @@ int cdns3_resume(struct cdns3 *cdns, u8 set_active) return 0; } +EXPORT_SYMBOL_GPL(cdns3_resume); #endif /* CONFIG_PM_SLEEP */ + +MODULE_AUTHOR("Peter Chen <[email protected]>"); +MODULE_AUTHOR("Pawel Laszczak <[email protected]>"); +MODULE_AUTHOR("Roger Quadros <[email protected]>"); +MODULE_DESCRIPTION("Cadence USBSS and USBSSP DRD Driver"); +MODULE_LICENSE("GPL"); |
