Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
lpc32xx_udc.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/clk.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/i2c.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/workqueue.h>
#include <linux/of.h>
#include <linux/usb/isp1301.h>
#include <asm/byteorder.h>
#include <mach/hardware.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <mach/platform.h>
#include <mach/irqs.h>
#include <mach/board.h>

Go to the source code of this file.

Data Structures

struct  lpc32xx_usbd_cfg
 
struct  lpc32xx_usbd_dd_gad
 
struct  lpc32xx_ep
 
struct  lpc32xx_udc
 
struct  lpc32xx_request
 
struct  lpc32xx_usbd_dd
 

Macros

#define NUM_ENDPOINTS   16
 
#define IRQ_USB_LP   0
 
#define IRQ_USB_HP   1
 
#define IRQ_USB_DEVDMA   2
 
#define IRQ_USB_ATX   3
 
#define EP_OUT   0 /* RX (from host) */
 
#define EP_IN   1 /* TX (to host) */
 
#define EP_MASK_SEL(ep, dir)   (1 << (((ep) * 2) + dir))
 
#define EP_INT_TYPE   0
 
#define EP_ISO_TYPE   1
 
#define EP_BLK_TYPE   2
 
#define EP_CTL_TYPE   3
 
#define WAIT_FOR_SETUP   0 /* Wait for setup packet */
 
#define DATA_IN   1 /* Expect dev->host transfer */
 
#define DATA_OUT   2 /* Expect host->dev transfer */
 
#define ep_dbg(epp, fmt, arg...)   dev_dbg(epp->udc->dev, "%s: " fmt, __func__, ## arg)
 
#define ep_err(epp, fmt, arg...)   dev_err(epp->udc->dev, "%s: " fmt, __func__, ## arg)
 
#define ep_info(epp, fmt, arg...)   dev_info(epp->udc->dev, "%s: " fmt, __func__, ## arg)
 
#define ep_warn(epp, fmt, arg...)   dev_warn(epp->udc->dev, "%s:" fmt, __func__, ## arg)
 
#define UDCA_BUFF_SIZE   (128)
 
#define USB_CTRL   IO_ADDRESS(LPC32XX_CLK_PM_BASE + 0x64)
 
#define USB_SLAVE_HCLK_EN   (1 << 24)
 
#define USB_HOST_NEED_CLK_EN   (1 << 21)
 
#define USB_DEV_NEED_CLK_EN   (1 << 22)
 
#define USBD_DEVINTST(x)   ((x) + 0x200)
 
#define USBD_DEVINTEN(x)   ((x) + 0x204)
 
#define USBD_DEVINTCLR(x)   ((x) + 0x208)
 
#define USBD_DEVINTSET(x)   ((x) + 0x20C)
 
#define USBD_CMDCODE(x)   ((x) + 0x210)
 
#define USBD_CMDDATA(x)   ((x) + 0x214)
 
#define USBD_RXDATA(x)   ((x) + 0x218)
 
#define USBD_TXDATA(x)   ((x) + 0x21C)
 
#define USBD_RXPLEN(x)   ((x) + 0x220)
 
#define USBD_TXPLEN(x)   ((x) + 0x224)
 
#define USBD_CTRL(x)   ((x) + 0x228)
 
#define USBD_DEVINTPRI(x)   ((x) + 0x22C)
 
#define USBD_EPINTST(x)   ((x) + 0x230)
 
#define USBD_EPINTEN(x)   ((x) + 0x234)
 
#define USBD_EPINTCLR(x)   ((x) + 0x238)
 
#define USBD_EPINTSET(x)   ((x) + 0x23C)
 
#define USBD_EPINTPRI(x)   ((x) + 0x240)
 
#define USBD_REEP(x)   ((x) + 0x244)
 
#define USBD_EPIND(x)   ((x) + 0x248)
 
#define USBD_EPMAXPSIZE(x)   ((x) + 0x24C)
 
#define USBD_DMARST(x)   ((x) + 0x250)
 
#define USBD_DMARCLR(x)   ((x) + 0x254)
 
#define USBD_DMARSET(x)   ((x) + 0x258)
 
#define USBD_UDCAH(x)   ((x) + 0x280)
 
#define USBD_EPDMAST(x)   ((x) + 0x284)
 
#define USBD_EPDMAEN(x)   ((x) + 0x288)
 
#define USBD_EPDMADIS(x)   ((x) + 0x28C)
 
#define USBD_DMAINTST(x)   ((x) + 0x290)
 
#define USBD_DMAINTEN(x)   ((x) + 0x294)
 
#define USBD_EOTINTST(x)   ((x) + 0x2A0)
 
