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

// SPDX-License-Identifier: GPL-2.0+
/*
 * USB Gadget driver for LPC32xx
 *
 * Authors:
 *    Kevin Wells <[email protected]>
 *    Mike James
 *    Roland Stigge <[email protected]>
 *
 * Copyright (C) 2006 Philips Semiconductors
 * Copyright (C) 2009 NXP Semiconductors
 * Copyright (C) 2012 Roland Stigge
 *
 * Note: This driver is based on original work done by Mike James for
 *       the LPC3180.
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/prefetch.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/isp1301.h>

#ifdef CONFIG_USB_GADGET_DEBUG_FILES
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#endif

/*
 * USB device configuration structure
 */
usc_chg_event;
struct lpc32xx_usbd_cfg {};

/*
 * controller driver data structures
 */

/* 16 endpoints (not to be confused with 32 hardware endpoints) */
#define NUM_ENDPOINTS

/*
 * IRQ indices make reading the code a little easier
 */
#define IRQ_USB_LP
#define IRQ_USB_HP
#define IRQ_USB_DEVDMA
#define IRQ_USB_ATX

#define EP_OUT
#define EP_IN

/* Returns the interrupt mask for the selected hardware endpoint */
#define EP_MASK_SEL(ep, dir)

#define EP_INT_TYPE
#define EP_ISO_TYPE
#define EP_BLK_TYPE
#define EP_CTL_TYPE

/* EP0 states */
#define WAIT_FOR_SETUP
#define DATA_IN
#define DATA_OUT

/* DD (DMA Descriptor) structure, requires word alignment, this is already
 * defined in the LPC32XX USB device header file, but this version is slightly
 * modified to tag some work data with each DMA descriptor. */
struct lpc32xx_usbd_dd_gad {};

/*
 * Logical endpoint structure
 */
struct lpc32xx_ep {};

enum atx_type {};

/*
 * Common UDC structure
 */
struct lpc32xx_udc {};

/*
 * Endpoint request
 */
struct lpc32xx_request {};

static inline struct lpc32xx_udc *to_udc(struct usb_gadget *g)
{}

#define ep_dbg(epp, fmt, arg...)
#define ep_err(epp, fmt, arg...)
#define ep_info(epp, fmt, arg...)
#define ep_warn(epp, fmt, arg...)

#define UDCA_BUFF_SIZE

/**********************************************************************
 * USB device controller register offsets
 **********************************************************************/

#define USBD_DEVINTST(x)
#define USBD_DEVINTEN(x)
#define USBD_DEVINTCLR(x)
#define USBD_DEVINTSET(x)
#define USBD_CMDCODE(x)
#define USBD_CMDDATA(x)
#define USBD_RXDATA(x)
#define USBD_TXDATA(x)
#define USBD_RXPLEN(x)
#define USBD_TXPLEN(x)
#define USBD_CTRL(x)
#define USBD_DEVINTPRI(x)
#define USBD_EPINTST(x)
#define USBD_EPINTEN(x)
#define USBD_EPINTCLR(x)
#define USBD_EPINTSET(x)
#define USBD_EPINTPRI(x)
#define USBD_REEP(x)
#define USBD_EPIND(x)
#define USBD_EPMAXPSIZE(x)
/* DMA support registers only below */
/* Set, clear, or get enabled state of the DMA request status. If
 * enabled, an IN or OUT token will start a DMA transfer for the EP */
#define USBD_DMARST(x)
#define USBD_DMARCLR(x)
#define USBD_DMARSET(x)
/* DMA UDCA head pointer */
#define USBD_UDCAH(x)
/* EP DMA status, enable, and disable. This is used to specifically
 * enabled or disable DMA for a specific EP */
#define USBD_EPDMAST(x)
#define USBD_EPDMAEN(x)
#define USBD_EPDMADIS(x)
/* DMA master interrupts enable and pending interrupts */
#define USBD_DMAINTST(x)
#define USBD_DMAINTEN(x)
/* DMA end of transfer interrupt enable, disable, status */
#define USBD_EOTINTST(x)
#define USBD_EOTINTCLR(x)
#define USBD_EOTINTSET(x)
/* New DD request interrupt enable, disable, status */
#define USBD_NDDRTINTST(x)
#define USBD_NDDRTINTCLR(x)
#define USBD_NDDRTINTSET(x)
/* DMA error interrupt enable, disable, status */
#define USBD_SYSERRTINTST(x)
#define USBD_SYSERRTINTCLR(x)
#define USBD_SYSERRTINTSET(x)

