linux/drivers/usb/gadget/udc/renesas_usb3.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Renesas USB3.0 Peripheral driver (USB gadget)
 *
 * Copyright (C) 2015-2017  Renesas Electronics Corporation
 */

#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/extcon-provider.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/of.h>
#include <linux/usb/role.h>
#include <linux/usb/rzv2m_usb3drd.h>

/* register definitions */
#define USB3_AXI_INT_STA
#define USB3_AXI_INT_ENA
#define USB3_DMA_INT_STA
#define USB3_DMA_INT_ENA
#define USB3_DMA_CH0_CON(n)
#define USB3_DMA_CH0_PRD_ADR(n)
#define USB3_USB_COM_CON
#define USB3_USB20_CON
#define USB3_USB30_CON
#define USB3_USB_STA
#define USB3_DRD_CON(p)
#define USB3_USB_INT_STA_1
#define USB3_USB_INT_STA_2
#define USB3_USB_INT_ENA_1
#define USB3_USB_INT_ENA_2
#define USB3_STUP_DAT_0
#define USB3_STUP_DAT_1
#define USB3_USB_OTG_STA(p)
#define USB3_USB_OTG_INT_STA(p)
#define USB3_USB_OTG_INT_ENA(p)
#define USB3_P0_MOD
#define USB3_P0_CON
#define USB3_P0_STA
#define USB3_P0_INT_STA
#define USB3_P0_INT_ENA
#define USB3_P0_LNG
#define USB3_P0_READ
#define USB3_P0_WRITE
#define USB3_PIPE_COM
#define USB3_PN_MOD
#define USB3_PN_RAMMAP
#define USB3_PN_CON
#define USB3_PN_STA
#define USB3_PN_INT_STA
#define USB3_PN_INT_ENA
#define USB3_PN_LNG
#define USB3_PN_READ
#define USB3_PN_WRITE
#define USB3_SSIFCMD

/* AXI_INT_ENA and AXI_INT_STA */
#define AXI_INT_DMAINT
#define AXI_INT_EPCINT
/* PRD's n = from 1 to 4 */
#define AXI_INT_PRDEN_CLR_STA_SHIFT(n)
#define AXI_INT_PRDERR_STA_SHIFT(n)
#define AXI_INT_PRDEN_CLR_STA(n)
#define AXI_INT_PRDERR_STA(n)

/* DMA_INT_ENA and DMA_INT_STA */
#define DMA_INT(n)

/* DMA_CH0_CONn */
#define DMA_CON_PIPE_DIR
#define DMA_CON_PIPE_NO_SHIFT
#define DMA_CON_PIPE_NO_MASK
#define DMA_COM_PIPE_NO(n)
#define DMA_CON_PRD_EN

/* LCLKSEL */
#define LCLKSEL_LSEL

/* USB_COM_CON */
#define USB_COM_CON_CONF
#define USB_COM_CON_PN_WDATAIF_NL
#define USB_COM_CON_PN_RDATAIF_NL
#define USB_COM_CON_PN_LSTTR_PP
#define USB_COM_CON_SPD_MODE
#define USB_COM_CON_EP0_EN
#define USB_COM_CON_DEV_ADDR_SHIFT
#define USB_COM_CON_DEV_ADDR_MASK
#define USB_COM_CON_DEV_ADDR(n)
#define USB_COM_CON_RX_DETECTION
#define USB_COM_CON_PIPE_CLR

/* USB20_CON */
#define USB20_CON_B2_PUE
#define USB20_CON_B2_SUSPEND
#define USB20_CON_B2_CONNECT
#define USB20_CON_B2_TSTMOD_SHIFT
#define USB20_CON_B2_TSTMOD_MASK
#define USB20_CON_B2_TSTMOD(n)
#define USB20_CON_B2_TSTMOD_EN

