Lines Matching full:dwc3

41 int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)  in dwc3_gadget_set_test_mode()
72 int dwc3_gadget_get_link_state(struct dwc3 *dwc) in dwc3_gadget_get_link_state()
89 int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state) in dwc3_gadget_set_link_state()
98 if (!DWC3_VER_IS_PRIOR(DWC3, 194A)) { in dwc3_gadget_set_link_state()
125 if (!DWC3_VER_IS_PRIOR(DWC3, 194A)) in dwc3_gadget_set_link_state()
178 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_del_and_unmap_request()
211 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_giveback()
230 int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd, in dwc3_send_gadget_generic_command()
261 static int __dwc3_gadget_wakeup(struct dwc3 *dwc);
276 struct dwc3 *dwc = dep->dwc; in dwc3_send_gadget_ep_cmd()
441 struct dwc3 *dwc = dep->dwc; in dwc3_send_clear_stall_ep_cmd()
454 !DWC3_VER_IS_PRIOR(DWC3, 260A) && in dwc3_send_clear_stall_ep_cmd()
473 struct dwc3 *dwc = dep->dwc; in dwc3_alloc_trb_pool()
492 struct dwc3 *dwc = dep->dwc; in dwc3_free_trb_pool()
549 struct dwc3 *dwc; in dwc3_gadget_start_config()
584 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_set_ep_config()
663 * @dwc: pointer to the DWC3 context
677 static int dwc3_gadget_get_tx_fifos_size(struct dwc3 *dwc) in dwc3_gadget_get_tx_fifos_size()
692 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_get_tx_fifos_size()
706 * @dwc: pointer to the DWC3 context
711 * DWC3 revision 280A and prior:
714 * DWC3 revision 290A and onwards:
721 static int dwc3_gadget_calc_tx_fifo_size(struct dwc3 *dwc, int mult) in dwc3_gadget_calc_tx_fifo_size()
732 if (DWC3_VER_IS_PRIOR(DWC3, 290A)) in dwc3_gadget_calc_tx_fifo_size()
741 * @dwc: pointer to the DWC3 context
746 void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc) in dwc3_gadget_clear_tx_fifos()
759 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_clear_tx_fifos()
770 size = DWC3_IP_IS(DWC3) ? 0 : in dwc3_gadget_clear_tx_fifos()
792 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_resize_tx_fifos()
853 if (DWC3_IP_IS(DWC3)) in __dwc3_gadget_resize_tx_fifos()
898 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_resize_tx_fifos()
964 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_resize_tx_fifos()
974 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_resize_tx_fifos()
1001 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep_enable()
1113 void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status) in dwc3_remove_requests()
1155 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep_disable()
1175 * dwc3_remove_requests() can exit early if DWC3 EP delayed stop is in __dwc3_gadget_ep_disable()
1211 struct dwc3 *dwc; in dwc3_gadget_ep_enable()
1216 pr_debug("dwc3: invalid parameters\n"); in dwc3_gadget_ep_enable()
1221 pr_debug("dwc3: missing wMaxPacketSize\n"); in dwc3_gadget_ep_enable()
1243 struct dwc3 *dwc; in dwc3_gadget_ep_disable()
1248 pr_debug("dwc3: invalid parameters\n"); in dwc3_gadget_ep_disable()
1365 struct dwc3 *dwc = dep->dwc; in dwc3_prepare_one_trb()
1694 struct dwc3 *dwc = dep->dwc; in dwc3_prepare_trbs()
1805 static int __dwc3_gadget_get_frame(struct dwc3 *dwc) in __dwc3_gadget_get_frame()
1975 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_start_isoc()
2043 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep_queue()
2112 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_queue()
2157 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_cleanup_cancelled_requests()
2193 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_dequeue()
2249 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep_set_halt()
2333 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_set_halt()
2349 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_set_wedge()
2399 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_get_frame()
2404 static int __dwc3_gadget_wakeup(struct dwc3 *dwc) in __dwc3_gadget_wakeup()
2442 if (DWC3_VER_IS_PRIOR(DWC3, 194A)) { in __dwc3_gadget_wakeup()
2470 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_wakeup()
2484 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_set_selfpowered()
2494 static void dwc3_stop_active_transfers(struct dwc3 *dwc) in dwc3_stop_active_transfers()
2509 static void __dwc3_gadget_set_ssp_rate(struct dwc3 *dwc) in __dwc3_gadget_set_ssp_rate()
2533 static void __dwc3_gadget_set_speed(struct dwc3 *dwc) in __dwc3_gadget_set_speed()
2552 * WORKAROUND: DWC3 revision < 2.20a have an issue in __dwc3_gadget_set_speed()
2564 if (DWC3_VER_IS_PRIOR(DWC3, 220A) && in __dwc3_gadget_set_speed()
2582 if (DWC3_IP_IS(DWC3)) in __dwc3_gadget_set_speed()
2590 if (DWC3_IP_IS(DWC3)) in __dwc3_gadget_set_speed()
2605 static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) in dwc3_gadget_run_stop()
2615 if (DWC3_VER_IS_WITHIN(DWC3, ANY, 187A)) { in dwc3_gadget_run_stop()
2620 if (!DWC3_VER_IS_PRIOR(DWC3, 194A)) in dwc3_gadget_run_stop()
2652 static void dwc3_gadget_disable_irq(struct dwc3 *dwc);
2653 static void __dwc3_gadget_stop(struct dwc3 *dwc);
2654 static int __dwc3_gadget_start(struct dwc3 *dwc);
2656 static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc) in dwc3_gadget_soft_disconnect()
2707 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_pullup()
2717 * suspended state during gadget disconnect. DWC3 gadget was already in dwc3_gadget_pullup()
2728 * successful resume, the DWC3 runtime PM resume routine will handle in dwc3_gadget_pullup()
2765 static void dwc3_gadget_enable_irq(struct dwc3 *dwc) in dwc3_gadget_enable_irq()
2778 if (DWC3_VER_IS_PRIOR(DWC3, 250A)) in dwc3_gadget_enable_irq()
2782 if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) in dwc3_gadget_enable_irq()
2788 static void dwc3_gadget_disable_irq(struct dwc3 *dwc) in dwc3_gadget_disable_irq()
2818 static void dwc3_gadget_setup_nump(struct dwc3 *dwc) in dwc3_gadget_setup_nump()
2838 static int __dwc3_gadget_start(struct dwc3 *dwc) in __dwc3_gadget_start()
2845 * If the DWC3 is in runtime suspend, the clocks maybe in __dwc3_gadget_start()
2846 * disabled, so avoid enable the DWC3 endpoints here. in __dwc3_gadget_start()
2847 * The DWC3 runtime PM resume routine will handle the in __dwc3_gadget_start()
2865 * We are telling dwc3 that we want to use DCFG.NUMP as ACK TP's NUMP in __dwc3_gadget_start()
2866 * field instead of letting dwc3 itself calculate that automatically. in __dwc3_gadget_start()
2872 if (DWC3_IP_IS(DWC3)) in __dwc3_gadget_start()
2932 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_start()
2939 IRQF_SHARED, "dwc3", dwc->ev_buf); in dwc3_gadget_start()
2968 static void __dwc3_gadget_stop(struct dwc3 *dwc) in __dwc3_gadget_stop()
2977 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_stop()
3000 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_config_params()
3039 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_set_speed()
3050 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_set_ssp_rate()
3061 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_vbus_draw()
3078 * dwc3_gadget_check_config - ensure dwc3 can support the USB configuration
3089 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_check_config()
3124 struct dwc3 *dwc = gadget_to_dwc(g); in dwc3_gadget_async_callbacks()
3151 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_init_control_endpoint()
3166 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_init_in_endpoint()
3177 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_init_in_endpoint()
3185 * DWC3 revision 280A and prior: in dwc3_gadget_init_in_endpoint()
3189 * DWC3 revision 290A and onwards: in dwc3_gadget_init_in_endpoint()
3193 if (DWC3_VER_IS_PRIOR(DWC3, 290A)) in dwc3_gadget_init_in_endpoint()
3232 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_init_out_endpoint()
3243 if (DWC3_IP_IS(DWC3)) in dwc3_gadget_init_out_endpoint()
3277 static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum) in dwc3_gadget_init_endpoint()
3339 static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total) in dwc3_gadget_init_endpoints()
3356 static void dwc3_gadget_free_endpoints(struct dwc3 *dwc) in dwc3_gadget_free_endpoints()
3372 * with all sorts of bugs when removing dwc3.ko. in dwc3_gadget_free_endpoints()
3399 * receive a short transfer along the way, DWC3 will skip in dwc3_gadget_ep_reclaim_completed_trb()
3401 * where CHN bit is zero. DWC3 will also avoid clearing HWO in dwc3_gadget_ep_reclaim_completed_trb()
3499 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_cleanup_completed_request()
3602 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep_should_continue()
3631 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_endpoint_trbs_complete()
3679 if (DWC3_VER_IS_PRIOR(DWC3, 183A)) { in dwc3_gadget_endpoint_trbs_complete()
3777 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_endpoint_command_complete()
3805 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_endpoint_stream_event()
3866 static void dwc3_endpoint_interrupt(struct dwc3 *dwc, in dwc3_endpoint_interrupt()
3910 static void dwc3_disconnect_gadget(struct dwc3 *dwc) in dwc3_disconnect_gadget()
3919 static void dwc3_suspend_gadget(struct dwc3 *dwc) in dwc3_suspend_gadget()
3928 static void dwc3_resume_gadget(struct dwc3 *dwc) in dwc3_resume_gadget()
3937 static void dwc3_reset_gadget(struct dwc3 *dwc) in dwc3_reset_gadget()
3952 struct dwc3 *dwc = dep->dwc; in dwc3_stop_active_transfer()
4011 static void dwc3_clear_stall_all_ep(struct dwc3 *dwc) in dwc3_clear_stall_all_ep()
4033 static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc) in dwc3_gadget_disconnect_interrupt()
4064 static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) in dwc3_gadget_reset_interrupt()
4078 * WORKAROUND: DWC3 revisions <1.88a have an issue which in dwc3_gadget_reset_interrupt()
4103 if (DWC3_VER_IS_PRIOR(DWC3, 188A)) { in dwc3_gadget_reset_interrupt()
4151 static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) in dwc3_gadget_conndone_interrupt()
4194 * WORKAROUND: DWC3 revisions <1.90a have an issue which in dwc3_gadget_conndone_interrupt()
4206 if (DWC3_VER_IS_PRIOR(DWC3, 190A)) in dwc3_gadget_conndone_interrupt()
4239 if (!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A) && in dwc3_gadget_conndone_interrupt()
4254 * When dwc3 revisions >= 2.40a, LPM Erratum is enabled and in dwc3_gadget_conndone_interrupt()
4259 WARN_ONCE(DWC3_VER_IS_PRIOR(DWC3, 240A) && dwc->has_lpm_erratum, in dwc3_gadget_conndone_interrupt()
4260 "LPM Erratum not available on dwc3 revisions < 2.40a\n"); in dwc3_gadget_conndone_interrupt()
4262 if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) in dwc3_gadget_conndone_interrupt()
4301 static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc) in dwc3_gadget_wakeup_interrupt()
4315 static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc, in dwc3_gadget_linksts_change_interrupt()
4322 * WORKAROUND: DWC3 < 2.50a have an issue when configured without in dwc3_gadget_linksts_change_interrupt()
4339 if (DWC3_VER_IS_PRIOR(DWC3, 250A) && in dwc3_gadget_linksts_change_interrupt()
4348 * WORKAROUND: DWC3 Revisions <1.83a have an issue which, depending in dwc3_gadget_linksts_change_interrupt()
4365 if (DWC3_VER_IS_PRIOR(DWC3, 183A)) { in dwc3_gadget_linksts_change_interrupt()
4413 static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc, in dwc3_gadget_suspend_interrupt()
4424 static void dwc3_gadget_hibernation_interrupt(struct dwc3 *dwc, in dwc3_gadget_hibernation_interrupt()
4430 * WORKAROUND: DWC3 revison 2.20a with hibernation support in dwc3_gadget_hibernation_interrupt()
4448 static void dwc3_gadget_interrupt(struct dwc3 *dwc, in dwc3_gadget_interrupt()
4478 if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) { in dwc3_gadget_interrupt()
4498 static void dwc3_process_event_entry(struct dwc3 *dwc, in dwc3_process_event_entry()
4513 struct dwc3 *dwc = evt->dwc; in dwc3_process_event_buf()
4563 struct dwc3 *dwc = evt->dwc; in dwc3_thread_interrupt()
4578 struct dwc3 *dwc = evt->dwc; in dwc3_check_event_buf()
4628 static int dwc3_gadget_get_irq(struct dwc3 *dwc) in dwc3_gadget_get_irq()
4671 int dwc3_gadget_init(struct dwc3 *dwc) in dwc3_gadget_init()
4722 dwc->gadget->name = "dwc3-gadget"; in dwc3_gadget_init()
4727 * <2.20a of dwc3 have an issue with metastability (documented in dwc3_gadget_init()
4732 * drivers (i.e. it won't go into dwc3's registers) we are allowing this in dwc3_gadget_init()
4741 if (DWC3_VER_IS_PRIOR(DWC3, 220A) && in dwc3_gadget_init()
4793 void dwc3_gadget_exit(struct dwc3 *dwc) in dwc3_gadget_exit()
4808 int dwc3_gadget_suspend(struct dwc3 *dwc) in dwc3_gadget_suspend()
4825 int dwc3_gadget_resume(struct dwc3 *dwc) in dwc3_gadget_resume()
4850 void dwc3_gadget_process_pending_events(struct dwc3 *dwc) in dwc3_gadget_process_pending_events()