summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/core.h
diff options
context:
space:
mode:
authorVivek Gautam <gautam.vivek@samsung.com>2013-01-15 16:09:21 +0530
committerFelipe Balbi <balbi@ti.com>2013-01-18 14:55:55 +0200
commit388e5c51135f817f01177c42261f1116a6d7f2ad (patch)
tree88daa4a3f4bd5dcee23ecb2760028aa091625924 /drivers/usb/dwc3/core.h
parentc9fda7d6f62a6520e01652d370654c5657d3c1a1 (diff)
downloadtalos-op-linux-388e5c51135f817f01177c42261f1116a6d7f2ad.tar.gz
talos-op-linux-388e5c51135f817f01177c42261f1116a6d7f2ad.zip
usb: dwc3: remove dwc3 dependency on host AND gadget.
DWC3 controller curretly depends on USB && USB_GADGET. Some hardware may like to use only host feature on dwc3, or only gadget feature. So, removing this dependency of USB_DWC3 on USB and USB_GADGET. Adding the mode of operaiton of DWC3 also here HOST/GADGET/DUAL_ROLE based on which features are enabled. [ balbi@ti.com : . make sure we have default modes for all possible Kernel configurations. . Remove the config -> menuconfig change as it's unnecessary . switch over to IS_ENABLED() ] CC: Doug Anderson <dianders@chromium.org> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.h')
-rw-r--r--drivers/usb/dwc3/core.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index f02b3e0795e0..b41750660235 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -864,10 +864,24 @@ union dwc3_event {
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);
+#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc);
void dwc3_host_exit(struct dwc3 *dwc);
-
+#else
+static inline int dwc3_host_init(struct dwc3 *dwc)
+{ return 0; }
+static inline void dwc3_host_exit(struct dwc3 *dwc)
+{ }
+#endif
+
+#if IS_ENABLED(CONFIG_USB_DWC3_GADGET) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_gadget_init(struct dwc3 *dwc);
void dwc3_gadget_exit(struct dwc3 *dwc);
+#else
+static inline int dwc3_gadget_init(struct dwc3 *dwc)
+{ return 0; }
+static inline void dwc3_gadget_exit(struct dwc3 *dwc)
+{ }
+#endif
#endif /* __DRIVERS_USB_DWC3_CORE_H */
OpenPOWER on IntegriCloud