/* USB30_CON */
#define USB30_CON_POW_SEL_SHIFT
#define USB30_CON_POW_SEL_MASK
#define USB30_CON_POW_SEL_IN_U3
#define USB30_CON_POW_SEL_IN_DISCON
#define USB30_CON_POW_SEL_P2_TO_P0
#define USB30_CON_POW_SEL_P0_TO_P3
#define USB30_CON_POW_SEL_P0_TO_P2
#define USB30_CON_B3_PLLWAKE
#define USB30_CON_B3_CONNECT
#define USB30_CON_B3_HOTRST_CMP

/* USB_STA */
#define USB_STA_SPEED_MASK
#define USB_STA_SPEED_HS
#define USB_STA_SPEED_FS
#define USB_STA_SPEED_SS
#define USB_STA_VBUS_STA

/* DRD_CON */
#define DRD_CON_PERI_RST
#define DRD_CON_HOST_RST
#define DRD_CON_PERI_CON
#define DRD_CON_VBOUT

/* USB_INT_ENA_1 and USB_INT_STA_1 */
#define USB_INT_1_B3_PLLWKUP
#define USB_INT_1_B3_LUPSUCS
#define USB_INT_1_B3_DISABLE
#define USB_INT_1_B3_WRMRST
#define USB_INT_1_B3_HOTRST
#define USB_INT_1_B2_USBRST
#define USB_INT_1_B2_L1SPND
#define USB_INT_1_B2_SPND
#define USB_INT_1_B2_RSUM
#define USB_INT_1_SPEED
#define USB_INT_1_VBUS_CNG

/* USB_INT_ENA_2 and USB_INT_STA_2 */
#define USB_INT_2_PIPE(n)

/* USB_OTG_STA, USB_OTG_INT_STA and USB_OTG_INT_ENA */
#define USB_OTG_IDMON(p)

/* P0_MOD */
#define P0_MOD_DIR

/* P0_CON and PN_CON */
#define PX_CON_BYTE_EN_MASK
#define PX_CON_BYTE_EN_SHIFT
#define PX_CON_BYTE_EN_BYTES(n)
#define PX_CON_SEND

/* P0_CON */
#define P0_CON_ST_RES_MASK
#define P0_CON_ST_RES_FORCE_STALL
#define P0_CON_ST_RES_NORMAL
#define P0_CON_ST_RES_FORCE_NRDY
#define P0_CON_OT_RES_MASK
#define P0_CON_OT_RES_FORCE_STALL
#define P0_CON_OT_RES_NORMAL
#define P0_CON_OT_RES_FORCE_NRDY
#define P0_CON_IN_RES_MASK
#define P0_CON_IN_RES_FORCE_STALL
#define P0_CON_IN_RES_NORMAL
#define P0_CON_IN_RES_FORCE_NRDY
#define P0_CON_RES_WEN
#define P0_CON_BCLR

/* P0_STA and PN_STA */
#define PX_STA_BUFSTS

/* P0_INT_ENA and P0_INT_STA */
#define P0_INT_STSED
#define P0_INT_STSST
#define P0_INT_SETUP
#define P0_INT_RCVNL
#define P0_INT_ERDY
#define P0_INT_FLOW
#define P0_INT_STALL
#define P0_INT_NRDY
#define P0_INT_BFRDY
#define P0_INT_ALL_BITS

/* PN_MOD */
#define PN_MOD_DIR
#define PN_MOD_TYPE_SHIFT
#define PN_MOD_TYPE_MASK
#define PN_MOD_TYPE(n)
#define PN_MOD_EPNUM_MASK
#define PN_MOD_EPNUM(n)

/* PN_RAMMAP */
#define PN_RAMMAP_RAMAREA_SHIFT
#define PN_RAMMAP_RAMAREA_MASK
#define PN_RAMMAP_RAMAREA_16KB
#define PN_RAMMAP_RAMAREA_8KB
#define PN_RAMMAP_RAMAREA_4KB
#define PN_RAMMAP_RAMAREA_2KB
#define PN_RAMMAP_RAMAREA_1KB
#define PN_RAMMAP_MPKT_SHIFT
#define PN_RAMMAP_MPKT_MASK
#define PN_RAMMAP_MPKT(n)
#define PN_RAMMAP_RAMIF_SHIFT
#define PN_RAMMAP_RAMIF_MASK
#define PN_RAMMAP_RAMIF(n)
#define PN_RAMMAP_BASEAD_MASK
#define PN_RAMMAP_BASEAD(offs)
#define PN_RAMMAP_DATA(area, ramif, basead)

