From: Dinh Nguyen <dinguyen@xxxxxxxxxx> There are functions in gadget driver that needs to get exported so that the common interrupt handler can call. Signed-off-by: Dinh Nguyen <dinguyen@xxxxxxxxxx> --- drivers/usb/dwc2/core.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/dwc2/hcd.h | 12 +---------- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 95fc6e9..a064d48 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -953,4 +953,56 @@ extern void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg); */ extern u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg); +/* Gadget defines */ +#if defined(CONFIG_USB_DWC2_PERIPHERAL) || defined(CONFIG_USB_DWC2_DUAL_ROLE) +extern void s3c_hsotg_irq_enumdone(struct dwc2_hsotg *dwc2); +extern void s3c_hsotg_epint(struct dwc2_hsotg *dwc2, unsigned int idx, + int dir_in); +extern void kill_all_requests(struct dwc2_hsotg *dwc2, + struct s3c_hsotg_ep *ep, int result, bool force); +extern void s3c_hsotg_core_init(struct dwc2_hsotg *dwc2); +extern void s3c_hsotg_disable_gsint(struct dwc2_hsotg *dwc2, u32 ints); +extern void s3c_hsotg_irq_fifoempty(struct dwc2_hsotg *dwc2, bool periodic); +extern void s3c_hsotg_handle_rx(struct dwc2_hsotg *dwc2); +extern void s3c_hsotg_remove(struct dwc2_hsotg *dwc2); +extern void s3c_hsotg_dump(struct dwc2_hsotg *dwc2); +extern int s3c_hsotg_suspend(struct dwc2_hsotg *dwc2); +extern int s3c_hsotg_resume(struct dwc2_hsotg *dwc2); +#else +static inline void s3c_hsotg_irq_enumdone(struct dwc2_hsotg *dwc2) {} +static inline void s3c_hsotg_epint(struct dwc2_hsotg *dwc2, unsigned int idx, + int dir_in) {} +static inline void kill_all_requests(struct dwc2_hsotg *dwc2, + struct s3c_hsotg_ep *ep, int result, bool force) {} +static inline void s3c_hsotg_core_init(struct dwc2_hsotg *dwc2) {} +static inline void s3c_hsotg_disable_gsint(struct dwc2_hsotg *dwc2, u32 ints) +{} +static inline void s3c_hsotg_irq_fifoempty(struct dwc2_hsotg *dwc2, + bool periodic) {} +static inline void s3c_hsotg_handle_rx(struct dwc2_hsotg *dwc2) {} +static inline void s3c_hsotg_remove(struct dwc2_hsotg *dwc2) {} +static inline void s3c_hsotg_dump(struct dwc2_hsotg *dwc2) {} +static inline int s3c_hsotg_suspend(struct dwc2_hsotg *dwc2) +{ return 0; } +static inline int s3c_hsotg_resume(struct dwc2_hsotg *dwc2) +{ return 0; } +#endif + +extern void dwc2_set_all_params(struct dwc2_core_params *params, int value); +#if defined(CONFIG_USB_DWC2_HOST) || defined(CONFIG_USB_DWC2_DUAL_ROLE) +/** + * dwc2_hcd_get_frame_number() - Returns current frame number + * + * @hsotg: The DWC2 HCD + */ +extern int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg); +extern void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg); +extern void dwc2_hcd_start(struct dwc2_hsotg *hsotg); +#else +static inline int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg) +{ return 0; } +static inline void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg) {} +static inline void dwc2_hcd_start(struct dwc2_hsotg *hsotg) {} +#endif + #endif /* __DWC2_CORE_H__ */ diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h index fdc6d48..9705abf 100644 --- a/drivers/usb/dwc2/hcd.h +++ b/drivers/usb/dwc2/hcd.h @@ -449,12 +449,12 @@ static inline u8 dwc2_hcd_is_pipe_out(struct dwc2_hcd_pipe_info *pipe) return !dwc2_hcd_is_pipe_in(pipe); } +extern int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq); extern int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq, const struct dwc2_core_params *params); extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg); extern void dwc2_set_parameters(struct dwc2_hsotg *hsotg, const struct dwc2_core_params *params); -extern void dwc2_set_all_params(struct dwc2_core_params *params, int value); extern int dwc2_get_hwparams(struct dwc2_hsotg *hsotg); /* Transaction Execution Functions */ @@ -666,9 +666,6 @@ extern irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg); */ extern void dwc2_hcd_stop(struct dwc2_hsotg *hsotg); -extern void dwc2_hcd_start(struct dwc2_hsotg *hsotg); -extern void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg); - /** * dwc2_hcd_is_b_host() - Returns 1 if core currently is acting as B host, * and 0 otherwise @@ -678,13 +675,6 @@ extern void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg); extern int dwc2_hcd_is_b_host(struct dwc2_hsotg *hsotg); /** - * dwc2_hcd_get_frame_number() - Returns current frame number - * - * @hsotg: The DWC2 HCD - */ -extern int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg); - -/** * dwc2_hcd_dump_state() - Dumps hsotg state * * @hsotg: The DWC2 HCD -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html