#define UDC_MOD_DESCRIPTION …
#define UDC_DRIVER_VERSION_STRING …
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/ioctl.h>
#include <linux/fs.h>
#include <linux/dmapool.h>
#include <linux/prefetch.h>
#include <linux/moduleparam.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include "amd5536udc.h"
static void udc_setup_endpoints(struct udc *dev);
static void udc_soft_reset(struct udc *dev);
static struct udc_request *udc_alloc_bna_dummy(struct udc_ep *ep);
static void udc_free_request(struct usb_ep *usbep, struct usb_request *usbreq);
static const char mod_desc[] = …;
static const char name[] = …;
static const struct usb_ep_ops udc_ep_ops;
static union udc_setup_data setup_data;
static struct udc *udc;
static DEFINE_SPINLOCK(udc_irq_spinlock);
static DEFINE_SPINLOCK(udc_stall_spinlock);
static unsigned int udc_rxfifo_pending;
static int soft_reset_occured;
static int soft_reset_after_usbreset_occured;
static struct timer_list udc_timer;
static int stop_timer;
static int set_rde = …;
static DECLARE_COMPLETION(on_exit);
static struct timer_list udc_pollstall_timer;
static int stop_pollstall_timer;
static DECLARE_COMPLETION(on_pollstall_exit);
static const char ep0_string[] = …;
static const struct { … } ep_info[] = …;
static int use_dma_bufferfill_mode;
static unsigned long hs_tx_buf = …;
static void print_regs(struct udc *dev)
{ … }
int udc_mask_unused_interrupts(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int udc_enable_ep0_interrupts(struct udc *dev)
{ … }
int udc_enable_dev_setup_interrupts(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int udc_set_txfifo_addr(struct udc_ep *ep)
{ … }
static u32 cnak_pending;
static void UDC_QUEUE_CNAK(struct udc_ep *ep, unsigned num)
{ … }
static int
udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc)
{ … }
static void ep_init(struct udc_regs __iomem *regs, struct udc_ep *ep)
{ … }
static int udc_ep_disable(struct usb_ep *usbep)
{ … }
static struct usb_request *
udc_alloc_request(struct usb_ep *usbep, gfp_t gfp)
{ … }
static void udc_free_dma_chain(struct udc *dev, struct udc_request *req)
{ … }
static void
udc_free_request(struct usb_ep *usbep, struct usb_request *usbreq)
{ … }
static void udc_init_bna_dummy(struct udc_request *req)
{ … }
static struct udc_request *udc_alloc_bna_dummy(struct udc_ep *ep)
{ … }
static void
udc_txfifo_write(struct udc_ep *ep, struct usb_request *req)
{ … }
static int udc_rxfifo_read_dwords(struct udc *dev, u32 *buf, int dwords)
{ … }
static int udc_rxfifo_read_bytes(struct udc *dev, u8 *buf, int bytes)
{ … }
static int
udc_rxfifo_read(struct udc_ep *ep, struct udc_request *req)
{ … }
static int udc_create_dma_chain(
struct udc_ep *ep,
struct udc_request *req,
unsigned long buf_len, gfp_t gfp_flags
)
{ … }
static int prep_dma(struct udc_ep *ep, struct udc_request *req, gfp_t gfp)
{ … }
static void
complete_req(struct udc_ep *ep, struct udc_request *req, int sts)
__releases(ep->dev->lock)
__acquires(ep->dev->lock)
{ … }
static struct udc_data_dma *udc_get_last_dma_desc(struct udc_request *req)
{ … }
static u32 udc_get_ppbdu_rxbytes(struct udc_request *req)
{ … }
static void udc_set_rde(struct udc *dev)
{ … }
static int
udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp)
{ … }
void empty_req_queue(struct udc_ep *ep)
{ … }
EXPORT_SYMBOL_GPL(…);
static int udc_dequeue(struct usb_ep *usbep, struct usb_request *usbreq)
{ … }
static int
udc_set_halt(struct usb_ep *usbep, int halt)
{ … }
static const struct usb_ep_ops udc_ep_ops = …;
static int udc_get_frame(struct usb_gadget *gadget)
{ … }
static int udc_remote_wakeup(struct udc *dev)
{ … }
static int udc_wakeup(struct usb_gadget *gadget)
{ … }
static int amd5536_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver);
static int amd5536_udc_stop(struct usb_gadget *g);
static const struct usb_gadget_ops udc_ops = …;
static void make_ep_lists(struct udc *dev)
{ … }
void udc_basic_init(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int startup_registers(struct udc *dev)
{ … }
static void udc_setup_endpoints(struct udc *dev)
{ … }
static void usb_connect(struct udc *dev)
{ … }
static void usb_disconnect(struct udc *dev)
{ … }
static void udc_soft_reset(struct udc *dev)
{ … }
static void udc_timer_function(struct timer_list *unused)
{ … }
static void udc_handle_halt_state(struct udc_ep *ep)
{ … }
static void udc_pollstall_timer_function(struct timer_list *unused)
{ … }
static void activate_control_endpoints(struct udc *dev)
{ … }
static int setup_ep0(struct udc *dev)
{ … }
static int amd5536_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver)
{ … }
static void
shutdown(struct udc *dev, struct usb_gadget_driver *driver)
__releases(dev->lock)
__acquires(dev->lock)
{ … }
static int amd5536_udc_stop(struct usb_gadget *g)
{ … }
static void udc_process_cnak_queue(struct udc *dev)
{ … }
static void udc_ep0_set_rde(struct udc *dev)
{ … }
static irqreturn_t udc_data_out_isr(struct udc *dev, int ep_ix)
{ … }
static irqreturn_t udc_data_in_isr(struct udc *dev, int ep_ix)
{ … }
static irqreturn_t udc_control_out_isr(struct udc *dev)
__releases(dev->lock)
__acquires(dev->lock)
{ … }
static irqreturn_t udc_control_in_isr(struct udc *dev)
{ … }
static irqreturn_t udc_dev_isr(struct udc *dev, u32 dev_irq)
__releases(dev->lock)
__acquires(dev->lock)
{ … }
irqreturn_t udc_irq(int irq, void *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void gadget_release(struct device *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void udc_remove(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void free_dma_pools(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int init_dma_pools(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int udc_probe(struct udc *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;