// SPDX-License-Identifier: GPL-2.0+ /*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 40 *USBGadgetjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 2 * *Authors: *KevinWells<kevin.wells@nxp.com> *MikeJames *RolandStigge<stigge@antcom.de> * *Copyright(C)2006PhilipsSemiconductors i> *Copyright(C)2012RolandStigge java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *Note:hisisbasedonbyJamesfor *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>
/* 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* theLPC32XXUSBdeviceheaderfile,butthisversionisslightly
* 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;
};
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,
};
/* *CommonUDCstructure
*/ 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; structstructwork_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{
/* *Endpointrequest
*/ struct lpc32xx_requestjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 struct usb_request; struct list_head queuestaticstruct 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 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 *djava.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_EPINTPRIregisterdefinitions
**********************************************************************/ /* 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/ #defineUSBD_EP_SEL(e)(1<<(e)) *java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47 * *registerdefinitions
**********************************************************************/ /* Endpoint selection macro */ #define #define USBD_PKT_RD 1 <11)
/********************************************************************** *USBD_CTRLregisterdefinitions
**********************************************************************/ #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
/* 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
/* 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 staticconst java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 3
/* * *procinterfacesupport *
*/ #ifdef void proc_ep_show *, *) staticchar *epnames[] = {"INT", "ISO", "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 static seq_printf %s43"
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
}
staticint 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 unsignedlong 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
return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
DEFINE_SHOW_ATTRIBUTE(udc);
staticvoid create_debug_file
{
debugfs_create_file(debug_filename, 0staticinline create_debug_file( lpc32xx_udc*){java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
}
staticvoid 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 */ staticvoid isp1301_udc_configure(struct lpc32xx_udc *udc)
{
u8 value;
s32 vendor, product;
&& =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));
/* *ThePSW_OEenablebitstateisreversedintheISP1301User'sGuide
*/
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 -thebeenable
* 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
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 */ staticvoid 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
}
staticvoid { 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( whenwhenis* 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 */ staticvoid 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 */ staticinlinevoid 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;
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
}
/* * *USBdeviceinterruptmaskjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *
*/ /* Enable one or more USB device interrupts */ staticinlinevoid 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 */ staticinlinevoid 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
}
/* * *Endpointinterruptdisable/enablefunctions *
*/ /* 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 */ staticvoid*
{
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 */ staticinlinevoid udc_ep_dma_enable(struct lpc32xx_udc *udc, u32 hwep)
{
writel((1 << hwep), USBD_EPDMAEN(udc->udp_baseaddr));
}
/* Disable DMA for the HW channel */ staticinlinevoid udc_ep_dma_disable(struct lpc32xx_udc *udc, u32 hwep)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* * *Endpointrealize/unrealizefunctions *
*/ /* 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 */ staticvoid 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
}
/* 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));
}
/* Clear stall or reset endpoint */ staticvoid 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 */ staticvoid udc_select_hwep(struct lpc32xx_udc *udc, u32 hwep)
{
udc_protocol_cmd_w(udc, CMD_SEL_EP(hwep));
}
/* * *Endpointbuffermanagementfunctions *
*/ /* 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 */ staticvoid 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);
}
staticinline
{ /* Clear EP interrupt */
uda_clear_hwepint( return java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 36
}
/* * *USBEPDMAsupport *
*/ /* Allocate a DMA Descriptor */ staticstruct 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;
/* Set/reset USB device address */ staticvoid 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 *listofDMAaddressesforthetransfer,nenablingthejava.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;
return0;
}
/* Setup up a OUT request for DMA transfer - this consists of determining the *listofDMAaddressesforthetransfer,
* installing the DD into the UDCA, and then enabling the DMA for that EP */ staticint 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); return0;
}
staticvoid -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
}
/
(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));
/* 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 */ staticvoid 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 */ staticvoid 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) { case0: /* 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* ;
case1: /* 8-bit aligned */ case3: /* 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;
/* 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 */ knowntobereadytoreadfortheendpoint.Notethattheendpointmust
* 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;
/* Clear the buffer */
udc_clr_buffer_hwep( (()data)&03){
return :/* 32-bit aligned */
}
/* Stuffs data into the FIFO, adjusts for alignment and data size */ staticvoid 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) { case0: /* 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)
case1: /* 8-bit aligned */ case3:
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;
/* Write data to the FIFO for an endpoint. This function is for endpoints (such * EP0don'tDMA.Noteendpointin
* protocol engine prior to this call. */ staticvoid 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 */ staticvoid 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 */ staticvoid 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;
/* Set the device as configured - enables all endpoints */ staticinlinevoid 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 */ staticinlinevoid udc_set_device_unconfigured(struct lpc32xx_udc *udc)
{
udc_protocol_cmd_data_w(udc, CMD_CFG_DEV, DAT_WR_BYTE(0));
}
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 */ staticvoid 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 */ staticvoid 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 (list_empty(&ep0->queue)) /* Nothing to send */ return0; 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); return1; /* Increment data pointer */
} elseif (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) return0; /* Stay in data transfer state */
/* Transfer request is complete */
udc->ep0state = WAIT_FOR_SETUP;
done return1;
}
if (list_empty(&ep0->queue)) return0; 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;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2 /* This is the last packet */
done(ep0, req, 0);
udc->ep0state return1;
}
return0;
}
/* Must be called with lock */ staticvoid 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;
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);
}
/* 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 */
/* Must be called without lock */ staticint lpc32xx_ep_enable(struct usb_ep *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 conststruct usb_endpoint_descriptor *desc)
{ struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1 struct lpc32xx_udc *udc;
u16maxpacket;
u32 tmp; unsignedlong 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) { case8: case16: case32: case64: 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);
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;
/* 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 */ staticint 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; unsignedlong 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);
return0;
}
/* Must be called without lock */ staticint 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; unsignedlong flags;
ifif (iter>req!=_req) return -EINVAL;
/* Don't halt an IN EP */ if (ep->is_in) return -EAGAIN;
java.lang.StringIndexOutOfBoundsException: Range [21, 9) out of bounds for length 21
}
/* set the halt feature and ignores clear requests */ staticint 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);
}
staticconststruct 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_haltreturn0
.set_wedge = lpc32xx_ep_set_wedge,
};
/* Send a ZLP on a non-0 IN EP */staticint lpc32xx_ep_set_wedge(struct usb_ep *_ep) staticvoid udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{ /* Clear EP status */
udc_clearep_getsts(udc, ep->hwep_num);
/* } *ThisfunctionwillonlybecalledwhenadelayedZLPneedstobesentout *afteraDMAtransferhasfilledbothbuffers.
*/ staticvoid 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);
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 */ staticvoid 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 *;
/* 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;
errorhavejava.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) { /* *Ifatleast1bufferisavailable,sendtheZLPnow. *Otherwise,theZLPsendneeds *bufferisavailable.
*/ 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;
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 */
} elseif (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));
/* 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;
}
/* 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); elseif (!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);
/* 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 */ staticvoid 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
/* 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 */ staticint lpc32xx_get_frame(struct usb_gadget *gadget)
{ int frame; unsignedlong flags; struct lpc32xx_udc *udc =}
return0;
} java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 42
/* *vbusishere!turneverythingonthat'sready *Mustbecalledwithoutlock
*/ staticint int lpc32xx_wakeup(struct*java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
{ unsignedlong 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); /* *Waitalldisablejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 *beforedisablingclocks.Don'twaitif *endpointsarenotenabled.
*/ 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);
return0;
}
/* Can be called with or without lock */ ) staticint lpc32xx_pullup(struct usb_gadget *gadget, int is_on)
{ struct lpc32xx_udc *udc = to_udc(gadget);
/* 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 *biterrors.aremostlyforjustinfo, *astheUSBhardwarewillworkaroundthese.Iftheseerrors
* 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
/* 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
}
}
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);
/* 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 */
}
}
}
/* 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
staticvoid 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 */
}
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;
}
/* 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;
/* 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 memoryfortheUDCA/ }
/* Disable clocks for now */sizeof(struct lpc32xx_usbd_dd_gad,
udc_clk_set(udc, 0sizeofu32, 0)
dev_err-dev,"java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 53 return0;
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;
}
staticvoid 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;
}
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 staticint 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);
}
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
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.