#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include <linux/interrupt.h>
#include <linux/property.h>
#include <linux/dmapool.h>
#include <linux/iopoll.h>
#include "cdns2-gadget.h"
#include "cdns2-trace.h"
static void set_reg_bit_32(void __iomem *ptr, u32 mask)
{ … }
static void clear_reg_bit_32(void __iomem *ptr, u32 mask)
{ … }
static void clear_reg_bit_8(void __iomem *ptr, u8 mask)
{ … }
void set_reg_bit_8(void __iomem *ptr, u8 mask)
{ … }
static int cdns2_get_dma_pos(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
struct cdns2_request *cdns2_next_preq(struct list_head *list)
{ … }
void cdns2_select_ep(struct cdns2_device *pdev, u32 ep)
{ … }
dma_addr_t cdns2_trb_virt_to_dma(struct cdns2_endpoint *pep,
struct cdns2_trb *trb)
{ … }
static void cdns2_free_tr_segment(struct cdns2_endpoint *pep)
{ … }
static int cdns2_alloc_tr_segment(struct cdns2_endpoint *pep)
{ … }
static void cdns2_ep_stall_flush(struct cdns2_endpoint *pep)
{ … }
static void cdns2_ep_inc_trb(int *index, u8 *cs, int trb_in_seg)
{ … }
static void cdns2_ep_inc_enq(struct cdns2_ring *ring)
{ … }
static void cdns2_ep_inc_deq(struct cdns2_ring *ring)
{ … }
static void cdns2_enable_l1(struct cdns2_device *pdev, int enable)
{ … }
static enum usb_device_speed cdns2_get_speed(struct cdns2_device *pdev)
{ … }
static struct cdns2_trb *cdns2_next_trb(struct cdns2_endpoint *pep,
struct cdns2_trb *trb)
{ … }
void cdns2_gadget_giveback(struct cdns2_endpoint *pep,
struct cdns2_request *preq,
int status)
{ … }
static void cdns2_wa1_restore_cycle_bit(struct cdns2_endpoint *pep)
{ … }
static int cdns2_wa1_update_guard(struct cdns2_endpoint *pep,
struct cdns2_trb *trb)
{ … }
static void cdns2_wa1_tray_restore_cycle_bit(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
static int cdns2_prepare_ring(struct cdns2_device *pdev,
struct cdns2_endpoint *pep,
int num_trbs)
{ … }
static void cdns2_dbg_request_trbs(struct cdns2_endpoint *pep,
struct cdns2_request *preq)
{ … }
static unsigned int cdns2_count_trbs(struct cdns2_endpoint *pep,
u64 addr, u64 len)
{ … }
static unsigned int cdns2_count_sg_trbs(struct cdns2_endpoint *pep,
struct usb_request *req)
{ … }
static void cdsn2_isoc_burst_opt(struct cdns2_device *pdev)
{ … }
static void cdns2_ep_tx_isoc(struct cdns2_endpoint *pep,
struct cdns2_request *preq,
int num_trbs)
{ … }
static void cdns2_ep_tx_bulk(struct cdns2_endpoint *pep,
struct cdns2_request *preq,
int trbs_per_td)
{ … }
static void cdns2_set_drdy(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
static int cdns2_prepare_first_isoc_transfer(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
static int cdns2_ep_run_transfer(struct cdns2_endpoint *pep,
struct cdns2_request *preq)
{ … }
static int cdns2_start_all_request(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
static bool cdns2_trb_handled(struct cdns2_endpoint *pep,
struct cdns2_request *preq)
{ … }
static void cdns2_skip_isoc_td(struct cdns2_device *pdev,
struct cdns2_endpoint *pep,
struct cdns2_request *preq)
{ … }
static void cdns2_transfer_completed(struct cdns2_device *pdev,
struct cdns2_endpoint *pep)
{ … }
static void cdns2_wakeup(struct cdns2_device *pdev)
{ … }
static void cdns2_rearm_transfer(struct cdns2_endpoint *pep, u8 rearm)
{ … }
static void cdns2_handle_epx_interrupt(struct cdns2_endpoint *pep)
{ … }
static void cdns2_disconnect_gadget(struct cdns2_device *pdev)
{ … }
static irqreturn_t cdns2_usb_irq_handler(int irq, void *data)
{ … }
static irqreturn_t cdns2_thread_usb_irq_handler(struct cdns2_device *pdev)
{ … }
static irqreturn_t cdns2_thread_irq_handler(int irq, void *data)
{ … }
static void cdns2_eps_onchip_buffer_init(struct cdns2_device *pdev)
{ … }
static int cdns2_ep_config(struct cdns2_endpoint *pep, bool enable)
{ … }
struct usb_request *cdns2_gadget_ep_alloc_request(struct usb_ep *ep,
gfp_t gfp_flags)
{ … }
void cdns2_gadget_ep_free_request(struct usb_ep *ep,
struct usb_request *request)
{ … }
static int cdns2_gadget_ep_enable(struct usb_ep *ep,
const struct usb_endpoint_descriptor *desc)
{ … }
static int cdns2_gadget_ep_disable(struct usb_ep *ep)
{ … }
static int cdns2_ep_enqueue(struct cdns2_endpoint *pep,
struct cdns2_request *preq,
gfp_t gfp_flags)
{ … }
static int cdns2_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
gfp_t gfp_flags)
{ … }
int cdns2_gadget_ep_dequeue(struct usb_ep *ep,
struct usb_request *request)
{ … }
int cdns2_halt_endpoint(struct cdns2_device *pdev,
struct cdns2_endpoint *pep,
int value)
{ … }
static int cdns2_gadget_ep_set_halt(struct usb_ep *ep, int value)
{ … }
static int cdns2_gadget_ep_set_wedge(struct usb_ep *ep)
{ … }
static struct
cdns2_endpoint *cdns2_find_available_ep(struct cdns2_device *pdev,
struct usb_endpoint_descriptor *desc)
{ … }
static struct
usb_ep *cdns2_gadget_match_ep(struct usb_gadget *gadget,
struct usb_endpoint_descriptor *desc,
struct usb_ss_ep_comp_descriptor *comp_desc)
{ … }
static const struct usb_ep_ops cdns2_gadget_ep_ops = …;
static int cdns2_gadget_get_frame(struct usb_gadget *gadget)
{ … }
static int cdns2_gadget_wakeup(struct usb_gadget *gadget)
{ … }
static int cdns2_gadget_set_selfpowered(struct usb_gadget *gadget,
int is_selfpowered)
{ … }
static void cdns2_quiesce(struct cdns2_device *pdev)
{ … }
static void cdns2_gadget_config(struct cdns2_device *pdev)
{ … }
static int cdns2_gadget_pullup(struct usb_gadget *gadget, int is_on)
{ … }
static int cdns2_gadget_udc_start(struct usb_gadget *gadget,
struct usb_gadget_driver *driver)
{ … }
static int cdns2_gadget_udc_stop(struct usb_gadget *gadget)
{ … }
static const struct usb_gadget_ops cdns2_gadget_ops = …;
static void cdns2_free_all_eps(struct cdns2_device *pdev)
{ … }
static int cdns2_init_eps(struct cdns2_device *pdev)
{ … }
static int cdns2_gadget_start(struct cdns2_device *pdev)
{ … }
int cdns2_gadget_suspend(struct cdns2_device *pdev)
{ … }
int cdns2_gadget_resume(struct cdns2_device *pdev, bool hibernated)
{ … }
void cdns2_gadget_remove(struct cdns2_device *pdev)
{ … }
int cdns2_gadget_init(struct cdns2_device *pdev)
{ … }