/* PN_CON */
#define PN_CON_EN
#define PN_CON_DATAIF_EN
#define PN_CON_RES_MASK
#define PN_CON_RES_FORCE_STALL
#define PN_CON_RES_NORMAL
#define PN_CON_RES_FORCE_NRDY
#define PN_CON_LAST
#define PN_CON_RES_WEN
#define PN_CON_CLR

/* PN_INT_STA and PN_INT_ENA */
#define PN_INT_LSTTR
#define PN_INT_BFRDY

/* USB3_SSIFCMD */
#define SSIFCMD_URES_U2
#define SSIFCMD_URES_U1
#define SSIFCMD_UDIR_U2
#define SSIFCMD_UDIR_U1
#define SSIFCMD_UREQ_U2
#define SSIFCMD_UREQ_U1

#define USB3_EP0_SS_MAX_PACKET_SIZE
#define USB3_EP0_HSFS_MAX_PACKET_SIZE
#define USB3_EP0_BUF_SIZE
#define USB3_MAX_NUM_PIPES(p)
#define USB3_WAIT_US
#define USB3_DMA_NUM_SETTING_AREA
/*
 * To avoid double-meaning of "0" (xferred 65536 bytes or received zlp if
 * buffer size is 65536), this driver uses the maximum size per a entry is
 * 32768 bytes.
 */
#define USB3_DMA_MAX_XFER_SIZE
#define USB3_DMA_PRD_SIZE

struct renesas_usb3;

/* Physical Region Descriptor Table */
struct renesas_usb3_prd {};
#define USB3_DMA_NUM_PRD_ENTRIES
#define USB3_DMA_MAX_XFER_SIZE_ALL_PRDS

struct renesas_usb3_dma {};

struct renesas_usb3_request {};

#define USB3_EP_NAME_SIZE
struct renesas_usb3_ep {};

struct renesas_usb3_priv {};

struct renesas_usb3 {};

#define gadget_to_renesas_usb3(_gadget)
#define renesas_usb3_to_gadget(renesas_usb3)
#define usb3_to_dev(_usb3)

#define usb_ep_to_usb3_ep(_ep)
#define usb3_ep_to_usb3(_usb3_ep)
#define usb_req_to_usb3_req(_req)

#define usb3_get_ep(usb3, n)
#define usb3_for_each_ep(usb3_ep, usb3, i)

#define usb3_get_dma(usb3, i)
#define usb3_for_each_dma(usb3, dma, i)

static const char udc_name[] =;

static bool use_dma =;
module_param(use_dma, bool, 0644);
MODULE_PARM_DESC();

static void usb3_write(struct renesas_usb3 *usb3, u32 data, u32 offs)
{}

static u32 usb3_read(struct renesas_usb3 *usb3, u32 offs)
{}

static void usb3_set_bit(struct renesas_usb3 *usb3, u32 bits, u32 offs)
{}

static void usb3_clear_bit(struct renesas_usb3 *usb3, u32 bits, u32 offs)
{}

static void usb3_drd_write(struct renesas_usb3 *usb3, u32 data, u32 offs)
{}

static u32 usb3_drd_read(struct renesas_usb3 *usb3, u32 offs)
{}

static void usb3_drd_set_bit(struct renesas_usb3 *usb3, u32 bits, u32 offs)
{}

static void usb3_drd_clear_bit(struct renesas_usb3 *usb3, u32 bits, u32 offs)
{}

static int usb3_wait(struct renesas_usb3 *usb3, u32 reg, u32 mask,
		     u32 expected)
{}

static void renesas_usb3_extcon_work(struct work_struct *work)
{}

static void usb3_enable_irq_1(struct renesas_usb3 *usb3, u32 bits)
{}

