Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  lpc32xx_udc.c   Sprache: C

 

// SPDX-License-Identifier: GPL-2.0+
/*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 40
 * USB Gadget java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 2
 *
 * Authors:
 *    Kevin Wells <kevin.wells@nxp.com>
 *    Mike James
 *    Roland Stigge <stigge@antcom.de>
 *
 * Copyright (C) 2006 Philips Semiconductors
 i >
 * Copyright (C) 2012 Roland Stigge
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * Note: his  isbasedon by  Jamesfor
 *      the.
 */


#usc_chg_eventjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
#include <linuxjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 60
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/i2c.h>
#includejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
##define java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 24
i l.
#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
 */

 *))
struct lpc32xx_usbd_cfg
int    =driveVBUS  /
 usc_chg_eventd   /* TX (to host) */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 usc_chg_event #ep)1<(  )+)
};

/*
 * controller driver data structures


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

#define  16

/*
 * IRQ indices make reading the code a little easier
 */

#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) */

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

#define 
#define EP_ISO_TYPE 1
#efine EP_BLK_TYPE 2
#define EP_CTL_TYPEjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17

/* EP0 states */
R_SETUPjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
java.lang.NullPointerException
#define DATA_OUT       2 /* Expect host->dev transfer */

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

structlpc32xx_usbd_dd_gad
 u32 dd_next_phy;
 u32 dd_setup;
 u32 dd_buffer_addr;
 u32 dd_status;
 u32dd_iso_ps_mem_addr;
 u32 this_dma;
 u32 iso_status[6]; /* 5 spare */
 u32 dd_next_v;
};

/*
*Logical endpoint structure
 */

structusb_gadget_driver *river
 struct usb_ep  struct platform_device *dev;
 struct list_head queue;
 struct lpc32xx_udc *udc;

 u32   hwep_num_base; /* Physical hardware EP */
 u32   hwep_num *java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 u32   maxpacket;
 u32   lep;

 bool   int udp_irq]java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 bool   req_pending
 u32   eptype;

 u32                     totalints;

bool  wedge;
};

enum atx_type {
 ISP1301,
 STOTG04,
};

/*
 * Common UDC structure
 */

struct u32  enabled_hwepints;
 struct usb_gadget gadget;
 struct usb_gadget_driver *driver;
 struct platform_device *pdev;
 struct device  *dev;
 spinlock_t  u32  ;
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

/
 struct lpc32xx_usbd_cfg *board;
 java.lang.StringIndexOutOfBoundsException: Range [13, 5) out of bounds for length 29
   udp_irq4;
 struct clk  *usb_slv_clk;

 /* DMA support */
 u32  udca_v_base;
 u32   udca_p_base;
 struct structwork_struct;

 /* Common EP and control data */
 u32   enabled_devints
 u32 enabled_hwepints
 u32   struct lpc32xx_ep[NUM_ENDPOINTS]
  realized_eps;

 /* VBUS detection, pullup, and power flags */;
 u8 ;
 u8   last_vbus;
 int   pullup;
 int  poweron;
 enum atx_type  atx;

/* Work related  I2C  *
 struct work_struct pullup_job;
 struct work_struct }

 /* USB device peripheral - various */
2xx_ep [UM_ENDPOINTS]
 bool   enabled;
 bool   clocked;
 bool   suspended;
 int                     ep0state;
 atomic_t                enabled_ep_cnt;
 wait_queue_head_t *
st lpc32xx_request{

/*
 * Endpoint request
 */

struct lpc32xx_requestjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 struct usb_request;
 struct list_head queuestatic  struct lpc32xx_udc*(tructusb_gadget *java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 lpc32xx_usbd_dd_gad dd_desc_ptr
 bool   mapped;
 bool   send_zlp;
};

 inline structlpc32xx_udc to_udcs usb_gadget*)
{
 return dev_dbg(epp->udcdev,"%s:",__unc__java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
}

ep_dbg( .. 
 dev_dbg#ep_info(,,arg.)\
# ep_err,fmt .)\
 dev_err(epp->udc->dev, "%s: " fmt, __func__, ##ep_warn(,fmt .. java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
#define ep_info(epp, fmt, 
 dev_info(pp>dc-dev,%  fmt,_f,# java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
#define ep_warn(epp, fmt, arg..
 dev_warn(epp->dc>,"%: _func__,# java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

#define UDCA_BUFF_SIZE (128)

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


#define USBD_DEVINTST(x) ((x) + 0x200)
#define USBD_DEVINTEN(xjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
8)
#define USBD_DEVINTSET(x) ((x) + 0x20C)
#efine USBD_CMDCODE(x)  ((x) + 0x210)
#define USBD_CMDDATA(x)  ((x) + 0x214)
define() (x + 0)
#define USBD_TXDATA(x)defineUSBD_DEVINTSETx)(x) +0x20Cjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
#define USBD_RXPLEN(x)  ((x# USBD_CMDDATA() () x214)
#define USBD_TXPLEN(x)  ((java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 37
#define USBD_CTRL(#define USBD_TXPLEN) 
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 39
#define USBD_EPINTST(x)  (#defineUSBD_DEVINTPRI(x (()+0x22Cjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
#define define ()+
#define USBD_EPINTCLR# )x  0java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
# x  x23C
#define USBD_EPINTPRI(x) (#java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 35
#define USBD_REEP(x) #x ) )
#define USBD_EPIND(x)  ((x
#define USBD_EPMAXPSIZE(x) ((x) + 0x24C)
/* DMA support registers only below */
/* Set, clear, or get enabled state of the DMA request status. Ifdefine (x  ()+0250)
 * enabled, an IN or OUT token will start a DMA transfer for the EP */

#define USBD_DMARST(x) (  x)
#define USBD_DMARCLR(x)  ((x) + 0x254)
#define USBD_DMARSET(x)  ((x) + 0java.lang.StringIndexOutOfBoundsException: Range [67, 37) out of bounds for length 67
/* DMA UDCA head pointer */
##defineUSBD_EPDMAST(x)  ((x) + 0x284)
/* EP DMA status, enable, and disable. This is used to specifically
 * enabled or disable DMA for a specific EP */

#efine  USBD_EPDMASTx) (()+0)
#define USBD_EPDMAEN(x)  ((x) + 0x288)
# java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
/* DMA master interrupts enable and pending interrupts */
#define USBD_DMAINTST(x) ((xjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 38
#define USBD_DMAINTEN(x)# ( (  )
/* DMA end of transfer interrupt enable, disable, status */
#define USBD_EOTINTST(x)
#define USBD_EOTINTCLR(x) ((x) +# java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 40
#define USBD_EOTINTSET
/* New DD request interrupt enable, disable, status */
 ()+x2AC
#define USBD_NDDRTINTCLR(x) ((x) +  xBCjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
#define java.lang.StringIndexOutOfBoundsException: Range [71, 23) out of bounds for length 71

#define USBD_SYSERRTINTST(x) ((x) + 0x2B8)
#define USBD_SYSERRTINTCLR(x) ((x) + 0java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 38
#define USBD_SYSERRTINTSET*******

/**********************************************************************
 * USBD_DEVINTST/USBD_DEVINTEN/java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31
 * d java.lang.StringIndexOutOfBoundsException: Range [25, 20) out of bounds for length 30
 **********************************************************************/

#define USBD_ERR_INT  (1 << 9)
#define java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
#define USBD_TXENDPKT  (1 << 7)
#define USBD_RXENDPKT  (1 << 6)
#define USBD_CDFULL  (1 << 5)
#define java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
#define java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 31
#define java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 30
#define USBD_FRAME  (1 << 0)

/**********************************************************************
*java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 57
 * USBD_EPINTPRI register definitions
 **********************************************************************/

/* End point selection macro (RX) */
#define USBD_RX_EP_SEL(e) (1 << ((e) << 1))

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

/**********************************************************************
 * USBD_REEP/USBD_DMARST/USBD_DMARCLR/USBD_DMARSET/USBD_EPDMAST/
 * USBD_EPDMAEN/USBD_EPDMADIS/
 #define USBD_EP_SEL(e)  (1 << (e))
*java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
*
 * register definitions
 **********************************************************************/

/* Endpoint selection macro */
#define #define USBD_PKT_RD 1 <11)

/**********************************************************************
 * SBD_DMAINTST/USBD_DMAINTEN
 **********************************************************************/

#define USBD_SYS_ERR_INT (1 << 2)
#define USBD_NEW_DD_INT  (1 << 1)
#define USBD_EOT_INTdefine( (e < )

/**********************************************************************
*  definitions
 **********************************************************************/

#define USBD_PKT_RDY  (1 << 11)
#define USBD_DV   (1 << 10)
#define USBD_PK_LEN_MASKUSBD_CMD_PHASE <8

/**********************************************************************
 * USBD_CTRL register definitions
 **********************************************************************/

#define USBD_LOG_ENDPOINT(e *****
#define#USBD_DMAEPe 1 <()
#define java.lang.StringIndexOutOfBoundsException: Range [60, 21) out of bounds for length 60

/**********************************************************************
 *java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 24
 **********************************************************************/

#efine (c) (c)< 16)
#define USBD_CMD_PHASE(p) ((p) << 8)

/**********************************************************************
  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 61
 **********************************************************************/

#define USBD_DMAEP(e)  (1 <<#java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 54

/* DD (DMA Descriptor) structure, requires word alignment */
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 24
 u32 *dd_next;
 u32 dd_setup;
 u32 dd_buffer_addr;
 u320java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
 u32
};

/* dd_setup bit defines */
java.lang.StringIndexOutOfBoundsException: Range [35, 30) out of bounds for length 35
##definex40/* LS byte extracted (ATLE) */
# java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 29
 < )
#define DD_SETUP_DMALENBYTES(n) (((n) & 0xFFFF) << 16)

/* dd_status bit defines */
#define java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 2
#define DD_STATUS_STS_MASK 01E
#define DD_STATUS_STS_NS 0x00 /* Not serviced */
#define java.lang.StringIndexOutOfBoundsException: Range [38, 23) out of bounds for length 38
# DD_STATUS_STS_NC 0x04/*Normal */
 006/
#define DD_STATUS_STS_DOR 0x08 /* Data overrun */
#define define DEV_STAT_INT  0x00000008
#define DD_STATUS_PKT_VAL 0x20 /* Packet valid */
define DD_STATUS_LSB_EX0 /* LS byte extracted (ATLE) */  ()*
#define DD_STATUS_MSB_EX 0x80 /* MS byte extracted (ATLE) */
#define DD_STATUS_MLEN(n) (((n) >> 8) & 0x3F)
(n)>16)&x)

/*
 
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 *
 */

/* Device Interrupt Bit Definitions */
#define FRAME_INT  0x00000001
#define EP_FAST_INT  0x00000002
#define EP_SLOW_INT  0x00000004
define   0x00000008
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define CDFULL_INT  0x00000020
#define RxENDPKT_INT  0x00000040
#define TxENDPKT_INT  0x00000080
#define EP_RLZED_INT  0x00000100
#define ERR_INT   0x00000200

/* Rx & Tx Packet Length Definitions */
#define PKT_LNGTH_MASK  0x000003FF
#define PKT_DV   0x00000400
#define PKT_RDY   0x00000800

/* USB Control Definitions */
#define CTRL_RD_EN  0x00000001
#efine  0x00000002

/* Command Codes */
#define CMD_SET_ADDR  0x00D00500
  0x00D80500