#define USBD_EOTINTCLR(x)   ((x) + 0x2A4)
 
#define USBD_EOTINTSET(x)   ((x) + 0x2A8)
 
#define USBD_NDDRTINTST(x)   ((x) + 0x2AC)
 
#define USBD_NDDRTINTCLR(x)   ((x) + 0x2B0)
 
#define USBD_NDDRTINTSET(x)   ((x) + 0x2B4)
 
#define USBD_SYSERRTINTST(x)   ((x) + 0x2B8)
 
#define USBD_SYSERRTINTCLR(x)   ((x) + 0x2BC)
 
#define USBD_SYSERRTINTSET(x)   ((x) + 0x2C0)
 
#define USBD_ERR_INT   (1 << 9)
 
#define USBD_EP_RLZED   (1 << 8)
 
#define USBD_TXENDPKT   (1 << 7)
 
#define USBD_RXENDPKT   (1 << 6)
 
#define USBD_CDFULL   (1 << 5)
 
#define USBD_CCEMPTY   (1 << 4)
 
#define USBD_DEV_STAT   (1 << 3)
 
#define USBD_EP_SLOW   (1 << 2)
 
#define USBD_EP_FAST   (1 << 1)
 
#define USBD_FRAME   (1 << 0)
 
#define USBD_RX_EP_SEL(e)   (1 << ((e) << 1))
 
#define USBD_TX_EP_SEL(e)   (1 << (((e) << 1) + 1))
 
#define USBD_EP_SEL(e)   (1 << (e))
 
#define USBD_SYS_ERR_INT   (1 << 2)
 
#define USBD_NEW_DD_INT   (1 << 1)
 
#define USBD_EOT_INT   (1 << 0)
 
#define USBD_PKT_RDY   (1 << 11)
 
#define USBD_DV   (1 << 10)
 
#define USBD_PK_LEN_MASK   0x3FF
 
#define USBD_LOG_ENDPOINT(e)   ((e) << 2)
 
#define USBD_WR_EN   (1 << 1)
 
#define USBD_RD_EN   (1 << 0)
 
#define USBD_CMD_CODE(c)   ((c) << 16)
 
#define USBD_CMD_PHASE(p)   ((p) << 8)
 
#define USBD_DMAEP(e)   (1 << (e))
 
#define DD_SETUP_ATLE_DMA_MODE   0x01
 
#define DD_SETUP_NEXT_DD_VALID   0x04
 
#define DD_SETUP_ISO_EP   0x10
 
#define DD_SETUP_PACKETLEN(n)   (((n) & 0x7FF) << 5)
 
#define DD_SETUP_DMALENBYTES(n)   (((n) & 0xFFFF) << 16)
 
#define DD_STATUS_DD_RETIRED   0x01
 
#define DD_STATUS_STS_MASK   0x1E
 
#define DD_STATUS_STS_NS   0x00 /* Not serviced */
 
#define DD_STATUS_STS_BS   0x02 /* Being serviced */
 
#define DD_STATUS_STS_NC   0x04 /* Normal completion */
 
#define DD_STATUS_STS_DUR   0x06 /* Data underrun (short packet) */
 
#define DD_STATUS_STS_DOR   0x08 /* Data overrun */
 
#define DD_STATUS_STS_SE   0x12 /* System error */
 
#define DD_STATUS_PKT_VAL   0x20 /* Packet valid */
 
#define DD_STATUS_LSB_EX   0x40 /* LS byte extracted (ATLE) */
 
#define DD_STATUS_MSB_EX   0x80 /* MS byte extracted (ATLE) */
 
#define DD_STATUS_MLEN(n)   (((n) >> 8) & 0x3F)
 
#define DD_STATUS_CURDMACNT(n)   (((n) >> 16) & 0xFFFF)
 
#define FRAME_INT   0x00000001
 
#define EP_FAST_INT   0x00000002
 
#define EP_SLOW_INT   0x00000004
 
#define DEV_STAT_INT   0x00000008
 
#define CCEMTY_INT   0x00000010
 
#define CDFULL_INT   0x00000020
 
#define RxENDPKT_INT   0x00000040
 
#define TxENDPKT_INT   0x00000080
 
#define EP_RLZED_INT   0x00000100
 
#define ERR_INT   0x00000200
 
#define PKT_LNGTH_MASK   0x000003FF
 
#define PKT_DV   0x00000400
 
#define PKT_RDY   0x00000800
 
#define CTRL_RD_EN   0x00000001
 
#define CTRL_WR_EN   0x00000002
 
#define CMD_SET_ADDR   0x00D00500
 