static void usb3_disable_irq_1(struct renesas_usb3 *usb3, u32 bits)
{}

static void usb3_enable_pipe_irq(struct renesas_usb3 *usb3, int num)
{}

static void usb3_disable_pipe_irq(struct renesas_usb3 *usb3, int num)
{}

static bool usb3_is_host(struct renesas_usb3 *usb3)
{}

static void usb3_init_axi_bridge(struct renesas_usb3 *usb3)
{}

static void usb3_init_epc_registers(struct renesas_usb3 *usb3)
{}

static bool usb3_wakeup_usb2_phy(struct renesas_usb3 *usb3)
{}

static void usb3_usb2_pullup(struct renesas_usb3 *usb3, int pullup)
{}

static void usb3_set_test_mode(struct renesas_usb3 *usb3)
{}

static void usb3_start_usb2_connection(struct renesas_usb3 *usb3)
{}

static int usb3_is_usb3_phy_in_u3(struct renesas_usb3 *usb3)
{}

static bool usb3_wakeup_usb3_phy(struct renesas_usb3 *usb3)
{}

static u16 usb3_feature_get_un_enabled(struct renesas_usb3 *usb3)
{}

static void usb3_feature_u2_enable(struct renesas_usb3 *usb3, bool enable)
{}

static void usb3_feature_u1_enable(struct renesas_usb3 *usb3, bool enable)
{}

static void usb3_start_operation_for_usb3(struct renesas_usb3 *usb3)
{}

static void usb3_start_usb3_connection(struct renesas_usb3 *usb3)
{}

static void usb3_stop_usb3_connection(struct renesas_usb3 *usb3)
{}

static void usb3_transition_to_default_state(struct renesas_usb3 *usb3,
					     bool is_usb3)
{}

static void usb3_connect(struct renesas_usb3 *usb3)
{}

static void usb3_reset_epc(struct renesas_usb3 *usb3)
{}

static void usb3_disconnect(struct renesas_usb3 *usb3)
{}

static void usb3_check_vbus(struct renesas_usb3 *usb3)
{}

static void renesas_usb3_role_work(struct work_struct *work)
{}

static void usb3_set_mode(struct renesas_usb3 *usb3, bool host)
{}

static void usb3_set_mode_by_role_sw(struct renesas_usb3 *usb3, bool host)
{}

static void usb3_vbus_out(struct renesas_usb3 *usb3, bool enable)
{}

static void usb3_mode_config(struct renesas_usb3 *usb3, bool host, bool a_dev)
{}

static bool usb3_is_a_device(struct renesas_usb3 *usb3)
{}

static void usb3_check_id(struct renesas_usb3 *usb3)
{}

static void renesas_usb3_init_controller(struct renesas_usb3 *usb3)
{}