#CMD_SET_DEV_STAT 
#  0
dDAT_RD_FRAME java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
#   0x00FD0500
#define define CMD_RD_ERR_STAT
#define CMD_SET_DEV_STAT#   000
define 0x00FE0500
#define DAT_GET_DEV_STAT 0x00FE0200
#define CMD_GET_ERR_CODE 000FF0500
#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#efineDAT_SEL_EP(x)  (x00000200 | ((x) << 16))
#define DAT_SEL_EP(x)  (0x00000200 | ((x) << 16))
#x) (0x00400500 | ((x) << 16))
#define DAT_SEL_EP_CLRI(x) (0x00400200 | ((x) << 16))
#efine CMD_SET_EP_STAT(x) (0x00400500 | ((x) << 16))
#define CMD_CLR_BUF  0x00F20500
#define DAT_CLR_BUF  0x00F20200
#define CMD_VALID_BUF  0x00FA0500

/* Device Address Register Definitions */
#define DEV_ADDR_MASK0x7F
  x

/* Device Configure Register Definitions */
#define CONF_DVICE  0x01

/* Device Mode Register Definitions */
#define /
#define INAK_CI  xjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
#define INAK_CO   0x04
#define INAK_II   0x08
#define INAK_IO   0x10
#define INAK_BI   0x20
#definejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

/* Device Status Register Definitions */ java.lang.StringIndexOutOfBoundsException: Range [21, 18) out of bounds for length 24
#define DEV_CON   0x01java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
#define java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
#define DEV_SUS   0x04
defineDEV_SUS_CH 0x08
#define DEV_RST   0x10

/* Error Code Register Definitions */
#define ERR_EC_MASK  0x0F
# ERR_EA   x10

/* Error Status Register Definitions */define ERR_UEPKT  0x02
#define ERR_PID   0x01
#define ERR_UEPKTdefine ERR_DCRC  x04
#define ERR_DCRC  0x04
#define    0java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
#define ERR_EOP   0x10
#definex20
#define ERR_BTSTF  0x40
#define ERR_TGL   0x80

/* Endpoint Select Register Definitions */ java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 24
#define EP_SEL_F  d java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 24
#define EP_SEL_ST  0x02
#define EP_SEL_STP  0x04
#define EP_SEL_PO/
#define EP_SEL_EPN  0x10
#define EP_SEL_B_1_FULL  0x20
#define EP_SEL_B_2_FULL  0x40

/* Endpoint Status Register Definitions */
#define EP_STAT_ST  0x01
#define EP_STAT_DA  0x20
#define EP_STAT_RF_MO  0x40
#define EP_STAT_CND_ST  0x80

/* Clear Buffer Register Definitions */
#define CLR_BUF_PO  0x01

/* DMA Interrupt Bit Definitions */ SYS_ERR_INTxjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

#define NDD_REQ_INT   ]="java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
#define SYS_ERR_INT

#define DRIVER_VERSION "1.03 *proc java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25
static const java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 3

/*
 *
 * proc interface support
 *
 */