#define CMD_CFG_DEV   0x00D80500
 
#define CMD_SET_MODE   0x00F30500
 
#define CMD_RD_FRAME   0x00F50500
 
#define DAT_RD_FRAME   0x00F50200
 
#define CMD_RD_TEST   0x00FD0500
 
#define DAT_RD_TEST   0x00FD0200
 
#define CMD_SET_DEV_STAT   0x00FE0500
 
#define CMD_GET_DEV_STAT   0x00FE0500
 
#define DAT_GET_DEV_STAT   0x00FE0200
 
#define CMD_GET_ERR_CODE   0x00FF0500
 
#define DAT_GET_ERR_CODE   0x00FF0200
 
#define CMD_RD_ERR_STAT   0x00FB0500
 
#define DAT_RD_ERR_STAT   0x00FB0200
 
#define DAT_WR_BYTE(x)   (0x00000100 | ((x) << 16))
 
#define CMD_SEL_EP(x)   (0x00000500 | ((x) << 16))
 
#define DAT_SEL_EP(x)   (0x00000200 | ((x) << 16))
 
#define CMD_SEL_EP_CLRI(x)   (0x00400500 | ((x) << 16))
 
#define DAT_SEL_EP_CLRI(x)   (0x00400200 | ((x) << 16))
 
#define CMD_SET_EP_STAT(x)   (0x00400500 | ((x) << 16))
 
#define CMD_CLR_BUF   0x00F20500
 
#define DAT_CLR_BUF   0x00F20200
 
#define CMD_VALID_BUF   0x00FA0500
 
#define DEV_ADDR_MASK   0x7F
 
#define DEV_EN   0x80
 
#define CONF_DVICE   0x01
 
#define AP_CLK   0x01
 
#define INAK_CI   0x02
 
#define INAK_CO   0x04
 
#define INAK_II   0x08
 
#define INAK_IO   0x10
 
#define INAK_BI   0x20
 
#define INAK_BO   0x40
 
#define DEV_CON   0x01
 
#define DEV_CON_CH   0x02
 
#define DEV_SUS   0x04
 
#define DEV_SUS_CH   0x08
 
#define DEV_RST   0x10
 
#define ERR_EC_MASK   0x0F
 
#define ERR_EA   0x10
 
#define ERR_PID   0x01
 
#define ERR_UEPKT   0x02
 
#define ERR_DCRC   0x04
 
#define ERR_TIMOUT   0x08
 
#define ERR_EOP   0x10
 
#define ERR_B_OVRN   0x20
 
#define ERR_BTSTF   0x40
 
#define ERR_TGL   0x80
 
#define EP_SEL_F   0x01
 
#define EP_SEL_ST   0x02
 
#define EP_SEL_STP   0x04
 
#define EP_SEL_PO   0x08
 
#define EP_SEL_EPN   0x10
 
#define EP_SEL_B_1_FULL   0x20
 
#define EP_SEL_B_2_FULL   0x40
 
#define EP_STAT_ST   0x01
 
#define EP_STAT_DA   0x20
 
#define EP_STAT_RF_MO   0x40
 
#define EP_STAT_CND_ST   0x80
 
#define CLR_BUF_PO   0x01
 
#define EOT_INT   0x01
 
#define NDD_REQ_INT   0x02
 
#define SYS_ERR_INT   0x04
 
#define DRIVER_VERSION   "1.03"
 
#define lpc32xx_udc_suspend   NULL
 
#define lpc32xx_udc_resume   NULL
 

Typedefs

typedef void(* usc_chg_event )(int)
 

Functions