/**********************************************************************
 * USBD_DEVINTST/USBD_DEVINTEN/USBD_DEVINTCLR/USBD_DEVINTSET/
 * USBD_DEVINTPRI register definitions
 **********************************************************************/
#define USBD_ERR_INT
#define USBD_EP_RLZED
#define USBD_TXENDPKT
#define USBD_RXENDPKT
#define USBD_CDFULL
#define USBD_CCEMPTY
#define USBD_DEV_STAT
#define USBD_EP_SLOW
#define USBD_EP_FAST
#define USBD_FRAME

/**********************************************************************
 * USBD_EPINTST/USBD_EPINTEN/USBD_EPINTCLR/USBD_EPINTSET/
 * USBD_EPINTPRI register definitions
 **********************************************************************/
/* End point selection macro (RX) */
#define USBD_RX_EP_SEL(e)

/* End point selection macro (TX) */
#define USBD_TX_EP_SEL(e)

/**********************************************************************
 * USBD_REEP/USBD_DMARST/USBD_DMARCLR/USBD_DMARSET/USBD_EPDMAST/
 * USBD_EPDMAEN/USBD_EPDMADIS/
 * USBD_NDDRTINTST/USBD_NDDRTINTCLR/USBD_NDDRTINTSET/
 * USBD_EOTINTST/USBD_EOTINTCLR/USBD_EOTINTSET/
 * USBD_SYSERRTINTST/USBD_SYSERRTINTCLR/USBD_SYSERRTINTSET
 * register definitions
 **********************************************************************/
/* Endpoint selection macro */
#define USBD_EP_SEL(e)

/**********************************************************************
 * SBD_DMAINTST/USBD_DMAINTEN
 **********************************************************************/
#define USBD_SYS_ERR_INT
#define USBD_NEW_DD_INT
#define USBD_EOT_INT

/**********************************************************************
 * USBD_RXPLEN register definitions
 **********************************************************************/
#define USBD_PKT_RDY
#define USBD_DV
#define USBD_PK_LEN_MASK

/**********************************************************************
 * USBD_CTRL register definitions
 **********************************************************************/
#define USBD_LOG_ENDPOINT(e)
#define USBD_WR_EN
#define USBD_RD_EN

/**********************************************************************
 * USBD_CMDCODE register definitions
 **********************************************************************/
#define USBD_CMD_CODE(c)
#define USBD_CMD_PHASE(p)

/**********************************************************************
 * USBD_DMARST/USBD_DMARCLR/USBD_DMARSET register definitions
 **********************************************************************/
#define USBD_DMAEP(e)

/* DD (DMA Descriptor) structure, requires word alignment */
struct lpc32xx_usbd_dd {};

/* dd_setup bit defines */
#define DD_SETUP_ATLE_DMA_MODE
#define DD_SETUP_NEXT_DD_VALID
#define DD_SETUP_ISO_EP
#define DD_SETUP_PACKETLEN(n)
#define DD_SETUP_DMALENBYTES(n)

/* dd_status bit defines */
#define DD_STATUS_DD_RETIRED
#define DD_STATUS_STS_MASK
#define DD_STATUS_STS_NS
#define DD_STATUS_STS_BS
#define DD_STATUS_STS_NC
#define DD_STATUS_STS_DUR
#define DD_STATUS_STS_DOR
#define DD_STATUS_STS_SE
#define DD_STATUS_PKT_VAL
#define DD_STATUS_LSB_EX
#define DD_STATUS_MSB_EX
#define DD_STATUS_MLEN(n)
#define DD_STATUS_CURDMACNT(n)

/*
 *
 * Protocol engine bits below
 *
 */