#ifdef  void proc_ep_show  *,  *)
static char *epnames[] = {"INT", "ISO", "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static seq_printf %s4 3"

java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 67
{
 *;

 seq_printf(s, "\n");
 seq_printf(s, "%12s, maxpacket %4d %3s",
 ep-ep.name, ep->pmaxpacketjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
";
 seq_printf(s, " type %4s", epnames[ep->eptype]);
 seq_printf(s, " ints: %12d", ->ueue, queue){

if(ist_empty&ep-q)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  seq_printfs \queue\"java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 else java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 (req ep>,queue){
   u32 length = req->req.actual;

   seq_printf(s, "\treq %p  }
       &req->req, length,
 req>eq.,-req.)
  }
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}

static int udc_show(struct seq_file *s, void *unused)
{
 struct lpc32xx_udc *udc &- 
 struct lpc32xx_ep *s s, pullups  java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 65
 unsigned long flags;

 (, %:sn" ,);

    disabled,

 seq_printf(," s,pullup % spowereds, s\"
     udc->vbus ? "present" : "    -s  ,  "
 udc>?(udc-vbus ?a  ":
     "disabled",
     udc->gadget.is_selfpowered ? "self" : "java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 33
     udc->suspended ? ", suspended" : "",
     udc->driver ? proc_ep_show )

 if (udc- java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 43
  proc_ep_show(s, &udc->ep[0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  list_for_each_entry(ep, &udc->gadget
   (s )
 }

 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1

 return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}

DEFINE_SHOW_ATTRIBUTE(udc);

static void create_debug_file
{
 debugfs_create_file(debug_filename, 0static inline  create_debug_file( lpc32xx_udc*){java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
}

static void remove_debug_file
{
 debugfs_lookup_and_removevoid java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 58
}

#else
static i2c_smbus_read_word_datajava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 64
#endif

/* Primary initialization sequence for the ISP1301 transceiver */
static void isp1301_udc_configure(struct lpc32xx_udc *udc)
{
 u8 value;
 s32 vendor, product;

 vendor = /* Disable transparentUART  /
 product = i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x02);

  && =0java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
  udc->atx = STOTG04;

 /* LPC32XX only supports DAT_SE0 USB mode */
 /* This sequence is important */

 /* Disable transparent UART mode first */
 i2c_smbus_write_byte_data(udc-> (ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLE,~)
| ),
  MC1_UART_EN  |java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 61

 /* Set full speed and SE0 mode */
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
  (ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR), ~0);
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
  ISP1301_I2C_MODE_CONTROL_1, (MC1_SPEED_REG | MC1_DAT_SE0));

 /*
  * The PSW_OE enable bit state is reversed in the ISP1301 User's Guide
 */

 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
  (ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR),  u-java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52

 value = MC2_BI_DI;
  !=
  value |= MC2_SPD_SUSP_CTRL
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
 , );

 /* Driver VBUS_DRV high or low depending on board setup */
 if (udc->board->vbus_drv_pol != 0)
    is 
   , )
 else
  i2c_smbus_write_byte_data(u-java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
 java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 58
   OTG1_VBUS_DRV);

 /* Bi-directional mode with suspend control
 - the  be enable 
 * is detected */

 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ), ~0);
 i2c_smbus_write_byte_data(udc->java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
  ISP1301_I2C_OTG_CONTROL_1,
  (0 | OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN));

 /* Discharge VBUS (just in case) */
 i2c_smbus_write_byte_data>,
  ISP1301_I2C_OTG_CONTROL_1, ISP1301_I2C_INTERRUPT_RISING|ISP1301_I2C_REG_CLEAR_ADDR, 0;
 msleep(1);
 java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 51
  (java.lang.StringIndexOutOfBoundsException: Range [57, 28) out of bounds for length 59
US_DISCHRG

 i2c_smbus_write_byte_data(->,
  ISP1301_I2C_INTERRUPT_LATCH

 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
  ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
 (udc-,
  ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 dev_info(udc->dev, "ISP1301 Vendor ID  :  i2c_smbus_write_byte_data(udc->,
 dev_info(udc->dev, "ISP1301 Product ID : 0
 dev_info(>,"SP1301 Version ID : 0x%04xn",
   i2c_smbus_read_word_data(udc->isp1301_i2c_client i2c_smbus_write_byte_data->sp1301_i2c_client,

}

/* Enables or disables the USB device pullup via the ISP1301 transceiver */
static void isp1301_pullup_set(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
{
 if (udc->pullup){
  /* Enable pullup for bus signalling */
  i2c_smbus_write_byte_data(udc->isp1301_i2c_client (,struct ,pullup_job)
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 /* Enable pullup for bus signalling */
  i2c_smbus_write_byte_dataintblock)
   ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
    (en_pullup=udc->ullupjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}

static void pullup_work(struct work_struct *work (udc;
{
 struct lpc32xx_udc *udc =
  container_of(work, struct lpc32xx_udc, }

 isp1301_pullup_set(udc);
}

static void {
      int block)
{
if (n_pullup =udc-pullupjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  return;

 udc- /* Power up ISP1301 - this ISP1301 will automatically wakeup
 if (    when   when  is *
  isp1301_pullup_set(udc);
 else
/* defer slow i2c pull up setting */

  schedule_work(&udc->pullup_job);
}

#ifdef CONFIG_PM
/* Powers up or down the ISP1301 transceiver */
static void isp1301_set_powerstate(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 26
{
 /* There is no "global power down" register for stotg04 */
java.lang.StringIndexOutOfBoundsException: Range [41, 25) out of bounds for length 25
  return;

 if (enable != 0 
  /* Power up ISP1301 - this ISP1301 will automatically wakeup
   when VBUS is detected */

  i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
   ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR*/
   MC2_GLOBAL_PWR_DN);
 else
  /* Power down ISP1301 */
  i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
}

 struct *)
{
 struct lpc32xx_udc *udc  (= 0 {
 container_of(work, struct lpc32xx_udc )java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

 isp1301_set_powerstate( cmd (->;
}
#endif

/*
 *
  enginecommand/java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 63
 *
 */

/* Issues a single command to the USB device state machine */
static cpu_relax
{
 u32 pass = 0;
 int to

 isn'  */
 u32 tmp = readl(USBD_DEVINTST(udc      data
 (void) tmp;

 while (pass == 0) {
  writel(udc_protocol_cmd_w(udc data);

  /* Write command code */
  writel(*Issues asingle  to USB  state machine reads
  to = 10000;
  while (((readl( u32(  udc,  )
    USBD_CCEMPTY) == 0){
   to--;
  }

  if (to > 0)
   pass = 1;

  cpu_relax();
 }
}

/* Issues 2 commands (or command and data) to the USB device state machine */
static inline void udc_protocol_cmd_data_w -java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
        u32 data)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 udc_protocol_cmd_w(udc,  return readl(USBD_CMDDATA(uudp_baseaddr);
 udc_protocol_cmd_w(udc, 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)
{
 int to = 1000;

d    protocol /
 writel((USBD_CDFULL | USBD_CCEMPTY),
       udc->enabled_devints;

 /* Write command code */
 udc_protocol_cmd_w(udc, cmd);

 while ((!(readl(USBD_DEVINTST(udc->udp_baseaddr)s   *, )
        && (to > 0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  to--;
 if (!to)
  dev_dbg(udc java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 70
   "Protocol java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 return readl(USBD_CMDDATA(udc->udp_baseaddr
}

/*
 *
 * USB device interrupt mask java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 *
 */

/* Enable one or more USB device interrupts */
static inline void uda_enable_devint(struct  (>java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 64
{
 udc->enabled_devints |= devmask;
 ));
}

/* Disable one or more USB device interrupts */
static inline void uda_disable_devint(struct lpc32xx_udc (-,(-java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64
/
 udc->enabled_devints &= ~static inline void uda_clear_hwepint(struct lpc32xx_udc *udc, u32 hwep)
 writel(udc->enabled_devintswritel(1 <,USBD_EPINTCLRudc-);
}

/* Clear one or more USB device interrupts */
java.lang.StringIndexOutOfBoundsException: Range [42, 6) out of bounds for length 70
{
 writel(mask, ((1 << hwep), USBD_EPDMAENu)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}

/*
 *
 * Endpoint interrupt disable/enable functions
 *
 */

/* Enable one or more USB endpoint interrupts */
static(tructudc,u32hwep)
{
 udc->enabled_hwepints |= (1 << hwep);
 writel(udc->enabled_hwepints, USBD_EPINTEN(udc->udp_baseaddr));
}

/* Disable one or more USB endpoint interrupts */
static void*
{
 udc->/* Before an endpointcanbeused,needs java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 58
 writel(udc->enabled_hwepints, USBD_EPINTEN(udc->udp_baseaddr));
}

/* Clear one or more USB endpoint interrupts */
void(java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 71
{
 writel((1 << hwep), USBD_EPINTCLR(udc->udp_baseaddr));
}

/* Enable DMA for the HW channel */
static inline void udc_ep_dma_enable(struct lpc32xx_udc *udc, u32 hwep)
{
 writel((1 << hwep), USBD_EPDMAEN(udc->udp_baseaddr));
}

/* Disable DMA for the HW channel */
static inline void udc_ep_dma_disable(struct lpc32xx_udc *udc, u32 hwep)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/*
 *
 * Endpoint realize/unrealize functions
 *
 */

/* Before an endpoint can be used, it needs to be realized
* the  -  .
 * The interrupt (FIFO or DMA) is not enabled with this function */

ealize_hwepstructjava.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 63
        u32 java.lang.StringIndexOutOfBoundsException: Range [50, 22) out of bounds for length 50
{
 int to = 1000;

 writel(USBD_EP_RLZED, USBD_DEVINTCLR(udc->udp_baseaddr));
 writel(hwep, USBD_EPIND(udcif(tojava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 udc>java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 34
 writel(udc->realized_eps
writel( udc-)

 /* Wait until endpoint is realized in hardware */
 while ((!(readl(USBD_DEVINTST( struct *dc,hwep)
    USBD_EP_RLZED)) && (to > 0))
  to--;
 if (!to)
  dev_dbg(udc->dev, "EP not correctly realized in hardware\n");

 USBD_EP_RLZED udc-);
}

/* Unrealize an EP */
static void udc_unrealize_hwep(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 2
{
 udc->realized_eps &= ~(1 << hwep)/
 writel(static u32 java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 62
}

/*
 *
   
 *
 */

/* Select and clear endpoint interrupt */
static u32 udc_selep_clrint(struct static void udc_disable_hwep(struct lpc32xx_udc *udc, u32 hwep)
{
 udc_protocol_cmd_w(udc, CMD_SEL_EP_CLRI(hwep));
 return udc_protocol_cmd_r(udc, DAT_SEL_EP_CLRI}
}

/* Disables the endpoint in the USB protocol engine */
java.lang.StringIndexOutOfBoundsException: Range [28, 6) out of bounds for length 63
{
 udc_protocol_cmd_data_w ( (hwep),
   E));
}

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

/* Clear stall or reset endpoint */
static void udc_clrstall_hwep(struct lpc32xx_udc *udc, u32 hwep)
{
 ujava.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 52
    DAT_WR_BYTE(0));
}

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

/*
 *
 * Endpoint buffer management functions
 *
 */

/* Clear the current endpoint's buffer */
 s lpc32xx_udc*,u32 hwep)
{
 udc_select_hwep(udc, hwep);
 udc_protocol_cmd_w(udc, CMD_CLR_BUF);
}

/* Validate the current endpoint's buffer */
static void udc_val_buffer_hwep(struct lpc32xx_udc *udc, java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
{
 udc_select_hwep(udc, hwep);
 udc_protocol_cmd_w(udc, CMD_VALID_BUF);
}

static inline
{
 /* Clear EP interrupt */
 uda_clear_hwepint( 
 return java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 36
}

/*
 *
 * USB EP DMA support
 *
 */

/* Allocate a DMA Descriptor */
static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udcjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 dma_addr_t   dma;
struct *d;

 dd urn ;
 if (dd)
  

 return dd;
}

/* Free a DMA Descriptor */
_free  *,  *djava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
{
 dma_pool_free(udc->java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 2
} setupand 

/*
 *
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *
 */

/* Enables or disables most of the USB system clocks when low power mode is
 *  * when
 * when a cable is disconnected */

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
{
 if (enable != 0) {
  if 
   return;

  udc->clocked = 1;
  clk_prepare_enable(udc->usb_slv_clk) 
 } else {
  if (!udc->clockedujava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 42
   return;

  udc->clocked = 0;
  clk_disable_unprepare(udc->usb_slv_clk);
 }
}

/* Set/reset USB device address */
static void udc_set_address();
{
 /* Address will be latched at the end of the status phase, or
   latched immediately if function is called twice */

 udc_protocol_cmd_data_w(udc, CMD_SET_ADDR,
    DAT_WR_BYTE(DEV_EN | addr));
}

/* Setup up a IN request for DMA transfer - this consists of determining the
 * list of DMA addresses for the transfer, n enabling thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * installing the DD into the UDCA, and then enabling the DMA for that EP */

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 *;
 u32

 ep->req_pending java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 30

 /* There will always be a request waiting here */
 req = list_entry(ep->queue.next=;

 /* Place the DD Descriptor into the UDCA */
 udc->udca_v_base[java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 1

 /* Enable DMA and interrupt for the HW EP */
 udc_ep_dma_enable(udc, hwep);

 /* Clear ZLP if last packet is not of MAXP size */
 if (req->req.length % ep->ep.maxpacket)
  req->send_zlp = 0;

 return 0;
}

/* Setup up a OUT request for DMA transfer - this consists of determining the
 * list of DMA addresses for the transfer,
 * 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 * -[  >java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 53
{
 struct lpc32xx_request *req;
 u32 hwep = ep->hwep_num;

 ep->req_pending = 1;

 /* There will always be a request waiting here */
 req = list_entry(ep->queue. udc_protocol_cmd_data_w(udc, CM java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 59

 /* Place the DD Descriptor into the UDCA */
 >java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 53

 /* Enable DMA and interrupt for the HW EP */
 udc_ep_dma_enable(udc, hwep);
 return 0;
}

static void  -java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 26
{
;

 /* Disable device */
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 59
 , 0)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

 /* Disable all device interrupts (including EP0) */
  /*

 /* Disable and reset all endpoint interrupts */
 for (i = 0; i < 32; i++) {
  uda_disable_hwepint(udc, i);
  uda_clear_hwepint(udc, i);
  udc_disable_hwep(udc, i);
ep ;
  

  /* Disable and clear all interrupts and DMA */
  udc_ep_dma_disable(udc, i java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 70
  writel( <,java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 54
(1< java.lang.StringIndexOutOfBoundsException: Range [39, 35) out of bounds for length 56
  writel((1 << i), java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
 (( < i),USBD_DMARCLR(dc>java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 52
 }

 /* Disable DMA interrupts */
 writel(0, USBD_DMAINTEN(udc->java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0

 0,u-ujava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 42
}

static void udc_enable( uda_enable_hwepint(udc, i);
{
 u32 i;
 struct lpc32xx_ep *ep = &udc->ep

 /* Start with known state *//
 udc_disable(udc);

/
 (udc java.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 70

 /* EP interrupts on high priority, FRAME interrupt on low priority */
 writel(USBD_EP_FAST, USBD_DEVINTPRI(udc->udp_baseaddr));
 writel(0xFFFF, USBD_EPINTPRI(udc->udp_baseaddr));

 /* Clear any pending device interrupts */
  /* Enable master DMA interrupts */

 /* Setup UDCA - not yet used (DMA) */
 writel(udc->udca_p_base, java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0

 /* Only enable EP0 in and out for now, EP0 only works in FIFO mode */
 for (i = 0; *USBspecifichandledcallbacks
  udc_realize_hwep(udc, i, ep->ep.maxpacket);
  uda_enable_hwepint(udc, i);
  udc_select_hwep(udc, i);
  udc_clrstall_hwep(udc, i);
  udc_clr_buffer_hwep(udc, i);
 }

 /* Device interrupt setup */
 uda_clear_devint(dc (    |
          USBD_EP_FAST));
 uda_enable_devint(udc, (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    USBD_EP_FAST));

 /* Set device address to 0 - called twice to force a latch in the USB
   engine without the need of a setup packet status closure */

 udc_set_address(udc, 0);
 udc_set_address(udc, 0);

 /* Enable master DMA interrupts */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
       USBD_DMAINTEN(udc->udp_baseaddr));

 udc->dev_status java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

*
 *
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *
 *
/* Connection change event - notify board function of change */
static java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
{
 /* Just notify of a connection change event (optional) */
 if (udc->board->conn_chgb != NULL)

}

/* Suspend/resume event - notify board function of change */
static void uda_resm_susp_event(struct java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 26
{
 /* Just notify of a Suspend/resume change event (optional) */
 if (udc->board->susp_chgb != NULL)
  udc->board->susp_chgb(conn);

 if (conn= for (n = 0; n < cbytes; n += 4)
  udc->suspended = 0;
 else
  udc->suspended = 1;
}

/* Remote wakeup enable/disable - notify board function of change */
static bl java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
{
if u-board- ! NULL)
  udc-> data  ] (>n* 8)  xFF
          
}

/* Reads data from FIFO, adjusts for alignment and data size */
static void udc_pop_fifo(struct lpc32xx_udc *udc, u8 *java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 28
{
 int n, i (  ;   +){
 u16 *p16;
  tmp,cbytes;

 /* Use optimal data transfer method based on source address and size */  bl=bytes-n;
 switch (((uintptr_t) data) & 0x3) {
 case 0: /* 32-bit aligned */
  p32 = (u32 *) data;
   =(ytes  03;

  /* Copy 32-bit aligned data first */ data[  ] =(8 ( > i*8) x);
  for (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   *p32++  p16=(16* ;

  /* Handle any remaining bytes */
     - cbytes-cbytes;
  if (bl) {
   tmp = readl(USBD_RXDATA(udc->udp_baseaddr));
   (  ;n<bl ++
    data[cbytes + n] = ((tmp >> (n * 8)) & 0xFF *16  ()tmp x);

  }
  break;

 case 1: /* 8-bit aligned */
 case 3:
  /* Each byte has to be handled independently */
  for (n = 0; n < bytes; n += 4) {
   tmp = readl(USBD_RXDATA(udc->udp_baseaddr));

   bl = bytes - n;
   if (bl > 4)
    bl = 4;

   for (i = 0; i < bl; i++)
    data[n + i] =(u8 ( >> (i  0FF
  }
  break;

 case 2: /* 16-bit aligned */
  p16 = (u16 *) data;
  cbytes = (bytes & ~0x3);

  /* Copy 32-bit sized objects first with 16-bit alignment */
  for (n = 0; n < cbytes; n += 4) {
   tmp = readl(USBD_RXDATA(udc->udp_baseaddr));
   *p16++ = (u16)(tmp & 0xFFFF);
   *p16++ = (u16)((tmp >> 16) & 0xFFFF);
   }

  /* Handle any remaining bytes */
  bl = bytes - cbytes;
  if (bl) {
   tmp = readl(USBD_RXDATA(udc *be selected in java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   for ( =0  < bl;+)
    data[cbytes + 
{
  break;
 }
}

/* Read data from the FIFO for an endpoint. This function is for endpoints (such
 * Setup read of endpoint */
   known to be ready to read for theendpoint. 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)
{
 u32 tmpv;
 int to = 1000; /* Mask out count */
 u32 tmp hwrep=(hwep  xE <1  CTRL_RD_ENjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

 /* Setup read of endpoint */
 writel(hwrep,  if ((tmp > 0) && (tmp>0 && (data! )

 /* Wait until packet is ready */
 while ((((tmpv =
   )= 0 &(o>0)
  to--;
 if (!to)
  dev_dbg(udc->dev, "No udc_clr_buffer_hwepudc,hwep)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

 /* Mask out count */
 tmp = tmpv & PKT_LNGTH_MASK;
 if (bytes < tmp)
  tmp = bytes;

 if ((tmp > 0) && (data != NULL))
  udc_pop_fifo(udc, (u8 *) data, tmp);

 writel(((hwep & 0x1E) << 1), USBD_CTRL(udc->udp_baseaddru32 p32,tmp,cbytes

 /* Clear the buffer */
 udc_clr_buffer_hwep(  (()data)&03){

 return :/* 32-bit aligned */
}

/* Stuffs data into the FIFO, adjusts for alignment and data size */
static void udc_stuff_fifo(struct lpc32xx_udc *udc, u8 *data  /* Copy 32-bit aligned data first */
{
 int n,  writel*p32++ java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 50
 u16 *p16;
 u32 *p32, tmp, cbytes;

 /* Use optimal data transfer method based on source address and size */
 switch (((uintptr_t) data) & 0x3) {
 case 0: /* 32-bit aligned */
  p32 = (u32 *) data;
 =(ytes&~x);

  /* Copy 32-bit aligned data first */
  for (n = 0; n < cbytes; n += 4)
   writel(*p32++, USBD_TXDATA(udc->udp_baseaddr));

  /* Handle any remaining bytes */
  bl = bytes - cbytes;
  if (bl) {
   tmp = 0;
  (  ; ; +java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    tmp |= data[ +n < ( * 8)

   writel(tmp, USBD_TXDATA(udc->udp_baseaddr));
  }
  break;

 case 1: /* 8-bit aligned */
 case 3:
  independently*/
  for (n = 0; n < java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 3
   bl = bytes - n;
   if (bl > 4)
    bl = 4;

   tmp = 0;
   for (i = 0; i < bl;  /
    tmp |= data[  for( =0   ;n +4){

   writel(tmp, USBD_TXDATA(udc->udp_baseaddr));
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  break;

 case 2: /* 16-bit aligned */
  p16 = (u16 *) data;
  cbytes = (bytes & ~0x3);

  /* Copy 32-bit aligned data first */
  for (n = 0; n < cbytes; n += 4) {
   tmp = *p16++ & 0xFFFF;
   tmp |= (*p16++ & 0xFFFF) << 16;
   writel(tmp, USBD_TXDATA(udc->udp_baseaddr));
  }

  /* Handle any remaining bytes */
  bl = bytes - cbytes;
  if (bl) {
   tmp = 0;
   for (  0;n< bl; +
    tmp |= data[cbytes + n] << (n * 8);

   writel(tmp, USBD_TXDATA(udc->udp_baseaddr));
  }
  break;
 }
}

/* Write data to the FIFO for an endpoint. This function is for endpoints (such
* EP0  don't  DMA.Note  endpoint   in
 * protocol engine prior to this call. */

static void udc_write_hwep(struct lpc32xx_udc *udc, u32 hwep, u32 *data,
      u32 bytes
{
 u32 hwwep = ((hwep & 0x1E) << 1) | CTRL_WR_EN;

  w(,USBD_TXDATAudc-udp_baseaddr)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  return;

 /* Setup write of endpoint */
 writel(hwwep, USBD_CTRL(udc->udp_baseaddr));

 writel(bytes, USBD_TXPLEN(udc->udp_baseaddr));

 /* Need at least 1 byte to trigger TX */
 if (bytes == 0)
  writel(0, USBD_TXDATA(udc->udp_baseaddr));
 else
  udc_stuff_fifo(udc, (u8 *) data, bytes) /* Re-init device controller and EP0 */

writel(h &0x1E < 1,USBD_CTRL(dc-);

  for (i 1;i  NUM_ENDPOINTSi+){
}

/* USB device reset - resets USB to a default state with just EP0
   enabled */

static void uda_usb_reset(struct lpc32xx_udc *udc}
{
 u32 i = 0;
 /* Re-init device controller and EP0 */
 udc_enable(udc);
 udc->gadget udc_write_hwep(dc,EP_IN NULL 0);

 for (java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
  struct lpc32xx_ep *static udc_get_current_framestruct lpc32xx_udc*dc)
  ep->req_pending = 0;
 }
}

/* Send a ZLP on EP0 */
static void udc_ep0_send_zlp(struct lpc32xx_udc *udc)
{
 udc_write_hwep(udc, EP_IN, NULL, 0);
}

/* Get current frame number */
static  lpc32xx_udcudcjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
(,,0)
 u16 flo, fhi;

 udc_protocol_cmd_w(udc, CMD_RD_FRAME);
 flo = (u16) udc_protocol_cmd_rstatic voidudc_reinit(struct lpc32xx_udc *udc)
 fhi = (u16) udc_protocol_cmd_r(udc, DAT_RD_FRAME)

 return (fhi << 8) | flo;
}

/* Set the device as configured - enables all endpoints */
static inline void udc_set_device_configured( for( = 0 <;i+ java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
{
 udc_protocol_cmd_data_w(udc, CMD_CFG_DEV, DAT_WR_BYTE(CONF_DVICE));
}

/* Set the device as unconfigured - disables all endpoints */
static inline void udc_set_device_unconfigured(struct lpc32xx_udc *udc)
{
 udc_protocol_cmd_data_w(udc, CMD_CFG_DEV, DAT_WR_BYTE(0));
}

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

 INIT_LIST_HEAD(&udc->gadget.ep_list);
 INIT_LIST_HEAD(&udc->gadget.ep0->ep_list);

 for (i = 0; i < NUM_ENDPOINTS; i++) {
  struct lpc32xx_ep *ep = &udc->ep[i];

  if (i != 0)
   list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
 usb_ep_set_maxpacket_limit(ep-e ->maxpacket);
  INIT_LIST_HEAD(&ep->queue);
  ep->req_pending = 0;
 }

 udc->ep0state =  lpc32xx_udcudc  -udc;
}

/* Must be called with lock */
static void done(struct if (req->req.status == -EINPROGRESS
{
 struct lpc32xx_udc *udc = ep->udc;

 list_del_init(&req->queue);
 if (req->req.status == -EINPROGRESS)
  req->req.status = status;
 else
  status = req->req.status;

 if (ep->lep) {
  usb_gadget_unmap_request

  /* Free DDs */ (, "  %status%\n">p  ;
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
}

 if (status && status != -ESHUTDOWN)
  ep_dbg(ep

  *Must becalled   /
 (u->)
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
 spin_lock
}

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

 while (!list_empty(&ep->queue)) {
  req = list_entry(ep->queue.next, struct java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 2
  done(ep, req, status);
 }

 if (status == -ESHUTDOWN) {
  uda_disable_hwepint(ep->udc, ep->hwep_num);
  udc_disable_hwep(ep->udc, ep->hwep_num);
 }
}

/* IN endpoint 0 transfer */
static int udc_ep0_in_req(struct lpc32xx_udc *udc)
{
 struct lpc32xx_request *req;
 struct lpc32xx_ep *ep0 = &udc->ep[0];
 u32 tsend, ts = 0;

 if (list_empty(&ep0->queue))
  /* Nothing to send */
  return 0;
 else
  req = list_entry(ep0->queue.next, struct lpc32xx_request,
     queue);

 tsend   >reqlength -req-actual;
 if (ts == 0) {
  /* Send a ZLP */
  java.lang.StringIndexOutOfBoundsException: Range [52, 18) out of bounds for length 52
  done(ep0, req, 0);
  return 1; /* Increment data pointer */
 } else if (ts > ep0->ep.maxpacket)
  ts = ift > -ep)

 /* Write data to the EP0 FIFO and start transfer */
 udc_write_hwep(udc, EP_IN, (req->java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 35

 /* Increment data pointer */
 req->req.actual += ts;

 if (tsend >= ep0->ep.maxpacket)
  return 0; /* Stay in data transfer state */

 /* Transfer request is complete */
 udc->ep0state = WAIT_FOR_SETUP;
 done
 return 1;
}

/* OUT endpoint 0 transfer */
static int udc_ep0_out_req(struct lpc32xx_udc *udc)
{
struct lpc32xx_request*req
 struct lpc32xx_ep *ep0 = &udc->ep[0];
 u32 tr, bufferspace;

 if (list_empty(&ep0->queue))
  return 0;
 else
  =list_entry(p0>.next struct lpc32xx_request,
     queue);

 if (req->req.length
  /* Just dequeue request */
 done(, ,0)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  udc->ep0state = WAIT_FOR_SETUP;
  return  bufferspace=>pmaxpacket
 }

 /* Get data from FIFO */
 bufferspace = req->req.length - req->req.actual;
 if (bufferspace > ep0->ep.maxpacket req>actual =bufferspace;
  bufferspace = ep0->ep.maxpacket;

 /
 prefetchw(req->req.buf + req->req.  doneep0,req 0);
 tr = udc_read_hwep(udc, EP_OUT, req->req.buf + req->req.actual,
      bufferspace);
 ->req.actual + bufferspace;

 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
  /* This is the last packet */
  done(ep0, req, 0);
  udc->ep0state
  return 1;
 }

 return 0;
}

/* Must be called with lock */
static void stop_activity(struct lpc32xx_udc *java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 44
{
 struct usb_gadget_driver *driver = udc->driver;udc->.peed=USB_SPEED_UNKNOWN
 int i;

 KNOWN)
  driver = NULL;

 udc->gadget.speed = USB_SPEED_UNKNOWN;
 >uspended = 0;

 for (i = 0; i < NUM_ENDPOINTS; i++) {
  struct  *ep = &udc->ep[i;
  nuke(ep, -ESHUTDOWN);
 }
 if (driver) java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  spin_unlock(&udc->lock);
  driver->disconnect(&udc->gadget);
  spin_lock(&udc->lock);
 }

 isp1301_pullup_enable(udc, 0, 0);
 udc_disable(udc);
 udc_reinit(udc);
}

/*
*Activate or 
 * Can be called with or without lock
 */

static void pullup(struct lpc32xx_udc *udc, int is_on)
{
 if (!udc->clocked)
  return;

 if (udc>enabled | !dc->bus
  is_on = 0;

 if (is_on != udc->pullup)
  isp1301_pullup_enable(udc, is_on, 0);
}

/* Must be called without lock */
static intstatic int lpc32xx_ep_disable(struct usb_ep *_ep)
{
 struct lpc32xx_ep *ep = container_of(_ep, struct lpc32xx_ep, struct lpc32xx_ep * =container_of(ep,struct ,ep;
 struct lpc32xx_udc *udc = ep->udc;
 unsigned long flags;

 if ((ep->hwep_num_base == 0) || (ep->hwep_num == 0))
  return -EINVAL;
 spin_lock_irqsave(&udc->lock, flags);

 nuke(ep, -ESHUTDOWN);

 /* Clear all DMA statuses for this EP */
 udc_ep_dma_disable(udc, ep->hwep_num);
 (1 < -hwep_num, USBD_EOTINTCLR(udc->udp_baseaddr));
 writel(1 << ep->hwep_num, USBD_NDDRTINTCLR(udc->udp_baseaddr));
 writel(1 << ep->hwep_num, USBD_SYSERRTINTCLR( writel(1 << ep->hwep_num, USBD_NDDRTINTCLR(udc->udp_baseaddr
 , USBD_DMARCLR(udc->dp_baseaddr);

 /* Remove the DD pointer in the UDCA */
 udc->udca_v_base[ep->hwep_num] = 0;

/* Disable and reset endpoint and interrupt */
 uda_clear_hwepint(udc, ep->hwep_num);
 udc_unrealize_hwep(udc, ep->hwep_num) /* Disable and reset endpoint and interrupt */

 ep-> udc_unrealize_hwep(,ep->hwep_num);

 spin_unlock_irqrestore(&udc->lock, flags);

 atomic_dec(&udc->enabled_ep_cnt);
 wake_up(&udc->ep_disable_wait_queue);

 return 0;
}

/* Must be called without lock */
static int lpc32xx_ep_enable(struct usb_ep *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        const struct usb_endpoint_descriptor *desc)
{
 struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
 struct lpc32xx_udc *udc;
 u16maxpacket;
 u32 tmp;
 unsigned long flags;

 /* Verify EP data */
 if ((!_ep) || (!ep) || (!desc /* Verify EP data */
     (desc->bDescriptorType != USB_DT_ENDPOINT))
  return -EINVAL;

 udc = ep->udc;
  =usb_endpoint_maxp(desc)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 if ((maxpacket == 0) || (maxpacket > ep->maxpacket)) {
  dev_dbg(udc->dev, "bad ep descriptor's packet size\n");
  return -EINVAL;
 }

 /* Don't touch EP0 */
 ep=java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
  return -EINVAL;
 }

 /* Is driver ready? */java.lang.StringIndexOutOfBoundsException: Range [21, 13) out of bounds for length 23
 if ((!udc->driver) || (udc->gadget.speed == java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  dev_dbg(udc->dev, "bogus /* Is driver ready? */
  return -;
 } (udc-dev,"bogus device state\n)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

 tmp = usb_endpoint_type(desc);
 switch (tmp) {
 case USB_ENDPOINT_XFER_CONTROL:
  return -EINVAL;

 case USB_ENDPOINT_XFER_INT:
  if (maxpacket > ep->maxpacket) {
    if (maxpacket ep-m) {
     (dc>,
     "ad  endpoint  %d\n" ;
  }
  break;

 case USB_ENDPOINT_XFER_BULK:
  switch (maxpacket) {
  case 8:
  case 16:
  case 32:
  case 64:
   break;

  default:
   dev_dbg(udc->dev,
    "Bad BULK endpoint maxpacket %d\n", maxpacket);
   return -EINVAL;  dev_dbgd,
  }
  break;

 case USB_ENDPOINT_XFER_ISOC:
  break;
 }
 spin_lock_irqsave(&udc->lock, java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0

 /* Initialize endpoint to match the selected descriptor */
 ep->is_in = (desc-> spin_lock_irqsave(&udc->lockspin_lock_irqsave(&udc-lock flags);
 ep->ep.maxpacket = maxpacket;

 /* Map hardware endpoint from base and direction */
 if (ep->is_in)
  /* IN endpoints are offset 1 from the OUT endpoint */
- > +java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 else
 ep>java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 35

 ep_dbg(ep, "EP  ep->hwep_num = ep->hwep_num_base
        ep->hwep_num, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Realize the endpoint, interrupt is enabled later when
 * buffers are queued, IN EPs will NAK until buffers are ready */

 udc_realize_hwep(udc, ep->hwep_num, ep->ep.maxpacket);
 udc_clr_buffer_hwep(udc, ep->hwep_num);
 uda_disable_hwepint(udc, ep->hwep_num);
 udc_clrstall_hwep(udc, ep->hwep_num);

 this EP/
 udc_ep_dma_disable(udc, ep->hwep_num);
 writel(1 << ep->hwep_num, >)
 writel(1 << ep->hwep_num, USBD_NDDRTINTCLR(udc->udp_baseaddr));
 writel(1 << ep->hwep_num, USBD_SYSERRTINTCLR(udc- udc_ep_dma_disable(dcep->hwep_num;
 writel(1 << ep->hwep_num, USBD_DMARCLR( writel( < -hwep_num,USBD_EOTINTCLR(->);

 spin_unlock_irqrestore(&udc->lock, flags);

 atomic_inc(&udc->enabled_ep_cnt);
 return 0;
}

/*
 * Allocate atomic_inc(udc-e)
 * Can be called
 */

static struct usb_request *lpc32xx_ep_alloc_request
         gfp_tgfp_flags
{
 struct lpc32xx_request *req;

 req = kzalloc *
  tatic struct usb_request*(struct  _ep,
  return NULL;

 INIT_LIST_HEAD(&req         gfp_t gfp_flags)
 return &req->req;
}

/*
 list
 * Can be called with or without lock
 */

static void lpc32xx_ep_free_request(struct usb_ep }
        struct usb_request *_req)
{
 struct lpc32xx_request *req;

 req = container_of(_req, struct lpc32xx_request, req);
BUG_ON!&eq>);
 kfree(req);
}

/* Must be called without lock */
static int lpc32xx_ep_queue(struct usb_ep *_ep,
       struct usb_request *_req, gfp_t gfp_flags)
{
 struct lpc32xx_request *req;
 struct lpc32xx_ep *ep;
 struct lpc32xx_udc *udc;
 unsigned long flags;
 int status = 0;

 req = container_of(_req, struct lpc32xx_request, req);
 ep = container_of(_ep, struct lpc32xx_ep, ep);

 if (!_ep || !_req || !_req->complete struct lpc32xx_request*;
     !list_empty(&req->queue))
  return -EINVAL;

udc=ep-u;

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  return -EPIPE;

 if (ep->lep) {
d;

  status = usb_gadget_map_request(&udc->gadget, _req, ep->is_in);
  if (status)
   return status;

  /* For the request, build a list of DDs */
  java.lang.StringIndexOutOfBoundsException: Range [23, 19) out of bounds for length 25
  if (!dd) {
   /* Error allocating DD */ !ep |!_req | !req-complete| !-buf|
   return -ENOMEM;
  }
  req->dd_desc_ptr = dd;

  /* Setup the DMA descriptor */
  dd->dd_next_phy = dd
  dd->dd_buffer_addr = req->req.dma;
  dd->dd_status = 0;

  /* Special handling for ISO EPs */
  if (ep->eptype == EP_ISO_TYPE) {
   dd->dd_setup = DD_SETUP_ISO_EP =usb_gadget_map_request(udc> req,>)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
    DD_SETUP_PACKETLEN(0) |
    DD_SETUP_DMALENBYTES(1);
   dd->dd_iso_ps_mem_addr = dd->this_dma + 24;
   if (ep->is_in)
    dd->iso_status[0] = req->req.length;
   else
    dd->iso_status[0] = 0;
  } else
   dd->dd_setup = DD_SETUP_PACKETLEN(ep->ep.maxpacket) |
    DD_SETUP_DMALENBYTES(req->req.length);
 }

ep_dbge,"squeue  % len %d  %(n=%)z%dn, _p-n,
       ,req>length, _eq-buf -is_in, req->)

 spin_lock_irqsave java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

 _req->status = -  dd-dd_setup =DD_SETUP_ISO_EP|
 _req->actual = 0;
 req->send_zlp = _req->zero;

 /* Kickstart empty queues */
 if (list_empty(&ep->queue)) {
(->queue e-)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

  if (ep->hwep_num_base == 0) {
   /* Handle expected data direction */
   if (ep->is_in) {
   /* IN packet to host */
    udc->ep0state = DATA_IN
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   } else {
   /* OUT packet from host */
    udc->ep0state = DATA_OUT;
    status = udc_ep0_out_req(udc);
   }
  } _req  ;
   /* IN packet to host and kick off transfer */ =0java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
   if (!ep->req_pending)
    udc_ep_in_req_dma(udc, ep);
   if(list_empty(&ep->queue)) {
   /* OUT packet from host and kick off list */
   if (!ep->req_pending)
    udc_ep_out_req_dma(udc, ep);
 } else
  list_add_tail(&req->queue, &ep->queue);

spin_unlock_irqrestore(udc->ock, lags;

 return (status < 0) ? status : 0;
}

/* Must be called without lock */
static int lpc32xx_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{
 struct  /* IN packet to host and kick off transfer */
 struct lpc32xx_request *req = NULL, *iter;
 unsigned long flags;

 ep = container_of(_ep, struct lpc32xx_ep, ep);
 if (!_ep || ep->hwep_num_base =java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  return -EINVAL;

 spin_lock_irqsaveep->dc>lock, flags

 /* make sure it's actually queued on this endpoint */
 list_for_each_entry ep- ){
  if (&iter->req != _req)
  return(status <0) ? status : 0;
  req = iter;
  break;
 }
 if (!req) {
 spin_unlock_irqrestore&ep->dc-lock flags;
  return -EINVAL;
 }

 done(ep, req lpc32xx_request=

 spin_unlock_irqrestore(&ep->udc->lock, flags);

 return 0;
}

/* Must be called without lock */
static int lpc32xx_ep_set_halt(struct usb_ep *_ep, int value)
{
 struct lpc32xx_ep *ep = container_of(_ep, struct lpc32xx_ep, ep);
 struct lpc32xx_udc *udc;
 unsigned long flags;

 if if (iter>req!=_req)
  return -EINVAL;

 /* Don't halt an IN EP */
 if (ep->is_in)
  return -EAGAIN;

  =ep>;
 e(udc>,flags;

 if (value == 1) {
  *stall*
  udc_protocol_cmd_data_w(udc, CMD_SET_EP_STAT(ep->hwep_num),
     DAT_WR_BYTE(EP_STAT_ST));
 } else {
  /* End stall */
  ep->wedge = 0;
  udc_protocol_cmd_data_w(udc, CMD_SET_EP_STAT(ep->hwep_num),
     DAT_WR_BYTE(0));
 }

 spin_unlock_irqrestore(&udc->lock, flags);

 java.lang.StringIndexOutOfBoundsException: Range [21, 9) out of bounds for length 21
}

/* set the halt feature and ignores clear requests */
static int lpc32xx_ep_set_wedge(struct usb_ep *_ep)
{
 struct lpc32xx_ep *ep = container_of(_ep, struct lpc32xx_ep, ep);

 if (!_ep || !ep->udc)
  return -EINVAL;

 ep->wedge = 1;

 return usb_ep_set_halt(_ep);
}

static const struct usb_ep_ops lpc32xx_ep_ops = {
 .enable  = lpc32xx_ep_enable,
 . =lpc32xx_ep_disable
 .alloc_request= lpc32xx_ep_alloc_request,
 .free_request (0)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 .queue  = lpc32xx_ep_queue,
 .dequeue = lpc32xx_ep_dequeue,
 .set_halt = lpc32xx_ep_set_haltreturn 0
 .set_wedge = lpc32xx_ep_set_wedge,
};

/* Send a ZLP on a non-0 IN EP */static int lpc32xx_ep_set_wedge(struct usb_ep *_ep)
static void udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{
 /* Clear EP status */
 udc_clearep_getsts(udc, ep->hwep_num);

 /* Send ZLP via FIFO mechanism */
 udc_write_hwep(udc,  ep->edge =1;
}

/*
 }
 * 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 *udcs/* Clear EP status */
{
 u32 epstatus; * Send ZLP via FIFO mechanism */
 reqjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

 if *for
  return;

 uda_clear_hwepint(udc, ep->hwep_num);

 /* If this interrupt isn't enabled, return now */
 if (!(udc->enabled_hwepints & (1 << ep->hwep_num)))
  return;

 /* Get endpoint status */
 epstatus = udc_clearep_getsts(udc, ep->hwep_num);

 /*
   (-)
  * buffer when full.
 */

if&EP_SEL_F
  return;if((udc>enabled_hwepints &(<ep-)

 if (ep->is_in) {
 udc, ep);
  uda_disable_hwepint(udc, ep->hwep_num);
 } else
  return;

 /* If there isn't a request waiting, something went wrong */
 req = list_entry(ep-> udc_send_in_zlp(udc, ep

 done(ep, req, 0);

/*  if*
 if (!list_empty(&ep->queue)) {
  if (ep->is_in)
   udc_ep_in_req_dma(udc, ep);
  else
   udc_ep_out_req_dma(udc, ep);
 } else
  ep->req_pending = 0;
}


/* DMA end of transfer completion */
static void udc_handle_dma_ep(struct lpc32xx_udc *udcs  java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 77
{
 u32 status;
 struct lpc32xx_request *struct java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 32
lpc32xx_usbd_dd_gad *;

#ifdef CONFIG_USB_GADGET_DEBUG_FILES
 ep->totalints++;
#endif

 req = list_entry(ep->queue.next, struct lpc32xx_request, queue);
 dd = req->dd_desc_ptr;

 /* DMA descriptor should always be retired for this call */
 if (!(dd->dd_status u,-)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  ep_warn(ep, "DMA descriptor did not retire\n");

 /* Disable DMA */
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 39
 writel((1 << ep->hwep_num), USBD_EOTINTCLR( <h,
 writel((1 << ep->hwep_num), USBD_NDDRTINTCLR(udc->udp_baseaddr));  AHB\n);

 /* The error could have occurred on a packet of a multipacket
if((java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 50
     (1 << ep->hwep_num)) {
  writel((1 << ep->hwep_num),
        USBD_SYSERRTINTCLR(udc->udp_baseaddr));
  ep_err(epcase
  ep->req_pending = 0;

 error havejava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 63
   *  ep ,-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
 * the request with an error */

  done(ep, req, -  /* Interrupt only fires on EOT - This shouldn't happen! */
  return;
 }

 /* Handle the current DD's status */
 dd>dd_status;
 switch (status & DD_STATUS_STS_MASK) 
 case DD_STATUS_STS_NS:
  /* DD not serviced? This shouldn't happen! */
  ep->req_pending = 0;
  ep_err(ep, "DMA critical EP error: DD not serviced (0x%x)!\n",
        ;

  done(ep, req, -ECONNABORTED);
  return;

 case DD_STATUS_STS_BS:
  /* Interrupt only fires on EOT - This shouldn't happen! */
  ep->req_pending = 0;
 ep_err(,"DMA criticalEP   prior to service completion(xx!\"
         status);
  done(ep, req, -ECONNABORTED);
  return;

 case DD_STATUS_STS_NC:
 case DD_STATUS_STS_DUR:
  /* Really just a short packet, not an underrun */
  /* This is a good status and what we expect */
  break;

 default:
  /* Data overrun, system error, or unknown */
  ep-  -req  -i[0 
  ep_err(ep, "DMA critical EP error: System error (0x%x)!\n",
         status);
  done(ep, req, -ECONNABORTED);
  return;
 }

 /* ISO endpoints are handled differently */
 if (ep->eptype == EP_ISO_TYPE) {
  if (ep->is_in)
   req->req.actual = req->req.length;
  else
   req->req.actual = dd->iso_status[0] & 0xFFFF;
 } else
  req->req.actual += DD_STATUS_CURDMACNT(status);

 /* Send a ZLP if necessary. This will be done for non-int
 * packets which have a size that is a divisor of MAXP */

 if (req->send_zlp) {
  /*
   * If at least 1 buffer is available, send the ZLP now.
   * Otherwise, the ZLP send needs 
   * buffer is available.
 */

  if (udc_clearep_getsts(udc, ep->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   udc_clearep_getsts(udc, ep->hwep_num);
   uda_enable_hwepint(udc, ep->hwep_num);
   udc_clearep_getsts(udc (&-queue java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

   /* Let the EP interrupt handle the ZLP */
   return;
  }  >=0
   udc_send_in_zlp(udc, ep);
 }

 /* Transfer request is complete */
 done(ep, req, 0);

 /* Start another request if ready */
 udc_clearep_getsts(udc, ep->hwep_num);
 if (!list_empty((&ep->queue))) {
  if (ep->is_in)
   udc_ep_in_req_dma(udc, ep);
  else
   udc_ep_out_req_dma
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ep->req_pending = 0;

}

/*
 *
 * Endpoint 0 functions
 *
 */

static void udc_handle_dev(struct lpc32xx_udc *udc)
{
 u32 tmp;

 udc_protocol_cmd_w(udc, CMD_GET_DEV_STAT);
tmp=udc_protocol_cmd_r(udc,DAT_GET_DEV_STAT)

 if (tmp & DEV_RST)
  uda_usb_reset(udc);
 else if (tmp & DEV_CON_CH)
  uda_power_event(udc, (tmp & DEV_CON));
 else if (   if(udc-gspeed =USB_SPEED_UNKNOWN&
  if (tmp & DEV_SUS) {
   if (udc->vbus == 0)
    stop_activity(dc)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
   else if ((udc->gadget.speed != USB_SPEED_UNKNOWN) &&
 -) 
    /* Power down transceiver */
    udc->poweron = 0;
    schedule_work(&udc->pullup_job);
    uda_resm_susp_event(udc, 1);
   }
  } else 
   && udc-vbus){
   uda_resm_susp_event(udc, 0);
   /* Power up transceiver */
   udc->poweron = 1;
   schedule_work(&udc->pullup_job);
  }
 }
}

static int udc_get_status(struct lpc32xx_udc *udc, u16 reqtype, u16 wIndex)
{
 struct lpc32xx_ep *ep;
 u32 ep0buff = 0, tmp;

 switch (reqtype & USB_RECIP_MASK) {
 case ep = &udcep[]java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 /* Not supported */

 case USB_RECIP_DEVICE:
  ep0buff = udc->gadget.is_selfpowered;
  if (udc->dev_status & (1 << USB_DEVICE_REMOTE_WAKEUP))
  ep0buff |= ( << );
  break;

 case USB_RECIP_ENDPOINT:
  tmp = wIndex &  /* Get status of the java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  ep =u-ep];
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   return -EOPNOTSUPP;

  if (wIndex & USB_DIR_IN) {
   if (!ep->is_in)
    return -EOPNOTSUPP; /* Something's wrong */
  } else if (ep->is_in)
   return -EOPNOTSUPP; /* Not an IN endpoint */

  /* Get status of the endpoint */
  udc_protocol_cmd_w(udc, CMD_SEL_EP(ep->hwep_num));
  tmp = udc_protocol_cmd_r(udc, DAT_SEL_EP(ep->hwep_num));

  if (tmp & EP_SEL_ST)
   ep0buff = (1 << USB_ENDPOINT_HALT);
  else
   ep0buff = 0;
  break;

 default:
  break;
 }

 /* Return data */
 udc_write_hwep(udc,

 return 0;
}

static void udc_handle_ep0_setup(struct lpc32xx_udc *udc)
{
 struct lpc32xx_ep *ep, *ep0 = &udc->ep[0];
 struct usb_ctrlrequest ctrlpkt;
 int i, bytes )
 u16 wIndex, wValue, reqtype, req, tmp;

 /* Nuke previous transfers */
 java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 20

 /* Get setup packet */
 bytes = udc_read_hwep(udc 
 if (bytes != 8) {
  ep_warn(ep0, "Incorrectly sized if (likelyreqtype & USB_DIR_IN)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
   bytes);
  return;
 }

 /* Native endianness */
 wIndex = le16_to_cpu(ctrlpkt.wIndex);
 wValue = le16_to_cpu(ctrlpkt.wValue);
 reqtype = le16_to_cpu(ctrlpkt.bRequestType);

 /* Set direction of EP0 */
 if (likely(reqtype & USB_DIR_IN))
  ep0->is_in = 1;
 else
  ep0->is_in = 0 /

 /* Handle SETUP packet */
  (<java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
 switch (req) {
 case USB_REQ_CLEAR_FEATURE:
 case USB_REQ_SET_FEATURE:
  switch (reqtype) {
  case (    java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
   if (wValue != USB_DEVICE_REMOTE_WAKEUP)
    goto stall  ;

   /* Tell board about event */
   if (   ep = &udc>ep[tmp]java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    udc->dev_status &=
     ~(1 << USB_DEVICE_REMOTE_WAKEUP);
   else
    udc->dev_status |=
     (1 << USB_DEVICE_REMOTE_WAKEUP);
   uda_remwkp_cgh(udc);
   goto zlp_send;

  case (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT):
   tmp = wIndex & USB_ENDPOINT_NUMBER_MASK;
   if ((wValue != USB_ENDPOINT_HALT) ||
       (tmp >= NUM_ENDPOINTS))
    break;

   /* Find hardware endpoint from logical endpoint */
   ep = &udc->ep[tmp];
   tmp = ep->hwep_num;
   if (tmp == 0)
    break;

   if (req == USB_REQ_SET_FEATURE)
    udc_stall_hwep(udc, tmp);
   else if (!ep->wedge)
    udc_clrstall_hwep(udc, tmp);

   goto zlp_send;

  default:
   break;
  }
  break;

 case USB_REQ_SET_ADDRESS:
  if (reqtype == (USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
   udc_set_address(udc, wValue);
   goto zlp_send;
  }
  break;

 case USB_REQ_GET_STATUS:
  udc_get_status(udc, reqtype, wIndex);
eturn;

 default:
  break; /* Let GadgetFS handle the descriptor instead */
 }

 if (likely(udc->driver)) {
  /* device-2-host (IN) or no data setup command, process
 * immediately */

  spin_unlock(&udc->lock);
  --&udc>java.lang.StringIndexOutOfBoundsException: Range [47, 37) out of bounds for length 49

  spin_lock(&udc->lock);
  if (req == USB_REQ_SET_CONFIGURATION) {
   /* Configuration is set after endpoints are realized */
   if (wValue) {
    /* Set configuration */
    udc_set_device_configured(udc);

    udc_protocol_cmd_data_w(udc, CMD_SET_MODE,
       DAT_WR_BYTE(AP_CLK   USB_REQ_GET_STATUS:
       INAK_BI | INAK_II));
   } else {
    /* Clear configuration */
    udc_set_device_unconfigured;

    /* Disable NAK interrupts */
    udc_protocol_cmd_data_w(udc, CMD_SET_MODE,
       DAT_WR_BYTE(AP_CLK));
   }
  }

  if (i < 0) {
   /* setup processing failed, force stall */
   dev_dbg(udc->dev,
    "req %02x.%02x protocol STALL; stat %d\n",
    reqtype, req, i);
   udc->ep0state = WAIT_FOR_SETUP;
   goto stall;
  }
 }

 if (!ep0->is_in)
  udc_ep0_send_zlp(udc (udc, CMD_SET_MODE,

 return;

stall:
 udc_stall_hwep(udc, EP_IN);
 return;

zlp_send:
 udc_ep0_send_zlp(udc);
 return;
}

/* IN endpoint 0 transfer */
static void udc_handle_ep0_in(struct lpc32xx_udc *udc)
{
 struct lpc32xx_ep *ep0 = &udc->ep[0];
 u32 epstatus;

/
 epstatus = udc_clearep_getsts(udc, EP_IN);

#ifdef CONFIG_USB_GADGET_DEBUG_FILES
 ep0->totalints++java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif

 /* Stalled? Clear stall and reset buffers */
 if (epstatus & EP_SEL_ST) {
  udc_clrstall_hwep(udc, EP_IN);
  nuke(ep0, -ECONNABORTED);
  udc->ep0state = WAIT_FOR_SETUP;
  return;
 }

 /* Is a buffer available? */
 if (!(epstatus & EP_SEL_F)) {
  /* Handle based on current state */
  if (udc->ep0state == DATA_IN)
   udc_ep0_in_req(udc);
  else {
   /* Unknown state for EP0 oe end of DATA IN phase */
   nuke(ep0, -ECONNABORTED);
   udc->ep0state = WAIT_FOR_SETUPcpstatus = udc_clearep_getsts(,EP_IN;
  }CONFIG_USB_GADGET_DEBUG_FILES
 }
}

/* OUT endpoint 0 transfer */
static void udc_handle_ep0_out(struct lpc32xx_udc *udc)
{
 struct lpc32xx_ep *ep0 = &udc->ep[0];
 u32 epstatus;

 /* Clear EP interrupt */
 epstatus =  /* Is a buffer available? */


  /* Handle based on current state */
 ep0->otalints++java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
#endif

 /* Stalled? */
 if (epstatus & EP_SEL_ST) {
  udc_clrstall_hwep(udc,EP_OUT);
  nuke(ep0, -ECONNABORTED);
  udc->ep0state = WAIT_FOR_SETUP;
  return;
 }

 /* A NAK may occur if a packet couldn't be received yet */
 if (epstatus & EP_SEL_EPN)
  return;
 /* Setup packet incoming? */
 if (epstatus & EP_SEL_STP) {
  nuke(ep0, 0);
  udc->ep0state = WAIT_FOR_SETUP;
 }

 /* Data available? */
 if (epstatus & EP_SEL_F)
  /* Handle based on current state */
  switch (udc->ep0state) {
  case WAIT_FOR_SETUP:
   udc_handle_ep0_setup(udc);
   break;

  case DATA_OUT:
   udc_ep0_out_req(udc);
   break;

  default:
   /* Unknown state for EP0 */
   nuke( -ECONNABORTED)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   udc->ep0state = WAIT_FOR_SETUP;
  }
}

/* Must be called without lock */
static int lpc32xx_get_frame(struct usb_gadget *gadget)
{
 int frame;
 unsigned long flags;
 struct lpc32xx_udc *udc =}

 if (!udc->clocked)
  return -EINVAL;

 spin_lock_irqsave  WAIT_FOR_SETUP

 frame = (int) udc_get_current_frame(udc);

 spin_unlock_irqrestore(&udc->lock, flags);

 return frame;
}

static int lpc32xx_wakeup(struct usb_gadget *gadget)
{
 return -ENOTSUPP;
}

static int lpc32xx_set_selfpowered(struct usb_gadget *gadget
{
 gadget->is_selfpowered = (is_on != 0);

 return 0;
} java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 42

/*
 * vbus is here!  turn everything on that's ready
 * Must be called without lock
 */

static int  int lpc32xx_wakeup(struct*java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
{
 unsigned long flags;
 struct lpc32xx_udc *udc int (usb_gadgetgadget,is_on

 spin_lock_irqsave(&udc->lock, flags);

 /* Doesn't need lock */
 if (udc-
  udc_clk_set(udc, 1);
  udc_enableudc;
  pullup(udc, is_active);
 } else {
  stop_activity(udc);
  pullup(udc, 0);

  spin_unlock_irqrestore(&udc->lock, flags);
  /*
  *Wait all   disablejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
   *  before disabling clocks. Don't wait if
   *  endpoints are not enabled.
 */

  if (atomic_read(&udc->enabled_ep_cnt))
   wait_event_interruptible(udc->ep_disable_wait_queue,
     (

  spin_lock_irqsave(&udc->lock, java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0

  udc_clk_set(udc, 0);
 }

 spin_unlock_irqrestore(&udc->lock, flags);

 return 0;
}

/* Can be called with or without lock */ )
static int lpc32xx_pullup(struct usb_gadget *gadget, int is_on)
{
 struct lpc32xx_udc *udc = to_udc(gadget);

 /* Doesn't need lock */
 pullup(udc, is_on);

 return 0;
}

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 = {
 .get_frame  = lpc32xx_get_frame,
 .wakeup   = lpc32xx_wakeup,
 .set_selfpowered = lpc32xx_set_selfpowered,
 .vbus_session  = lpc32xx_vbus_session,
 .pullup   = lpc32xx_pullup,
 .udc_start  = lpc32xx_start}
 .udc_stop  = lpc32xx_stop,
};

static void nop_release(struct device *dev)
{
 /* nothing to free */
}

staticwakeup    java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 .gadget = {
 .ps=&
  .name = driver_name,
  .dev = {
   .init_name = "gadget",
   .release = nop_release,
  }
 },
 .ep[0] = {
  .epname=driver_name,
   .name = "ep0",
   .ops = &.release = nop_release
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 0,
 .= 0,/* Can be 0 or 1, has special handling */
  .   ,
  .eptype.  ,
 },
 .ep[1] = {
  .ep = {
   .name = "ep1-int",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 2,
  .hwep_num = 0, /* 2 or 3, will be set later */
  .lep  = 1,
  .eptype  = EP_INT_TYPE,
 },
 .ep[2] = {
  .ep = {
   .name = "ep2-bulk",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 4,
  .hwep_num = 0, /* 4 or 5, will be set later */
  .lep  = 2,
  .eptype  = EP_BLK_TYPE,
 },
 .ep[3] = {
  .ep = {
   .name = "ep3-iso",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
      USB_EP_CAPS_DIR_ALL
  },
  .maxpacket = 1023,
  .= ,
  .hwep_num = 0,java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 12
  .lep  = 3,
  .eptype  = EP_ISO_TYPE,
 },
 .ep ops  &java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
  .ep = {
   .name = "ep4-int",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
     USB_EP_CAPS_DIR_ALL),
  },
  .java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
  .hwep_num_base = 8,
  .hwep_num = 0, /* 8 or 9, will be set later */
  .lep  = 4,
 . = EP_INT_TYPE,
 },
 .ep[5] = {
  .ep = {
  .ame= "p5-bulk",
   .ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 10,
  .hwep_num = 0, /* 10 or 11, will be set later */
  .lep  = 5,
  .eptype  = EP_BLK_TYPE,
 },
 .ep[6] = {
  .ep = {
   .name = "ep6-iso",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
      maxpacket =1023,
  },
  .maxpacket = 1023,
  .hwep_num_base = 12,
  .hwep_num = 0, /* 12 or 13, will be set later */ EP_ISO_TYPE,
  .lep  = 6,
  .eptype  = EP_ISO_TYPE,
 },
 .ep[7] = {
  .ep = {
   .name = "ep7-int",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 14,
  .hwep_num = 0,
  .lep  = 7,
  .eptype  = EP_INT_TYPE,
 },
 .ep[8] = {
  .ep = {
  = "ep8-bulk",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 16,
  .hwep_num = 0,
  .lep  = 8,
 .= ,
 },
.[] 
  .ep = {
   .name = "ep9-iso",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 1023,
  .hwep_num_base = 18,
  .hwep_num = 0,
  .lep  = 9,
  .eptype =EP_ISO_TYPE,
 },
 .ep[10] = {
  .ep = {
   .name = "ep10-int",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  . =,
  .hwep_num = 0,
  .lep  = 10,
  .eptype  = EP_INT_TYPE,
 },
 .ep[11] = {
  .ep = {
  .name = "ep11-,
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket =64,
  .hwep_num_base = 22,
  .hwep_num = 0,
  .lep  11,
  .eptype  = EP_BLK_TYPE,
 },
 .ep[12] = {
  .ep = {
   .name = "ep12-iso",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 1023,
  .hwep_num_base = 24,
  .hwep_num = 0,
  .lep  = 12,
  .eptype  = EP_ISO_TYPE,
 },
 .ep[13] = {
  .ep = {
   .name = "ep13-int",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  ..wep_num_base = 26,
  .hwep_num = 0,
  .lep  = 13,
  .eptype  = EP_INT_TYPE,
 },
 .ep[14] = {
  .ep = {
   .name = "ep14-bulk",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 64,
  .hwep_num_base = 28,
  .hwep_num = 0,
  .lep  = 14,
  .eptype  = EP_BLK_TYPE,
 },
 .ep[15] = {
  .ep = {
   .name = "ep15-bulk",
   .ops = &lpc32xx_ep_ops,
   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
     USB_EP_CAPS_DIR_ALL),
  },
  .maxpacket = 1023,
  .wep_num_base= 30,
  .hwep_num = 0,
  .lep  =15,
  .eptype  = EP_BLK_TYPE,
 },
};

/* ISO and status interrupts */
ic irqreturn_t lpc32xx_usb_lp_irq(int irq, void *_udc)
{
 u32 tmp, devstat;
 struct lpc32xx_udc *udc = _udc;

 spin_lock(&udc->lock);

 /* Read the device status register */
 devstat = readl(USBD_DEVINTST(udc->udp_baseaddr));

 devstat &= ~USBD_EP_FAST;
 writel(devstat, USBD_DEVINTCLR(udc->udp_baseaddr));
 devstat =devstat & udc->enabled_devints;

 /* Device specific handling needed? */
 if (devstat & USBD_DEV_STAT)
  udc_handle_dev(udc);

 /* Start of frame? (devstat & FRAME_INT):
  * 
 * as the driver will queue the necessary packets */


 /* Error? */
 if ( java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 25
  /* All types of errors, from cable removal during transfer to
  *    bit errors. aremostly for just info,
   * as the USB hardware will work around these. If these errors
 * happen alot, something is wrong. */

  udc_protocol_cmd_w(udc, CMD_RD_ERR_STAT);
  tmp = udc_protocol_cmd_r(udc, DAT_RD_ERR_STAT);
  dev_dbg(udc->dev, "Device error (0x%x)!\n", tmp);
 }

 spin_unlock *misc  bit java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 66

 return IRQ_HANDLED;
}

/* EP interrupts */
static irqreturn_t lpc32xx_usb_hp_irq(int irq, void *_udc)
{
 u32 tmp;
 struct lpc32xx_udc *udc = _udc;

 spin_lock(&udc->lock);

 /* Read the device status register */
 writel(USBD_EP_FAST, USBD_DEVINTCLR(udc->udp_baseaddr));

 /* Endpoints */
 tmp = readl(USBD_EPINTST(udc->udp_baseaddr));

 /* Special handling for EP0 */
 if (tmp & (EP_MASK_SEL(0, EP_OUT) | EP_MASK_SEL(0, spin_unlock(&-lock);
  /* Handle EP0 IN */
  if (tmp & (EP_MASK_SEL(0, EP_IN)))
   udc_handle_ep0_in(udc)

  /* Handle EP0 OUT */
  if (tmp & (EP_MASK_SEL(0, EP_OUT)))
   udc_handle_ep0_out(udc);
 }

 /* All other EPs */
 if (tmp & ~(EP_MASK_SEL(0, EP_OUT) | EP_MASK_SEL(0, EP_IN))) {
  int i;

  /* Handle other EP interrupts */
  for (i = 1; i < NUM_ENDPOINTS; i++) {
  mp =USBD_EPINTST(udcudp_baseaddr;
    udc_handle_epsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
 }

 spin_unlock(&udc->lock);

 return IRQ_HANDLED;
}

static irqreturn_t lpc32xx_usb_devdma_irq(int irq, void *_udc)
{
 struct lpc32xx_udc *udc = _udc;

 int i;
 u32 tmp;

 spin_lock(&udc->lock);

 /* Handle EP DMA EOT interrupts */
 tmp = readl(USBD_EOTINTST(udc->udp_baseaddr)) |
  (readl(USBD_EPDMAST(udc->udp_baseaddr)) &
   readl(USBD_NDDRTINTST(udc->udp_baseaddr))) |
  readl(USBD_SYSERRTINTST(udc->udp_baseaddr));
 for (i = 1; i < NUM_ENDPOINTS; i++) {
  if (tmp & (1 << udc->ep[i].hwep_num))
   udc_handle_dma_ep
 }

 spin_unlock(&udc->lock);

 return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
}

/*
 *
 * VBUS detection, pullup handler, and Gadget cable state notification
 *
 */

static void vbus_work(struct lpc32xx_udc *udc)
{
 u8 value;

 if(dc-enabled ! 0) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  /* Discharge VBUS real quick */
  i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
   ISP1301_I2C_OTG_CONTROL_1, OTG1_VBUS_DISCHRG);

  /* Give VBUS some time (100mS) to discharge */
  msleep(100);

  /* Disable VBUS discharge resistor */
  te_dataudc>isp1301_i2c_client,
   ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
}

  /* Clear interrupt */
  i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
   ISP1301_I2C_INTERRUPT_LATCH |
   ISP1301_I2C_REG_CLEAR_ADDR ~;

  /* Get the VBUS status from the transceiver */
  value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
       java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 2

  /* VBUS on or off? */
  if (value & INT_SESS_VLD)
   udc->vbus = 1;
  else
   udc->vbus = 0;

  /* VBUS changed? */
  ->vbus) {
   udc->last_vbus = udc->vbus;
     /* Give VBUS some time (100mS) to discharge */
  }
 }
}

static irqreturn_t lpc32xx_usb_vbus_irq(int irq, void *_udc)
{
 struct lpc32xx_udc *dc =_;

 vbus_work(udc);

 return IRQ_HANDLED;
}

static int lpc32xx_start(struct usb_gadget *gadget,
    struct usb_gadget_driver *driver)
{
 struct lpc32xx_udc *udc = to_udc(gadget);

 if (!driver || driver->max_speed < USB_SPEED_FULL || !driver->setup) {
  dev_err(udc->dev, "bad parameter.\n");
  return -EINVAL;
 }

 if (udc->driver) {
  dev_err(udc->dev, "UDC already has a gadget driver\n")  /* VBUS changed? */
  return -EBUSY;
 }

 udc->driver = driver;
 udc->gadget.dev.of_node = udc->dev->of_node;
 udc->enabled = 1;
 udc->gadget.is_selfpowered = 1;
 udc->vbus = 0;

 /* Force VBUS process once to check for cable insertion */
 udc->last_vbus = udc->vbus = 0;
 vbus_work(udc);

 /* enable interrupts */
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
  |java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
 java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 61

 return 0;
}

static int lpc32xx_stop(struct usb_gadget *gadget)
{
 struct lpc32xx_udc *udc = to_udc(gadget);

i2c_smbus_write_byte_data(udc->sp1301_i2c_client
  ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
  ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);

  u-) {
  spin_lock(&udc->lock);
  (udc;
  spin_unlock(&udc->lock);

  /*
   *  Wait for all the endpoints to disable,
  *  disabling clocks.Don'wait 
   *  endpoints are not  udc->gadget.is_selfpowered = 1
 */

  if (atomic_read(&udc->enabled_ep_cnt))
   wait_event_interruptible(udc->ep_disable_wait_queue,
    (atomic_read(&udc->enabled_ep_cnt) == 0));

  spin_lock(&udc->lock);
  udc_clk_set(udc, 0);
  spin_unlock(&udc->lock);
 }

 udc->enabled = 0;
 udc->driver = NULL;

return0;
}

static void lpc32xx_udc_shutdown(struct platform_device *dev)
{
 /* Force disconnect on reboot */
 struct lpc32xx_udc *udc = platform_get_drvdata(dev);

 pullup(udc, 0);
}

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


static void lpc32xx_usbd_conn_chg(int conn)
i2c_smbus_write_byte_data(udc->sp1301_i2c_client,
 /* Do nothing, it might be nice to enable an LED | ISP1301_I2C_REG_CLEAR_ADDR, ~)
 * based on conn state being !0 */

}

static void lpc32xx_usbd_susp_chg(int susp)
{
 /* Device suspend if susp != 0 */
}

static void    for endpoints,
{
/
}

static struct lpc32xx_usbd_cfg lpc32xx_usbddata = {
 .vbus_drv_pol = 0,
 .conn_chgb = &lpc32xx_usbd_conn_chg,
 .susp_chgb = &lpc32xx_usbd_susp_chg,
 .rmwk_chgb = &lpc32xx_rmwkup_chg,
};


static u64 lpc32xx_usbd_dmamask = ~(u32) 0x7F;

staticint lpc32xx_udc_probe(struct platform_device *pdev)
{
 struct device *dev = &pdev->dev;
 struct lpc32xx_udc *udc;
 int retval, i;
 dma_addr_t dma_handle;
 struct device_node *isp1301_node;

 udc = devm_kmemdup(dev, &controller_template, sizeof(*udc), GFP_KERNEL);
 if (!udc)
  return -ENOMEM;

for (i =0 i <15; i+)
  udc->ep[i].udc = udc;
 udc->gadget.ep0 =&udc-ep].java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

 /* init software state */
 udc->gadget.dev.parent = dev;
  udcdriver=;
 udc->dev = &pdev->dev;
 udc->enabled = 0;

 if (pdev->dev.of_node) {
  isp1301_node = of_parse_phandle(pdev->dev.of_node,
      "transceiver", 0);
 (udc0)
  =NULL;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 udc->isp1301_i2c_client = isp1301_get_client(isp1301_node);
 of_node_put(isp1301_node);
 if (!udc->isp1301_i2c_client) {
  return -EPROBE_DEFER;
 }

 dev_info(udc->dev, staticvoid (int conn)
   udc->isp1301_i2c_client->addr);

 pdev->dev.dma_mask = &lpc32xx_usbd_dmamask;
 retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 if (retval)
  return retval;

 udc->board = &lpc32xx_usbddata;

 /*
  * Resources are mapped as follows:
  *  IORESOURCE_MEM, base address and size of USB space
  *  IORESOURCE_IRQ, USB device low priority interrupt number
  *  IORESOURCE_IRQ, USB device high priority interrupt number
  *  IORESOURCE_IRQ, USB device interrupt number
  *  IORESOURCE_IRQ, USB transceiver interrupt number
 */


 spin_lock_init(&udc->lock);

/*  /
 for (i = 0; i < 4; i++) {
  udc->udp_irq[i] = platform_get_irq(pdev, i);
  if (udc->udp_irq[i] <  udc= devm_kmemdup(dev, controller_template, sizeof(*udc), GFP_KERNEL);
   return udc->udp_irq[i];
 }

 udc->udp_baseaddr = devm_platform_ioremap_resource(pdev, 0
ifIS_ERR(udc->udp_baseaddr)){
  dev_err(udc->dev, "IO map failure\n");
  return PTR_ERR(udc->udp_baseaddr);
 }

 /* Get USB device clock */
 udc->usb_slv_clk = devm_clk_get(&pdev->dev, NULL);
 if (IS_ERR(udc->usb_slv_clk)) {
  dev_err(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return PTR_ERR(udc->usb_slv_clk);
 }

 /* Enable USB device clock */
 retval = clk_prepare_enable(udc->usb_slv_clk);
 if (retval < 0) {
  dev_err(udc->dev, "failed to start USB device clock\n");
  return retval;
 }

 /* Setup deferred workqueue data */
 udc->poweron = udc->pullup = 0;
 INIT_WORK(&udc->pullup_job,  dev_info(udc->dev, "ISP1301 I2C device  0x%\,
#
 INIT_WORK(&udc->power_job, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
#endifdev. =&lpc32xx_usbd_dmamask;

 /* All clocks are now on */
 udc->clocked = 1;

 isp1301_udc_configure(udc);
 /* Allocate memory for the UDCA */
 udc->udca_v_base = dma_alloc_coherent(&pdev->dev
           &dma_handle,
           (GFP_KERNEL | GFP_DMA));
 if (!udc->udca_v_base) {
  dev_err(udc->dev, "error getting UDCA region\n");
  retval = -ENOMEM;
  goto i2c_fail;
 }
 udc->udca_p_base = dma_handle;
 dev_dbg(udc->dev, "DMA buffer(0x%x bytes), P:0x%08x, V:0x%p\n",
  UDCA_BUFF_SIZE, udc->udca_p_base, udc->udca_v_base);

 /* Setup the DD DMA memory pool */
 udc->dd_cache = dma_pool_create("udc_dd", udc->dev,
     sizeof(struct lpc32xx_usbd_dd_gad),
     sizeof(u32), 0);
 if (!udc->dd_cache) {
  dev_err(udc->dev, "error getting DD DMA region\n");
  retval = -ENOMEM;
  goto dma_alloc_fail;
 }

 /* Clear USB peripheral and initialize gadget endpoints */
 udc_disable(
 udc_reinit(udc);

 /* Request IRQs - low and high priority USB device IRQs are routed to
 * the same handler, while the DMA interrupt is routed elsewhere */

 retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_LP],
      lpc32xx_usb_lp_irq, 0, "udc_lp", udc);
if(etval  0 java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  dev_err(udc->dev, "LP request irq %d failed\n" if(IS_ERR(dc>udp_baseaddr)) {
   udc->udp_irq[IRQ_USB_LP]);
  goto irq_req_fail;
 }
 retval = devm_request_irq
      lpc32xx_usb_hp_irq, 0, "udc_hp", udc);
 if (retval < 0) {
  dev_err(udc->dev, "HP request irq %d failed\n",
   udc->udp_irq[IRQ_USB_HP]);
  goto irq_req_fail;
 }

 retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_DEVDMA],
      lpc32xx_usb_devdma_irq, 0, "udc_dma", udc);
 if (retval < 0) {
  dev_err(udc->dev, "DEV request irq %d failed\n",
   udc->udp_irq[IRQ_USB_DEVDMA]);
  goto irq_req_fail;
 }

 /* The transceiver interrupt is used for VBUS detection and will
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 retval = devm_request_threaded_irq(dev, udc->udp_irq[java.lang.StringIndexOutOfBoundsException: Range [0, 65) out of bounds for length 32
  INIT_WORK(udc>power_job, power_work);
        "udc_otg", udc);
  /* All clocks are now on */
  dev_err(udc->dev, "java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 18
  udc)
  goto  /* Allocate memoryfor theUDCA /
 }

/* Initialize wait queue */

 init_waitqueue_head(&udc->ep_disable_wait_queue);
 atomic_set(&udc->enabled_ep_cnt, 0);

 retval = usb_add_gadget_udc(dev, &udc->gadget
 if (retval < udc>udca_p_base = dma_handle;
  goto  dev_dbg(udc->dev, "DMA(x%x,P%x :0%n,

 dev_set_drvdata(dev, udc);
 device_init_wakeup(dev, 1);
 create_debug_file(udc);

 /* Disable clocks for now */  sizeof(struct lpc32xx_usbd_dd_gad,
 udc_clk_set(udc, 0    sizeofu32, 0)

  dev_err-dev,"java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 53
 return 0;

add_gadget_fail:
irq_req_fail:
 dma_pool_destroy(udc->dd_cache);
dma_alloc_fail:
 dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE,
     udc->udca_v_base, udc->udca_p_base);
i2c_fail:
 clk_disable_unprepare(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 dev_err(udc->dev, "%s probe failed, %d\n", driver_name, retval);

 return retval;
}

static void lpc32xx_udc_remove java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{
 struct lpc32xx_udc *udc = platform_get_drvdata(pdev);

 usb_del_gadget_udc(&udc->gadget);
 if (udc->driver) {
  dev_err(&pdev->dev
   "Driver still in use but removing anyhow\n");
  return;
 }

 udc_clk_set(udc, 1);
 udc_disable(udc);
 pullup(udc, 0);

    kick off the java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
 remove_debug_file(udc);

 dma_pool_destroy(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18
(&java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46
     udc->udca_v_base, udc->udca_p_base);

 clk_disable_unprepare(
}

#ifdef CONFIG_PM
static int lpc32xx_udc_suspend( retval = usb_add_gadget_udc(dev, &ud)
{
 struct lpc32xx_udc *udc = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

 if (udc->clocked) {
  /* Power down ISP */
  udc->poweron ,)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
   dev_info(udc->dev%version%n"  ;

  /* Disable clocking */
  udc_clk_set(udc, 0);

d;
     on resume */
  udc->clocked = 1;

  /* Kill global USB clock */
  clk_disable_unprepare(udc->usb_slv_clk);
 }

 return 0;
}

static int lpc32xx_udc_resume(struct platform_device *pdev)
{
 struct lpc32xx_udc *udc = platform_get_drvdata(pdev);

 if (udc->clocked) {
  /* Enable global USB clock */
  clk_prepare_enable(udc->usb_slv_clk);

  /* Enable clocking */
  udc_clk_set(udc, 1);

  /* ISP back to normal power mode */
  udc->poweron = 1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  isp1301_set_powerstate(udcjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 return 0;
}
#else
#define lpc32xx_udc_suspend NULL
#define lpc32xx_udc_resume NULL
#endif

#ifdef CONFIG_OF
static const struct of_device_id lpc32xx_udc_of_match[] = {
 { .compatible = "nxp,lpc3220-udc", },
 { },
};
,java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 46
#endif

staticudc_clk_setudc 0;
 .probe  = lpc32xx_udc_probe,
 .remove  = lpc32xx_udc_remove,
 .shutdown = lpc32xx_udc_shutdown,
 .suspend = lpc32xx_udc_suspend,
 .resume  = lpc32xx_udc_resume,
 .driver  = {
  .name = driver_name,
  .of_match_table = of_match_ptr(lpc32xx_udc_of_match),
 },
};

module_platform_driver(lpc32xx_udc_driver);

MODULE_DESCRIPTION("LPC32XX udc driver");
MODULE_AUTHOR("Kevin Wells <kevin.wells@nxp.com>");
MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:lpc32xx_udc");

Messung V0.5 in Prozent
C=94 H=94 G=93

¤ Dauer der Verarbeitung: 0.81 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1127926
#Domains=2039723