void udc_send_in_zlp (struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
 
void udc_handle_eps (struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
 
 module_init (udc_init_module)
 
 module_exit (udc_exit_module)
 
 MODULE_DESCRIPTION ("LPC32XX udc driver")
 
 MODULE_AUTHOR ("Kevin Wells <[email protected]>")
 
 MODULE_AUTHOR ("Roland Stigge <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:lpc32xx_udc")
 

Variables

struct lpc32xx_usbd_cfg lpc32xx_usbddata
 

Macro Definition Documentation

#define AP_CLK   0x01

Definition at line 449 of file lpc32xx_udc.c.

#define CCEMTY_INT   0x00000010

Definition at line 400 of file lpc32xx_udc.c.

#define CDFULL_INT   0x00000020

Definition at line 401 of file lpc32xx_udc.c.

#define CLR_BUF_PO   0x01

Definition at line 494 of file lpc32xx_udc.c.

#define CMD_CFG_DEV   0x00D80500

Definition at line 418 of file lpc32xx_udc.c.

#define CMD_CLR_BUF   0x00F20500

Definition at line 437 of file lpc32xx_udc.c.

#define CMD_GET_DEV_STAT   0x00FE0500

Definition at line 425 of file lpc32xx_udc.c.

#define CMD_GET_ERR_CODE   0x00FF0500

Definition at line 427 of file lpc32xx_udc.c.

#define CMD_RD_ERR_STAT   0x00FB0500

Definition at line 429 of file lpc32xx_udc.c.

#define CMD_RD_FRAME   0x00F50500

Definition at line 420 of file lpc32xx_udc.c.

#define CMD_RD_TEST   0x00FD0500

Definition at line 422 of file lpc32xx_udc.c.

#define CMD_SEL_EP (   x)    (0x00000500 | ((x) << 16))

Definition at line 432 of file lpc32xx_udc.c.

#define CMD_SEL_EP_CLRI (   x)    (0x00400500 | ((x) << 16))

Definition at line 434 of file lpc32xx_udc.c.

#define CMD_SET_ADDR   0x00D00500

Definition at line 417 of file lpc32xx_udc.c.

#define CMD_SET_DEV_STAT   0x00FE0500

Definition at line 424 of file lpc32xx_udc.c.

#define CMD_SET_EP_STAT (   x)    (0x00400500 | ((x) << 16))

Definition at line 436 of file lpc32xx_udc.c.

#define CMD_SET_MODE   0x00F30500

Definition at line 419 of file lpc32xx_udc.c.

#define CMD_VALID_BUF   0x00FA0500

Definition at line 439 of file lpc32xx_udc.c.

#define CONF_DVICE   0x01

Definition at line 446 of file lpc32xx_udc.c.

#define CTRL_RD_EN   0x00000001

Definition at line 413 of file lpc32xx_udc.c.

#define CTRL_WR_EN   0x00000002

Definition at line 414 of file lpc32xx_udc.c.

#define DAT_CLR_BUF   0x00F20200

Definition at line 438 of file lpc32xx_udc.c.

#define DAT_GET_DEV_STAT   0x00FE0200

Definition at line 426 of file lpc32xx_udc.c.

#define DAT_GET_ERR_CODE   0x00FF0200

Definition at line 428 of file lpc32xx_udc.c.

#define DAT_RD_ERR_STAT   0x00FB0200

Definition at line 430 of file lpc32xx_udc.c.

#define DAT_RD_FRAME   0x00F50200

Definition at line 421 of file lpc32xx_udc.c.

#define DAT_RD_TEST   0x00FD0200

Definition at line 423 of file lpc32xx_udc.c.

#define DAT_SEL_EP (   x)    (0x00000200 | ((x) << 16))

Definition at line 433 of file lpc32xx_udc.c.

#define DAT_SEL_EP_CLRI (   x)    (0x00400200 | ((x) << 16))

Definition at line 435 of file lpc32xx_udc.c.

#define DAT_WR_BYTE (   x)    (0x00000100 | ((x) << 16))

Definition at line 431 of file lpc32xx_udc.c.

#define DATA_IN   1 /* Expect dev->host transfer */

Definition at line 107 of file lpc32xx_udc.c.

#define DATA_OUT   2 /* Expect host->dev transfer */

Definition at line 108 of file lpc32xx_udc.c.

#define DD_SETUP_ATLE_DMA_MODE   0x01

Definition at line 369 of file lpc32xx_udc.c.

#define DD_SETUP_DMALENBYTES (   n)    (((n) & 0xFFFF) << 16)

Definition at line 373 of file lpc32xx_udc.c.

#define DD_SETUP_ISO_EP   0x10

Definition at line 371 of file lpc32xx_udc.c.

#define DD_SETUP_NEXT_DD_VALID   0x04

Definition at line 370 of file lpc32xx_udc.c.

#define DD_SETUP_PACKETLEN (   n)    (((n) & 0x7FF) << 5)

Definition at line 372 of file lpc32xx_udc.c.

#define DD_STATUS_CURDMACNT (   n)    (((n) >> 16) & 0xFFFF)

Definition at line 388 of file lpc32xx_udc.c.

#define DD_STATUS_DD_RETIRED   0x01

Definition at line 376 of file lpc32xx_udc.c.

#define DD_STATUS_LSB_EX   0x40 /* LS byte extracted (ATLE) */

Definition at line 385 of file lpc32xx_udc.c.

#define DD_STATUS_MLEN (   n)    (((n) >> 8) & 0x3F)

Definition at line 387 of file lpc32xx_udc.c.

#define DD_STATUS_MSB_EX   0x80 /* MS byte extracted (ATLE) */

Definition at line 386 of file lpc32xx_udc.c.

#define DD_STATUS_PKT_VAL   0x20 /* Packet valid */

Definition at line 384 of file lpc32xx_udc.c.

#define DD_STATUS_STS_BS   0x02 /* Being serviced */

Definition at line 379 of file lpc32xx_udc.c.

#define DD_STATUS_STS_DOR   0x08 /* Data overrun */

Definition at line 382 of file lpc32xx_udc.c.

#define DD_STATUS_STS_DUR   0x06 /* Data underrun (short packet) */

Definition at line 381 of file lpc32xx_udc.c.

#define DD_STATUS_STS_MASK   0x1E

Definition at line 377 of file lpc32xx_udc.c.

#define DD_STATUS_STS_NC   0x04 /* Normal completion */

Definition at line 380 of file lpc32xx_udc.c.

#define DD_STATUS_STS_NS   0x00 /* Not serviced */

Definition at line 378 of file lpc32xx_udc.c.

#define DD_STATUS_STS_SE   0x12 /* System error */

Definition at line 383 of file lpc32xx_udc.c.

#define DEV_ADDR_MASK   0x7F

Definition at line 442 of file lpc32xx_udc.c.

#define DEV_CON   0x01

Definition at line 458 of file lpc32xx_udc.c.

#define DEV_CON_CH   0x02

Definition at line 459 of file lpc32xx_udc.c.

#define DEV_EN   0x80

Definition at line 443 of file lpc32xx_udc.c.

#define DEV_RST   0x10

Definition at line 462 of file lpc32xx_udc.c.

#define DEV_STAT_INT   0x00000008

Definition at line 399 of file lpc32xx_udc.c.

#define DEV_SUS   0x04

Definition at line 460 of file lpc32xx_udc.c.

#define DEV_SUS_CH   0x08

Definition at line 461 of file lpc32xx_udc.c.

#define DRIVER_VERSION   "1.03"

Definition at line 501 of file lpc32xx_udc.c.

#define EOT_INT   0x01

Definition at line 497 of file lpc32xx_udc.c.

#define EP_BLK_TYPE   2

Definition at line 102 of file lpc32xx_udc.c.

#define EP_CTL_TYPE   3

Definition at line 103 of file lpc32xx_udc.c.

#define ep_dbg (   epp,
  fmt,
  arg... 
)    dev_dbg(epp->udc->dev, "%s: " fmt, __func__, ## arg)

Definition at line 217 of file lpc32xx_udc.c.

#define ep_err (   epp,
  fmt,
  arg... 
)    dev_err(epp->udc->dev, "%s: " fmt, __func__, ## arg)

Definition at line 219 of file lpc32xx_udc.c.

#define EP_FAST_INT   0x00000002

Definition at line 397 of file lpc32xx_udc.c.

#define EP_IN   1 /* TX (to host) */

Definition at line 95 of file lpc32xx_udc.c.

#define ep_info (   epp,
  fmt,
  arg... 
)    dev_info(epp->udc->dev, "%s: " fmt, __func__, ## arg)

Definition at line 221 of file lpc32xx_udc.c.

#define EP_INT_TYPE   0

Definition at line 100 of file lpc32xx_udc.c.

#define EP_ISO_TYPE   1

Definition at line 101 of file lpc32xx_udc.c.

#define EP_MASK_SEL (   ep,
  dir 
)    (1 << (((ep) * 2) + dir))

Definition at line 98 of file lpc32xx_udc.c.

#define EP_OUT   0 /* RX (from host) */

Definition at line 94 of file lpc32xx_udc.c.

#define EP_RLZED_INT   0x00000100

Definition at line 404 of file lpc32xx_udc.c.

#define EP_SEL_B_1_FULL   0x20

Definition at line 484 of file lpc32xx_udc.c.

#define EP_SEL_B_2_FULL   0x40

Definition at line 485 of file lpc32xx_udc.c.

#define EP_SEL_EPN   0x10

Definition at line 483 of file lpc32xx_udc.c.

#define EP_SEL_F   0x01

Definition at line 479 of file lpc32xx_udc.c.

#define EP_SEL_PO   0x08

Definition at line 482 of file lpc32xx_udc.c.

#define EP_SEL_ST   0x02

Definition at line 480 of file lpc32xx_udc.c.

#define EP_SEL_STP   0x04

Definition at line 481 of file lpc32xx_udc.c.

#define EP_SLOW_INT   0x00000004

Definition at line 398 of file lpc32xx_udc.c.

#define EP_STAT_CND_ST   0x80

Definition at line 491 of file lpc32xx_udc.c.

#define EP_STAT_DA   0x20

Definition at line 489 of file lpc32xx_udc.c.

#define EP_STAT_RF_MO   0x40

Definition at line 490 of file lpc32xx_udc.c.

#define EP_STAT_ST   0x01

Definition at line 488 of file lpc32xx_udc.c.

#define ep_warn (   epp,
  fmt,
  arg... 
)    dev_warn(epp->udc->dev, "%s:" fmt, __func__, ## arg)

Definition at line 223 of file lpc32xx_udc.c.

#define ERR_B_OVRN   0x20

Definition at line 474 of file lpc32xx_udc.c.

#define ERR_BTSTF   0x40

Definition at line 475 of file lpc32xx_udc.c.

#define ERR_DCRC   0x04

Definition at line 471 of file lpc32xx_udc.c.

#define ERR_EA   0x10

Definition at line 466 of file lpc32xx_udc.c.

#define ERR_EC_MASK   0x0F

Definition at line 465 of file lpc32xx_udc.c.

#define ERR_EOP   0x10

Definition at line 473 of file lpc32xx_udc.c.

#define ERR_INT   0x00000200

Definition at line 405 of file lpc32xx_udc.c.

#define ERR_PID   0x01

Definition at line 469 of file lpc32xx_udc.c.

#define ERR_TGL   0x80

Definition at line 476 of file lpc32xx_udc.c.

#define ERR_TIMOUT   0x08

Definition at line 472 of file lpc32xx_udc.c.

#define ERR_UEPKT   0x02

Definition at line 470 of file lpc32xx_udc.c.

#define FRAME_INT   0x00000001

Definition at line 396 of file lpc32xx_udc.c.

#define INAK_BI   0x20

Definition at line 454 of file lpc32xx_udc.c.

#define INAK_BO   0x40

Definition at line 455 of file lpc32xx_udc.c.

#define INAK_CI   0x02

Definition at line 450 of file lpc32xx_udc.c.

#define INAK_CO   0x04

Definition at line 451 of file lpc32xx_udc.c.

#define INAK_II   0x08

Definition at line 452 of file lpc32xx_udc.c.

#define INAK_IO   0x10

Definition at line 453 of file lpc32xx_udc.c.

#define IRQ_USB_ATX   3

Definition at line 92 of file lpc32xx_udc.c.

#define IRQ_USB_DEVDMA   2

Definition at line 91 of file lpc32xx_udc.c.

#define IRQ_USB_HP   1

Definition at line 90 of file lpc32xx_udc.c.

#define IRQ_USB_LP   0

Definition at line 89 of file lpc32xx_udc.c.

#define lpc32xx_udc_resume   NULL

Definition at line 3438 of file lpc32xx_udc.c.

#define lpc32xx_udc_suspend   NULL

Definition at line 3437 of file lpc32xx_udc.c.

#define NDD_REQ_INT   0x02

Definition at line 498 of file lpc32xx_udc.c.

#define NUM_ENDPOINTS   16

Definition at line 84 of file lpc32xx_udc.c.

#define PKT_DV   0x00000400

Definition at line 409 of file lpc32xx_udc.c.

#define PKT_LNGTH_MASK   0x000003FF

Definition at line 408 of file lpc32xx_udc.c.

#define PKT_RDY   0x00000800

Definition at line 410 of file lpc32xx_udc.c.

#define RxENDPKT_INT   0x00000040

Definition at line 402 of file lpc32xx_udc.c.

#define SYS_ERR_INT   0x04

Definition at line 499 of file lpc32xx_udc.c.

#define TxENDPKT_INT   0x00000080

Definition at line 403 of file lpc32xx_udc.c.

#define UDCA_BUFF_SIZE   (128)

Definition at line 226 of file lpc32xx_udc.c.

#define USB_CTRL   IO_ADDRESS(LPC32XX_CLK_PM_BASE + 0x64)

Definition at line 231 of file lpc32xx_udc.c.

#define USB_DEV_NEED_CLK_EN   (1 << 22)

Definition at line 236 of file lpc32xx_udc.c.

#define USB_HOST_NEED_CLK_EN   (1 << 21)

Definition at line 235 of file lpc32xx_udc.c.

#define USB_SLAVE_HCLK_EN   (1 << 24)

Definition at line 234 of file lpc32xx_udc.c.

#define USBD_CCEMPTY   (1 << 4)

Definition at line 300 of file lpc32xx_udc.c.

#define USBD_CDFULL   (1 << 5)

Definition at line 299 of file lpc32xx_udc.c.

#define USBD_CMD_CODE (   c)    ((c) << 16)

Definition at line 351 of file lpc32xx_udc.c.

#define USBD_CMD_PHASE (   p)    ((p) << 8)

Definition at line 352 of file lpc32xx_udc.c.

#define USBD_CMDCODE (   x)    ((x) + 0x210)

Definition at line 246 of file lpc32xx_udc.c.

#define USBD_CMDDATA (   x)    ((x) + 0x214)

Definition at line 247 of file lpc32xx_udc.c.

#define USBD_CTRL (   x)    ((x) + 0x228)

Definition at line 252 of file lpc32xx_udc.c.

#define USBD_DEV_STAT   (1 << 3)

Definition at line 301 of file lpc32xx_udc.c.

#define USBD_DEVINTCLR (   x)    ((x) + 0x208)

Definition at line 244 of file lpc32xx_udc.c.

#define USBD_DEVINTEN (   x)    ((x) + 0x204)

Definition at line 243 of file lpc32xx_udc.c.

#define USBD_DEVINTPRI (   x)    ((x) + 0x22C)

Definition at line 253 of file lpc32xx_udc.c.

#define USBD_DEVINTSET (   x)    ((x) + 0x20C)

Definition at line 245 of file lpc32xx_udc.c.

#define USBD_DEVINTST (   x)    ((x) + 0x200)

Definition at line 242 of file lpc32xx_udc.c.

#define USBD_DMAEP (   e)    (1 << (e))

Definition at line 357 of file lpc32xx_udc.c.

#define USBD_DMAINTEN (   x)    ((x) + 0x294)

Definition at line 277 of file lpc32xx_udc.c.

#define USBD_DMAINTST (   x)    ((x) + 0x290)

Definition at line 276 of file lpc32xx_udc.c.

#define USBD_DMARCLR (   x)    ((x) + 0x254)

Definition at line 266 of file lpc32xx_udc.c.

#define USBD_DMARSET (   x)    ((x) + 0x258)

Definition at line 267 of file lpc32xx_udc.c.

#define USBD_DMARST (   x)    ((x) + 0x250)

Definition at line 265 of file lpc32xx_udc.c.

#define USBD_DV   (1 << 10)

Definition at line 338 of file lpc32xx_udc.c.

#define USBD_EOT_INT   (1 << 0)

Definition at line 332 of file lpc32xx_udc.c.

#define USBD_EOTINTCLR (   x)    ((x) + 0x2A4)

Definition at line 280 of file lpc32xx_udc.c.

#define USBD_EOTINTSET (   x)    ((x) + 0x2A8)

Definition at line 281 of file lpc32xx_udc.c.

#define USBD_EOTINTST (   x)    ((x) + 0x2A0)

Definition at line 279 of file lpc32xx_udc.c.

#define USBD_EP_FAST   (1 << 1)

Definition at line 303 of file lpc32xx_udc.c.

#define USBD_EP_RLZED   (1 << 8)

Definition at line 296 of file lpc32xx_udc.c.

#define USBD_EP_SEL (   e)    (1 << (e))

Definition at line 325 of file lpc32xx_udc.c.

#define USBD_EP_SLOW   (1 << 2)

Definition at line 302 of file lpc32xx_udc.c.

#define USBD_EPDMADIS (   x)    ((x) + 0x28C)

Definition at line 274 of file lpc32xx_udc.c.

#define USBD_EPDMAEN (   x)    ((x) + 0x288)

Definition at line 273 of file lpc32xx_udc.c.

#define USBD_EPDMAST (   x)    ((x) + 0x284)

Definition at line 272 of file lpc32xx_udc.c.

#define USBD_EPIND (   x)    ((x) + 0x248)

Definition at line 260 of file lpc32xx_udc.c.

#define USBD_EPINTCLR (   x)    ((x) + 0x238)

Definition at line 256 of file lpc32xx_udc.c.

#define USBD_EPINTEN (   x)    ((x) + 0x234)

Definition at line 255 of file lpc32xx_udc.c.

#define USBD_EPINTPRI (   x)    ((x) + 0x240)

Definition at line 258 of file lpc32xx_udc.c.

#define USBD_EPINTSET (   x)    ((x) + 0x23C)

Definition at line 257 of file lpc32xx_udc.c.

#define USBD_EPINTST (   x)    ((x) + 0x230)

Definition at line 254 of file lpc32xx_udc.c.

#define USBD_EPMAXPSIZE (   x)    ((x) + 0x24C)

Definition at line 261 of file lpc32xx_udc.c.

#define USBD_ERR_INT   (1 << 9)

Definition at line 295 of file lpc32xx_udc.c.

#define USBD_FRAME   (1 << 0)

Definition at line 304 of file lpc32xx_udc.c.

#define USBD_LOG_ENDPOINT (   e)    ((e) << 2)

Definition at line 344 of file lpc32xx_udc.c.

#define USBD_NDDRTINTCLR (   x)    ((x) + 0x2B0)

Definition at line 284 of file lpc32xx_udc.c.

#define USBD_NDDRTINTSET (   x)    ((x) + 0x2B4)

Definition at line 285 of file lpc32xx_udc.c.

#define USBD_NDDRTINTST (   x)    ((x) + 0x2AC)

Definition at line 283 of file lpc32xx_udc.c.

#define USBD_NEW_DD_INT   (1 << 1)

Definition at line 331 of file lpc32xx_udc.c.

#define USBD_PK_LEN_MASK   0x3FF

Definition at line 339 of file lpc32xx_udc.c.

#define USBD_PKT_RDY   (1 << 11)

Definition at line 337 of file lpc32xx_udc.c.

#define USBD_RD_EN   (1 << 0)

Definition at line 346 of file lpc32xx_udc.c.

#define USBD_REEP (   x)    ((x) + 0x244)

Definition at line 259 of file lpc32xx_udc.c.

#define USBD_RX_EP_SEL (   e)    (1 << ((e) << 1))

Definition at line 311 of file lpc32xx_udc.c.

#define USBD_RXDATA (   x)    ((x) + 0x218)

Definition at line 248 of file lpc32xx_udc.c.

#define USBD_RXENDPKT   (1 << 6)

Definition at line 298 of file lpc32xx_udc.c.

#define USBD_RXPLEN (   x)    ((x) + 0x220)

Definition at line 250 of file lpc32xx_udc.c.

#define USBD_SYS_ERR_INT   (1 << 2)

Definition at line 330 of file lpc32xx_udc.c.

#define USBD_SYSERRTINTCLR (   x)    ((x) + 0x2BC)

Definition at line 288 of file lpc32xx_udc.c.

#define USBD_SYSERRTINTSET (   x)    ((x) + 0x2C0)

Definition at line 289 of file lpc32xx_udc.c.

#define USBD_SYSERRTINTST (   x)    ((x) + 0x2B8)

Definition at line 287 of file lpc32xx_udc.c.

#define USBD_TX_EP_SEL (   e)    (1 << (((e) << 1) + 1))

Definition at line 314 of file lpc32xx_udc.c.

#define USBD_TXDATA (   x)    ((x) + 0x21C)

Definition at line 249 of file lpc32xx_udc.c.

#define USBD_TXENDPKT   (1 << 7)

Definition at line 297 of file lpc32xx_udc.c.

#define USBD_TXPLEN (   x)    ((x) + 0x224)

Definition at line 251 of file lpc32xx_udc.c.

#define USBD_UDCAH (   x)    ((x) + 0x280)

Definition at line 269 of file lpc32xx_udc.c.

#define USBD_WR_EN   (1 << 1)

Definition at line 345 of file lpc32xx_udc.c.

#define WAIT_FOR_SETUP   0 /* Wait for setup packet */

Definition at line 106 of file lpc32xx_udc.c.

Typedef Documentation

typedef void(* usc_chg_event)(int)

Definition at line 71 of file lpc32xx_udc.c.

Function Documentation

MODULE_ALIAS ( "platform:lpc32xx_udc"  )
MODULE_AUTHOR ( "Kevin Wells <[email protected]>"  )
MODULE_AUTHOR ( "Roland Stigge <[email protected]>"  )
MODULE_DESCRIPTION ( "LPC32XX udc driver )
module_exit ( udc_exit_module  )
module_init ( udc_init_module  )
MODULE_LICENSE ( "GPL"  )
void udc_handle_eps ( struct lpc32xx_udc udc,
struct lpc32xx_ep ep 
)

Definition at line 2034 of file lpc32xx_udc.c.

void udc_send_in_zlp ( struct lpc32xx_udc udc,
struct lpc32xx_ep ep 
)

Definition at line 2020 of file lpc32xx_udc.c.

Variable Documentation

struct lpc32xx_usbd_cfg lpc32xx_usbddata
Initial value:
= {
.vbus_drv_pol = 0,
.conn_chgb = &lpc32xx_usbd_conn_chg,
.susp_chgb = &lpc32xx_usbd_susp_chg,
.rmwk_chgb = &lpc32xx_rmwkup_chg,
}

Definition at line 3063 of file lpc32xx_udc.c.