/* Device Interrupt Bit Definitions */
#define FRAME_INT
#define EP_FAST_INT
#define EP_SLOW_INT
#define DEV_STAT_INT
#define CCEMTY_INT
#define CDFULL_INT
#define RxENDPKT_INT
#define TxENDPKT_INT
#define EP_RLZED_INT
#define ERR_INT

/* Rx & Tx Packet Length Definitions */
#define PKT_LNGTH_MASK
#define PKT_DV
#define PKT_RDY

/* USB Control Definitions */
#define CTRL_RD_EN
#define CTRL_WR_EN

/* Command Codes */
#define CMD_SET_ADDR
#define CMD_CFG_DEV
#define CMD_SET_MODE
#define CMD_RD_FRAME
#define DAT_RD_FRAME
#define CMD_RD_TEST
#define DAT_RD_TEST
#define CMD_SET_DEV_STAT
#define CMD_GET_DEV_STAT
#define DAT_GET_DEV_STAT
#define CMD_GET_ERR_CODE
#define DAT_GET_ERR_CODE
#define CMD_RD_ERR_STAT
#define DAT_RD_ERR_STAT
#define DAT_WR_BYTE(x)
#define CMD_SEL_EP(x)
#define DAT_SEL_EP(x)
#define CMD_SEL_EP_CLRI(x)
#define DAT_SEL_EP_CLRI(x)
#define CMD_SET_EP_STAT(x)
#define CMD_CLR_BUF
#define DAT_CLR_BUF
#define CMD_VALID_BUF

/* Device Address Register Definitions */
#define DEV_ADDR_MASK
#define DEV_EN

/* Device Configure Register Definitions */
#define CONF_DVICE

/* Device Mode Register Definitions */
#define AP_CLK
#define INAK_CI
#define INAK_CO
#define INAK_II
#define INAK_IO
#define INAK_BI
#define INAK_BO

/* Device Status Register Definitions */
#define DEV_CON
#define DEV_CON_CH
#define DEV_SUS
#define DEV_SUS_CH
#define DEV_RST

/* Error Code Register Definitions */
#define ERR_EC_MASK
#define ERR_EA

/* Error Status Register Definitions */
#define ERR_PID
#define ERR_UEPKT
#define ERR_DCRC
#define ERR_TIMOUT
#define ERR_EOP
#define ERR_B_OVRN
#define ERR_BTSTF
#define ERR_TGL

/* Endpoint Select Register Definitions */
#define EP_SEL_F
#define EP_SEL_ST
#define EP_SEL_STP
#define EP_SEL_PO
#define EP_SEL_EPN
#define EP_SEL_B_1_FULL
#define EP_SEL_B_2_FULL

/* Endpoint Status Register Definitions */
#define EP_STAT_ST
#define EP_STAT_DA
#define EP_STAT_RF_MO
#define EP_STAT_CND_ST

/* Clear Buffer Register Definitions */
#define CLR_BUF_PO

/* DMA Interrupt Bit Definitions */
#define EOT_INT
#define NDD_REQ_INT
#define SYS_ERR_INT

#define DRIVER_VERSION
static const char driver_name[] =;

/*
 *
 * proc interface support
 *
 */
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
static char *epnames[] =;
static const char debug_filename[] =;

static void proc_ep_show(struct seq_file *s, struct lpc32xx_ep *ep)
{}

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

DEFINE_SHOW_ATTRIBUTE();

static void create_debug_file(struct lpc32xx_udc *udc)
{}

static void remove_debug_file(struct lpc32xx_udc *udc)
{}

#else
static inline void create_debug_file(struct lpc32xx_udc *udc) {}
static inline void remove_debug_file(struct lpc32xx_udc *udc) {}
#endif

/* Primary initialization sequence for the ISP1301 transceiver */
static void isp1301_udc_configure(struct lpc32xx_udc *udc)
{}

/* Enables or disables the USB device pullup via the ISP1301 transceiver */
static void isp1301_pullup_set(struct lpc32xx_udc *udc)
{}

static void pullup_work(struct work_struct *work)
{}

static void isp1301_pullup_enable(struct lpc32xx_udc *udc, int en_pullup,
				  int block)
{}