static void renesas_usb3_stop_controller(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_pll_wakeup(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_linkup_success(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_resume(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_suspend(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_disable(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_bus_reset(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_vbus_change(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_hot_reset(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_warm_reset(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1_speed(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_int_1(struct renesas_usb3 *usb3, u32 int_sta_1)
{}

static struct renesas_usb3_request *__usb3_get_request(struct renesas_usb3_ep
						       *usb3_ep)
{}

static struct renesas_usb3_request *usb3_get_request(struct renesas_usb3_ep
						     *usb3_ep)
{}

static void __usb3_request_done(struct renesas_usb3_ep *usb3_ep,
				struct renesas_usb3_request *usb3_req,
				int status)
{}

static void usb3_request_done(struct renesas_usb3_ep *usb3_ep,
			      struct renesas_usb3_request *usb3_req, int status)
{}

static void usb3_irq_epc_pipe0_status_end(struct renesas_usb3 *usb3)
{}

static void usb3_get_setup_data(struct renesas_usb3 *usb3,
				struct usb_ctrlrequest *ctrl)
{}

static void usb3_set_p0_con_update_res(struct renesas_usb3 *usb3, u32 res)
{}

static void usb3_set_p0_con_for_ctrl_read_data(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_for_ctrl_read_status(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_for_ctrl_write_data(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_for_ctrl_write_status(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_for_no_data(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_stall(struct renesas_usb3 *usb3)
{}

static void usb3_set_p0_con_stop(struct renesas_usb3 *usb3)
{}

static int usb3_pn_change(struct renesas_usb3 *usb3, int num)
{}

static void usb3_set_pn_con_update_res(struct renesas_usb3 *usb3, u32 res)
{}

static void usb3_pn_start(struct renesas_usb3 *usb3)
{}

static void usb3_pn_stop(struct renesas_usb3 *usb3)
{}

static void usb3_pn_stall(struct renesas_usb3 *usb3)
{}

static int usb3_pn_con_clear(struct renesas_usb3 *usb3)
{}

static bool usb3_is_transfer_complete(struct renesas_usb3_ep *usb3_ep,
				      struct renesas_usb3_request *usb3_req)
{}

static int usb3_wait_pipe_status(struct renesas_usb3_ep *usb3_ep, u32 mask)
{}

static void usb3_set_px_con_send(struct renesas_usb3_ep *usb3_ep, int bytes,
				 bool last)
{}

static int usb3_write_pipe(struct renesas_usb3_ep *usb3_ep,
			   struct renesas_usb3_request *usb3_req,
			   u32 fifo_reg)
{}

static u32 usb3_get_received_length(struct renesas_usb3_ep *usb3_ep)
{}

static int usb3_read_pipe(struct renesas_usb3_ep *usb3_ep,
			  struct renesas_usb3_request *usb3_req, u32 fifo_reg)
{}

static void usb3_set_status_stage(struct renesas_usb3_ep *usb3_ep,
				  struct renesas_usb3_request *usb3_req)
{}

static void usb3_p0_xfer(struct renesas_usb3_ep *usb3_ep,
			 struct renesas_usb3_request *usb3_req)
{}

static void usb3_start_pipe0(struct renesas_usb3_ep *usb3_ep,
			     struct renesas_usb3_request *usb3_req)
{}

static void usb3_enable_dma_pipen(struct renesas_usb3 *usb3)
{}

static void usb3_disable_dma_pipen(struct renesas_usb3 *usb3)
{}

static void usb3_enable_dma_irq(struct renesas_usb3 *usb3, int num)
{}

static void usb3_disable_dma_irq(struct renesas_usb3 *usb3, int num)
{}

static u32 usb3_dma_mps_to_prd_word1(struct renesas_usb3_ep *usb3_ep)
{}

static bool usb3_dma_get_setting_area(struct renesas_usb3_ep *usb3_ep,
				      struct renesas_usb3_request *usb3_req)
{}

static void usb3_dma_put_setting_area(struct renesas_usb3_ep *usb3_ep,
				      struct renesas_usb3_request *usb3_req)
{}

static void usb3_dma_fill_prd(struct renesas_usb3_ep *usb3_ep,
			      struct renesas_usb3_request *usb3_req)
{}

static void usb3_dma_kick_prd(struct renesas_usb3_ep *usb3_ep)
{}

static void usb3_dma_stop_prd(struct renesas_usb3_ep *usb3_ep)
{}

static int usb3_dma_update_status(struct renesas_usb3_ep *usb3_ep,
				  struct renesas_usb3_request *usb3_req)
{}

static bool usb3_dma_try_start(struct renesas_usb3_ep *usb3_ep,
			       struct renesas_usb3_request *usb3_req)
{}

static int usb3_dma_try_stop(struct renesas_usb3_ep *usb3_ep,
			     struct renesas_usb3_request *usb3_req)
{}

static int renesas_usb3_dma_free_prd(struct renesas_usb3 *usb3,
				     struct device *dev)
{}

static int renesas_usb3_dma_alloc_prd(struct renesas_usb3 *usb3,
				      struct device *dev)
{}

static void usb3_start_pipen(struct renesas_usb3_ep *usb3_ep,
			     struct renesas_usb3_request *usb3_req)
{}

static int renesas_usb3_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
				 gfp_t gfp_flags)
{}

static void usb3_set_device_address(struct renesas_usb3 *usb3, u16 addr)
{}

static bool usb3_std_req_set_address(struct renesas_usb3 *usb3,
				     struct usb_ctrlrequest *ctrl)
{}

static void usb3_pipe0_internal_xfer(struct renesas_usb3 *usb3,
				     void *tx_data, size_t len,
				     void (*complete)(struct usb_ep *ep,
						      struct usb_request *req))
{}

static void usb3_pipe0_get_status_completion(struct usb_ep *ep,
					     struct usb_request *req)
{}

static bool usb3_std_req_get_status(struct renesas_usb3 *usb3,
				    struct usb_ctrlrequest *ctrl)
{}

static bool usb3_std_req_feature_device(struct renesas_usb3 *usb3,
					struct usb_ctrlrequest *ctrl, bool set)
{}

static int usb3_set_halt_p0(struct renesas_usb3_ep *usb3_ep, bool halt)
{}

static int usb3_set_halt_pn(struct renesas_usb3_ep *usb3_ep, bool halt,
			    bool is_clear_feature)
{}

static int usb3_set_halt(struct renesas_usb3_ep *usb3_ep, bool halt,
			 bool is_clear_feature)
{}

static bool usb3_std_req_feature_endpoint(struct renesas_usb3 *usb3,
					  struct usb_ctrlrequest *ctrl,
					  bool set)
{}

static bool usb3_std_req_feature(struct renesas_usb3 *usb3,
				 struct usb_ctrlrequest *ctrl, bool set)
{}

static void usb3_pipe0_set_sel_completion(struct usb_ep *ep,
					  struct usb_request *req)
{}

static bool usb3_std_req_set_sel(struct renesas_usb3 *usb3,
				 struct usb_ctrlrequest *ctrl)
{}

static bool usb3_std_req_set_configuration(struct renesas_usb3 *usb3,
					   struct usb_ctrlrequest *ctrl)
{}

/**
 * usb3_handle_standard_request - handle some standard requests
 * @usb3: the renesas_usb3 pointer
 * @ctrl: a pointer of setup data
 *
 * Returns true if this function handled a standard request
 */
static bool usb3_handle_standard_request(struct renesas_usb3 *usb3,
					 struct usb_ctrlrequest *ctrl)
{}

static int usb3_p0_con_clear_buffer(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_pipe0_setup(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_pipe0_bfrdy(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc_pipe0(struct renesas_usb3 *usb3)
{}

static void usb3_request_done_pipen(struct renesas_usb3 *usb3,
				    struct renesas_usb3_ep *usb3_ep,
				    struct renesas_usb3_request *usb3_req,
				    int status)
{}

static void usb3_irq_epc_pipen_lsttr(struct renesas_usb3 *usb3, int num)
{}

static void usb3_irq_epc_pipen_bfrdy(struct renesas_usb3 *usb3, int num)
{}

static void usb3_irq_epc_pipen(struct renesas_usb3 *usb3, int num)
{}

static void usb3_irq_epc_int_2(struct renesas_usb3 *usb3, u32 int_sta_2)
{}

static void usb3_irq_idmon_change(struct renesas_usb3 *usb3)
{}

static void usb3_irq_otg_int(struct renesas_usb3 *usb3)
{}

static void usb3_irq_epc(struct renesas_usb3 *usb3)
{}

static void usb3_irq_dma_int(struct renesas_usb3 *usb3, u32 dma_sta)
{}

static void usb3_irq_dma(struct renesas_usb3 *usb3)
{}

static irqreturn_t renesas_usb3_irq(int irq, void *_usb3)
{}

static irqreturn_t renesas_usb3_otg_irq(int irq, void *_usb3)
{}

static void usb3_write_pn_mod(struct renesas_usb3_ep *usb3_ep,
			      const struct usb_endpoint_descriptor *desc)
{}

static u32 usb3_calc_ramarea(int ram_size)
{}

static u32 usb3_calc_rammap_val(struct renesas_usb3_ep *usb3_ep,
				const struct usb_endpoint_descriptor *desc)
{}

static int usb3_enable_pipe_n(struct renesas_usb3_ep *usb3_ep,
			      const struct usb_endpoint_descriptor *desc)
{}

static int usb3_disable_pipe_n(struct renesas_usb3_ep *usb3_ep)
{}

/*------- usb_ep_ops -----------------------------------------------------*/
static int renesas_usb3_ep_enable(struct usb_ep *_ep,
				  const struct usb_endpoint_descriptor *desc)
{}

static int renesas_usb3_ep_disable(struct usb_ep *_ep)
{}

static struct usb_request *__renesas_usb3_ep_alloc_request(gfp_t gfp_flags)
{}

static void __renesas_usb3_ep_free_request(struct usb_request *_req)
{}

static struct usb_request *renesas_usb3_ep_alloc_request(struct usb_ep *_ep,
							 gfp_t gfp_flags)
{}

static void renesas_usb3_ep_free_request(struct usb_ep *_ep,
					 struct usb_request *_req)
{}

static int renesas_usb3_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{}

static int renesas_usb3_ep_set_halt(struct usb_ep *_ep, int value)
{}

static int renesas_usb3_ep_set_wedge(struct usb_ep *_ep)
{}

static void renesas_usb3_ep_fifo_flush(struct usb_ep *_ep)
{}

static const struct usb_ep_ops renesas_usb3_ep_ops =;

/*------- usb_gadget_ops -------------------------------------------------*/
static int renesas_usb3_start(struct usb_gadget *gadget,
			      struct usb_gadget_driver *driver)
{}

static int renesas_usb3_stop(struct usb_gadget *gadget)
{}

static int renesas_usb3_get_frame(struct usb_gadget *_gadget)
{}

static int renesas_usb3_pullup(struct usb_gadget *gadget, int is_on)
{}

static int renesas_usb3_set_selfpowered(struct usb_gadget *gadget, int is_self)
{}

static const struct usb_gadget_ops renesas_usb3_gadget_ops =;

static enum usb_role renesas_usb3_role_switch_get(struct usb_role_switch *sw)
{}

static void handle_ext_role_switch_states(struct device *dev,
					    enum usb_role role)
{}

static void handle_role_switch_states(struct device *dev,
					    enum usb_role role)
{}

static int renesas_usb3_role_switch_set(struct usb_role_switch *sw,
					enum usb_role role)
{}

static ssize_t role_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{}

static ssize_t role_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RW(role);

static int renesas_usb3_b_device_show(struct seq_file *s, void *unused)
{}

static int renesas_usb3_b_device_open(struct inode *inode, struct file *file)
{}

static ssize_t renesas_usb3_b_device_write(struct file *file,
					   const char __user *ubuf,
					   size_t count, loff_t *ppos)
{}

static const struct file_operations renesas_usb3_b_device_fops =;

static void renesas_usb3_debugfs_init(struct renesas_usb3 *usb3,
				      struct device *dev)
{}

/*------- platform_driver ------------------------------------------------*/
static void renesas_usb3_remove(struct platform_device *pdev)
{}

static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev,
				const struct renesas_usb3_priv *priv)
{}

static void renesas_usb3_init_ram(struct renesas_usb3 *usb3, struct device *dev,
				  const struct renesas_usb3_priv *priv)
{}

static const struct renesas_usb3_priv renesas_usb3_priv_gen3 =;

static const struct renesas_usb3_priv renesas_usb3_priv_r8a77990 =;

static const struct renesas_usb3_priv renesas_usb3_priv_rzv2m =;

static const struct of_device_id usb3_of_match[] =;
MODULE_DEVICE_TABLE(of, usb3_of_match);

static const unsigned int renesas_usb3_cable[] =;

static struct usb_role_switch_desc renesas_usb3_role_switch_desc =;

static int renesas_usb3_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int renesas_usb3_suspend(struct device *dev)
{}

static int renesas_usb3_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(renesas_usb3_pm_ops, renesas_usb3_suspend,
			renesas_usb3_resume);

static struct platform_driver renesas_usb3_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_ALIAS();