#ifdef CONFIG_PM
/* Powers up or down the ISP1301 transceiver */
static void isp1301_set_powerstate(struct lpc32xx_udc *udc, int enable)
{}

static void power_work(struct work_struct *work)
{}
#endif

/*
 *
 * USB protocol engine command/data read/write helper functions
 *
 */
/* Issues a single command to the USB device state machine */
static void udc_protocol_cmd_w(struct lpc32xx_udc *udc, u32 cmd)
{}

/* Issues 2 commands (or command and data) to the USB device state machine */
static inline void udc_protocol_cmd_data_w(struct lpc32xx_udc *udc, u32 cmd,
					   u32 data)
{}

/* Issues a single command to the USB device state machine and reads
 * response data */
static u32 udc_protocol_cmd_r(struct lpc32xx_udc *udc, u32 cmd)
{}

/*
 *
 * USB device interrupt mask support functions
 *
 */
/* Enable one or more USB device interrupts */
static inline void uda_enable_devint(struct lpc32xx_udc *udc, u32 devmask)
{}

/* Disable one or more USB device interrupts */
static inline void uda_disable_devint(struct lpc32xx_udc *udc, u32 mask)
{}

/* Clear one or more USB device interrupts */
static inline void uda_clear_devint(struct lpc32xx_udc *udc, u32 mask)
{}

/*
 *
 * Endpoint interrupt disable/enable functions
 *
 */
/* Enable one or more USB endpoint interrupts */
static void uda_enable_hwepint(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Disable one or more USB endpoint interrupts */
static void uda_disable_hwepint(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Clear one or more USB endpoint interrupts */
static inline void uda_clear_hwepint(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Enable DMA for the HW channel */
static inline void udc_ep_dma_enable(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Disable DMA for the HW channel */
static inline void udc_ep_dma_disable(struct lpc32xx_udc *udc, u32 hwep)
{}

/*
 *
 * Endpoint realize/unrealize functions
 *
 */
/* Before an endpoint can be used, it needs to be realized
 * in the USB protocol engine - this realizes the endpoint.
 * The interrupt (FIFO or DMA) is not enabled with this function */
static void udc_realize_hwep(struct lpc32xx_udc *udc, u32 hwep,
			     u32 maxpacket)
{}

/* Unrealize an EP */
static void udc_unrealize_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/*
 *
 * Endpoint support functions
 *
 */
/* Select and clear endpoint interrupt */
static u32 udc_selep_clrint(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Disables the endpoint in the USB protocol engine */
static void udc_disable_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Stalls the endpoint - endpoint will return STALL */
static void udc_stall_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Clear stall or reset endpoint */
static void udc_clrstall_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Select an endpoint for endpoint status, clear, validate */
static void udc_select_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/*
 *
 * Endpoint buffer management functions
 *
 */
/* Clear the current endpoint's buffer */
static void udc_clr_buffer_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

/* Validate the current endpoint's buffer */
static void udc_val_buffer_hwep(struct lpc32xx_udc *udc, u32 hwep)
{}

static inline u32 udc_clearep_getsts(struct lpc32xx_udc *udc, u32 hwep)
{}

/*
 *
 * USB EP DMA support
 *
 */
/* Allocate a DMA Descriptor */
static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)
{}

/* Free a DMA Descriptor */
static void udc_dd_free(struct lpc32xx_udc *udc, struct lpc32xx_usbd_dd_gad *dd)
{}

/*
 *
 * USB setup and shutdown functions
 *
 */
/* Enables or disables most of the USB system clocks when low power mode is
 * needed. Clocks are typically started on a connection event, and disabled
 * when a cable is disconnected */
static void udc_clk_set(struct lpc32xx_udc *udc, int enable)
{}

/* Set/reset USB device address */
static void udc_set_address(struct lpc32xx_udc *udc, u32 addr)
{}

/* Setup up a IN request for DMA transfer - this consists of determining the
 * list of DMA addresses for the transfer, allocating DMA Descriptors,
 * installing the DD into the UDCA, and then enabling the DMA for that EP */
static int udc_ep_in_req_dma(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{}

/* Setup up a OUT request for DMA transfer - this consists of determining the
 * list of DMA addresses for the transfer, allocating DMA Descriptors,
 * installing the DD into the UDCA, and then enabling the DMA for that EP */
static int udc_ep_out_req_dma(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{}

static void udc_disable(struct lpc32xx_udc *udc)
{}

static void udc_enable(struct lpc32xx_udc *udc)
{}

/*
 *
 * USB device board specific events handled via callbacks
 *
 */
/* Connection change event - notify board function of change */
static void uda_power_event(struct lpc32xx_udc *udc, u32 conn)
{}

/* Suspend/resume event - notify board function of change */
static void uda_resm_susp_event(struct lpc32xx_udc *udc, u32 conn)
{}

/* Remote wakeup enable/disable - notify board function of change */
static void uda_remwkp_cgh(struct lpc32xx_udc *udc)
{}

/* Reads data from FIFO, adjusts for alignment and data size */
static void udc_pop_fifo(struct lpc32xx_udc *udc, u8 *data, u32 bytes)
{}

/* Read data from the FIFO for an endpoint. This function is for endpoints (such
 * as EP0) that don't use DMA. This function should only be called if a packet
 * is known to be ready to read for the endpoint. Note that the endpoint must
 * be selected in the protocol engine prior to this call. */
static u32 udc_read_hwep(struct lpc32xx_udc *udc, u32 hwep, u32 *data,
			 u32 bytes)
{}

/* Stuffs data into the FIFO, adjusts for alignment and data size */
static void udc_stuff_fifo(struct lpc32xx_udc *udc, u8 *data, u32 bytes)
{}

/* Write data to the FIFO for an endpoint. This function is for endpoints (such
 * as EP0) that don't use DMA. Note that the endpoint must be selected in the
 * protocol engine prior to this call. */
static void udc_write_hwep(struct lpc32xx_udc *udc, u32 hwep, u32 *data,
			   u32 bytes)
{}

/* USB device reset - resets USB to a default state with just EP0
   enabled */
static void uda_usb_reset(struct lpc32xx_udc *udc)
{}

/* Send a ZLP on EP0 */
static void udc_ep0_send_zlp(struct lpc32xx_udc *udc)
{}

/* Get current frame number */
static u16 udc_get_current_frame(struct lpc32xx_udc *udc)
{}

/* Set the device as configured - enables all endpoints */
static inline void udc_set_device_configured(struct lpc32xx_udc *udc)
{}

/* Set the device as unconfigured - disables all endpoints */
static inline void udc_set_device_unconfigured(struct lpc32xx_udc *udc)
{}

/* reinit == restore initial software state */
static void udc_reinit(struct lpc32xx_udc *udc)
{}

/* Must be called with lock */
static void done(struct lpc32xx_ep *ep, struct lpc32xx_request *req, int status)
{}

/* Must be called with lock */
static void nuke(struct lpc32xx_ep *ep, int status)
{}

/* IN endpoint 0 transfer */
static int udc_ep0_in_req(struct lpc32xx_udc *udc)
{}

/* OUT endpoint 0 transfer */
static int udc_ep0_out_req(struct lpc32xx_udc *udc)
{}

/* Must be called with lock */
static void stop_activity(struct lpc32xx_udc *udc)
{}

/*
 * Activate or kill host pullup
 * Can be called with or without lock
 */
static void pullup(struct lpc32xx_udc *udc, int is_on)
{}

/* Must be called without lock */
static int lpc32xx_ep_disable(struct usb_ep *_ep)
{}

/* Must be called without lock */
static int lpc32xx_ep_enable(struct usb_ep *_ep,
			     const struct usb_endpoint_descriptor *desc)
{}

/*
 * Allocate a USB request list
 * Can be called with or without lock
 */
static struct usb_request *lpc32xx_ep_alloc_request(struct usb_ep *_ep,
						    gfp_t gfp_flags)
{}

/*
 * De-allocate a USB request list
 * Can be called with or without lock
 */
static void lpc32xx_ep_free_request(struct usb_ep *_ep,
				    struct usb_request *_req)
{}

/* Must be called without lock */
static int lpc32xx_ep_queue(struct usb_ep *_ep,
			    struct usb_request *_req, gfp_t gfp_flags)
{}

/* Must be called without lock */
static int lpc32xx_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{}

/* Must be called without lock */
static int lpc32xx_ep_set_halt(struct usb_ep *_ep, int value)
{}

/* set the halt feature and ignores clear requests */
static int lpc32xx_ep_set_wedge(struct usb_ep *_ep)
{}

static const struct usb_ep_ops lpc32xx_ep_ops =;

/* Send a ZLP on a non-0 IN EP */
static void udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{}

/*
 * Handle EP completion for ZLP
 * This function will only be called when a delayed ZLP needs to be sent out
 * after a DMA transfer has filled both buffers.
 */
static void udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{}


/* DMA end of transfer completion */
static void udc_handle_dma_ep(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{}

/*
 *
 * Endpoint 0 functions
 *
 */
static void udc_handle_dev(struct lpc32xx_udc *udc)
{}

static int udc_get_status(struct lpc32xx_udc *udc, u16 reqtype, u16 wIndex)
{}

static void udc_handle_ep0_setup(struct lpc32xx_udc *udc)
{}

/* IN endpoint 0 transfer */
static void udc_handle_ep0_in(struct lpc32xx_udc *udc)
{}

/* OUT endpoint 0 transfer */
static void udc_handle_ep0_out(struct lpc32xx_udc *udc)
{}

/* Must be called without lock */
static int lpc32xx_get_frame(struct usb_gadget *gadget)
{}

static int lpc32xx_wakeup(struct usb_gadget *gadget)
{}

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

/*
 * vbus is here!  turn everything on that's ready
 * Must be called without lock
 */
static int lpc32xx_vbus_session(struct usb_gadget *gadget, int is_active)
{}

/* Can be called with or without lock */
static int lpc32xx_pullup(struct usb_gadget *gadget, int is_on)
{}

static int lpc32xx_start(struct usb_gadget *, struct usb_gadget_driver *);
static int lpc32xx_stop(struct usb_gadget *);

static const struct usb_gadget_ops lpc32xx_udc_ops =;

static void nop_release(struct device *dev)
{}

static const struct lpc32xx_udc controller_template =;

/* ISO and status interrupts */
static irqreturn_t lpc32xx_usb_lp_irq(int irq, void *_udc)
{}

/* EP interrupts */
static irqreturn_t lpc32xx_usb_hp_irq(int irq, void *_udc)
{}

static irqreturn_t lpc32xx_usb_devdma_irq(int irq, void *_udc)
{}

/*
 *
 * VBUS detection, pullup handler, and Gadget cable state notification
 *
 */
static void vbus_work(struct lpc32xx_udc *udc)
{}

static irqreturn_t lpc32xx_usb_vbus_irq(int irq, void *_udc)
{}

static int lpc32xx_start(struct usb_gadget *gadget,
			 struct usb_gadget_driver *driver)
{}

static int lpc32xx_stop(struct usb_gadget *gadget)
{}

static void lpc32xx_udc_shutdown(struct platform_device *dev)
{}

/*
 * Callbacks to be overridden by options passed via OF (TODO)
 */

static void lpc32xx_usbd_conn_chg(int conn)
{}

static void lpc32xx_usbd_susp_chg(int susp)
{}

static void lpc32xx_rmwkup_chg(int remote_wakup_enable)
{}

static struct lpc32xx_usbd_cfg lpc32xx_usbddata =;


static u64 lpc32xx_usbd_dmamask =;

static int lpc32xx_udc_probe(struct platform_device *pdev)
{}

static void lpc32xx_udc_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM
static int lpc32xx_udc_suspend(struct platform_device *pdev, pm_message_t mesg)
{}

static int lpc32xx_udc_resume(struct platform_device *pdev)
{}
#else
#define lpc32xx_udc_suspend
#define lpc32xx_udc_resume
#endif

#ifdef CONFIG_OF
static const struct of_device_id lpc32xx_udc_of_match[] =;
MODULE_DEVICE_TABLE(of, lpc32xx_udc_of_match);
#endif

static struct platform_driver lpc32xx_udc_driver =;

module_platform_driver();

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