亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usbdcore_omap1510.c

?? OMAP1510的USB驅動程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
		/* Determine the endpoint number for this interrupt */		epnum = (inw (UDC_EPN_STAT) & 0x0f00) >> 8;		UDCDBGA ("RX on ep %x", epnum);		/* acknowledge interrupt */		outw (UDC_EPn_RX, UDC_IRQ_SRC);		if (epnum) {			/* select the endpoint FIFO */			outw (UDC_EP_Sel | epnum, UDC_EP_NUM);			omap1510_udc_epn_rx (epnum);			/* deselect the endpoint FIFO */			outw (epnum, UDC_EP_NUM);		}		valid_irq++;	}	if (irq_src & UDC_EPn_TX) {	/* Endpoint N IN transaction */		/* Determine the endpoint number for this interrupt */		epnum = (inw (UDC_EPN_STAT) & 0x000f) | USB_DIR_IN;		UDCDBGA ("TX on ep %x", epnum);		/* acknowledge interrupt */		outw (UDC_EPn_TX, UDC_IRQ_SRC);		if (epnum) {			/* select the endpoint FIFO */			outw (UDC_EP_Sel | UDC_EP_Dir | epnum, UDC_EP_NUM);			omap1510_udc_epn_tx (epnum);			/* deselect the endpoint FIFO */			outw (UDC_EP_Dir | epnum, UDC_EP_NUM);		}		valid_irq++;	}	if (!valid_irq)		serial_printf (": unknown non-ISO interrupt, IRQ_SRC %.4x\n",			       irq_src);}/*-------------------------------------------------------------------------------*//* * Start of public functions. *//* Called to start packet transmission. */void udc_endpoint_write (struct usb_endpoint_instance *endpoint){	unsigned short epnum =		endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK;	UDCDBGA ("Starting transmit on ep %x", epnum);	if (endpoint->tx_urb) {		/* select the endpoint FIFO */		outw (UDC_EP_Sel | UDC_EP_Dir | epnum, UDC_EP_NUM);		/* write data to FIFO */		omap1510_write_noniso_tx_fifo (endpoint);		/* enable tx FIFO to start transmission */		outw (UDC_Set_FIFO_En, UDC_CTRL);		/* deselect the endpoint FIFO */		outw (UDC_EP_Dir | epnum, UDC_EP_NUM);	}}/* Start to initialize h/w stuff */int udc_init (void){	u16 udc_rev;	uchar value;	ulong gpio;	int i;	/* Let the device settle down before we start */	for (i = 0; i < UDC_INIT_MDELAY; i++) udelay(1000);	udc_device = NULL;	UDCDBG ("starting");	/* Check peripheral reset. Must be 1 to make sure	   MPU TIPB peripheral reset is inactive */	UDCREG (ARM_RSTCT2);	/* Set and check clock control.	 * We might ought to be using the clock control API to do	 * this instead of fiddling with the clock registers directly	 * here.	 */	outw ((1 << 4) | (1 << 5), CLOCK_CTRL);	UDCREG (CLOCK_CTRL);	/* Set and check APLL */	outw (0x0008, APLL_CTRL);	UDCREG (APLL_CTRL);	/* Set and check DPLL */	outw (0x2210, DPLL_CTRL);	UDCREG (DPLL_CTRL);	/* Set and check SOFT */	outw ((1 << 4) | (1 << 3) | 1, SOFT_REQ);	/* Short delay to wait for DPLL */	udelay (1000);	/* Print banner with device revision */	udc_rev = inw (UDC_REV) & 0xff;	printf ("USB:   TI OMAP1510 USB function module rev %d.%d\n",		udc_rev >> 4, udc_rev & 0xf);#ifdef CONFIG_OMAP_SX1	i2c_read (0x32, 0x04, 1, &value, 1);	value |= 0x04;	i2c_write (0x32, 0x04, 1, &value, 1);	i2c_read (0x32, 0x03, 1, &value, 1);	value |= 0x01;	i2c_write (0x32, 0x03, 1, &value, 1);	gpio = inl(GPIO_PIN_CONTROL_REG);	gpio |=  0x0002; /* A_IRDA_OFF */	gpio |=  0x0800; /* A_SWITCH   */	gpio |=  0x8000; /* A_USB_ON   */	outl (gpio, GPIO_PIN_CONTROL_REG);	gpio = inl(GPIO_DIR_CONTROL_REG);	gpio &= ~0x0002; /* A_IRDA_OFF */	gpio &= ~0x0800; /* A_SWITCH   */	gpio &= ~0x8000; /* A_USB_ON   */	outl (gpio, GPIO_DIR_CONTROL_REG);	gpio = inl(GPIO_DATA_OUTPUT_REG);	gpio |=  0x0002; /* A_IRDA_OFF */	gpio &= ~0x0800; /* A_SWITCH   */	gpio &= ~0x8000; /* A_USB_ON   */	outl (gpio, GPIO_DATA_OUTPUT_REG);#endif	/* The VBUS_MODE bit selects whether VBUS detection is done via	 * software (1) or hardware (0).  When software detection is	 * selected, VBUS_CTRL selects whether USB is not connected (0)	 * or connected (1).	 */	outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_MODE, FUNC_MUX_CTRL_0);	outl (inl (FUNC_MUX_CTRL_0) & ~UDC_VBUS_CTRL, FUNC_MUX_CTRL_0);	UDCREGL (FUNC_MUX_CTRL_0);	/*	 * At this point, device is ready for configuration...	 */	UDCDBG ("disable USB interrupts");	outw (0, UDC_IRQ_EN);	UDCREG (UDC_IRQ_EN);	UDCDBG ("disable USB DMA");	outw (0, UDC_DMA_IRQ_EN);	UDCREG (UDC_DMA_IRQ_EN);	UDCDBG ("initialize SYSCON1");	outw (UDC_Self_Pwr | UDC_Pullup_En, UDC_SYSCON1);	UDCREG (UDC_SYSCON1);	return 0;}/* Stall endpoint */static void udc_stall_ep (unsigned int ep_addr){	/*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */	int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK;	UDCDBGA ("stall ep_addr %d", ep_addr);	/* REVISIT?	 * The OMAP TRM section 14.2.4.2 says we must check that the FIFO	 * is empty before halting the endpoint.  The current implementation	 * doesn't check that the FIFO is empty.	 */	if (!ep_num) {		outw (UDC_Stall_Cmd, UDC_SYSCON2);	} else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {		if (inw (UDC_EP_RX (ep_num)) & UDC_EPn_RX_Valid) {			/* we have a valid rx endpoint, so halt it */			outw (UDC_EP_Sel | ep_num, UDC_EP_NUM);			outw (UDC_Set_Halt, UDC_CTRL);			outw (ep_num, UDC_EP_NUM);		}	} else {		if (inw (UDC_EP_TX (ep_num)) & UDC_EPn_TX_Valid) {			/* we have a valid tx endpoint, so halt it */			outw (UDC_EP_Sel | UDC_EP_Dir | ep_num, UDC_EP_NUM);			outw (UDC_Set_Halt, UDC_CTRL);			outw (ep_num, UDC_EP_NUM);		}	}}/* Reset endpoint */#if 0static void udc_reset_ep (unsigned int ep_addr){	/*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */	int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK;	UDCDBGA ("reset ep_addr %d", ep_addr);	if (!ep_num) {		/* control endpoint 0 can't be reset */	} else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {		UDCDBGA ("UDC_EP_RX(%d) = 0x%04x", ep_num,			 inw (UDC_EP_RX (ep_num)));		if (inw (UDC_EP_RX (ep_num)) & UDC_EPn_RX_Valid) {			/* we have a valid rx endpoint, so reset it */			outw (ep_num | UDC_EP_Sel, UDC_EP_NUM);			outw (UDC_Reset_EP, UDC_CTRL);			outw (ep_num, UDC_EP_NUM);			UDCDBGA ("OUT endpoint %d reset", ep_num);		}	} else {		UDCDBGA ("UDC_EP_TX(%d) = 0x%04x", ep_num,			 inw (UDC_EP_TX (ep_num)));		/* Resetting of tx endpoints seems to be causing the USB function		 * module to fail, which causes problems when the driver is		 * uninstalled.	 We'll skip resetting tx endpoints for now until		 * we figure out what the problem is.		 */#if 0		if (inw (UDC_EP_TX (ep_num)) & UDC_EPn_TX_Valid) {			/* we have a valid tx endpoint, so reset it */			outw (ep_num | UDC_EP_Dir | UDC_EP_Sel, UDC_EP_NUM);			outw (UDC_Reset_EP, UDC_CTRL);			outw (ep_num | UDC_EP_Dir, UDC_EP_NUM);			UDCDBGA ("IN endpoint %d reset", ep_num);		}#endif	}}#endif/* ************************************************************************** *//** * udc_check_ep - check logical endpoint  * * Return physical endpoint number to use for this logical endpoint or zero if not valid. */#if 0int udc_check_ep (int logical_endpoint, int packetsize){	if ((logical_endpoint == 0x80) ||	    ((logical_endpoint & 0x8f) != logical_endpoint)) {		return 0;	}	switch (packetsize) {	case 8:	case 16:	case 32:	case 64:	case 128:	case 256:	case 512:		break;	default:		return 0;	}	return EP_ADDR_TO_PHYS_EP (logical_endpoint);}#endif/* * udc_setup_ep - setup endpoint * * Associate a physical endpoint with endpoint_instance */void udc_setup_ep (struct usb_device_instance *device,		   unsigned int ep, struct usb_endpoint_instance *endpoint){	UDCDBGA ("setting up endpoint addr %x", endpoint->endpoint_address);	/* This routine gets called by bi_modinit for endpoint 0 and from	 * bi_config for all of the other endpoints.  bi_config gets called	 * during the DEVICE_CREATE, DEVICE_CONFIGURED, and	 * DEVICE_SET_INTERFACE events.	 We need to reconfigure the OMAP packet	 * RAM after bi_config scans the selected device configuration and	 * initializes the endpoint structures, but before this routine enables	 * the OUT endpoint FIFOs.  Since bi_config calls this routine in a	 * loop for endpoints 1 through UDC_MAX_ENDPOINTS, we reconfigure our	 * packet RAM here when ep==1.	 * I really hate to do this here, but it seems like the API exported	 * by the USB bus interface controller driver to the usbd-bi module	 * isn't quite right so there is no good place to do this.	 */	if (ep == 1) {		omap1510_deconfigure_device ();		omap1510_configure_device (device);	}	if (endpoint && (ep < UDC_MAX_ENDPOINTS)) {		int ep_addr = endpoint->endpoint_address;		if (!ep_addr) {			/* nothing to do for endpoint 0 */		} else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {			/* nothing to do for IN (tx) endpoints */		} else {	/* OUT (rx) endpoint */			if (endpoint->rcv_packetSize) {				/*struct urb* urb = &(urb_out_array[ep&0xFF]); */				/*urb->endpoint = endpoint; */				/*urb->device = device; */				/*urb->buffer_length = sizeof(urb->buffer); */				/*endpoint->rcv_urb = urb; */				omap1510_prepare_endpoint_for_rx (ep_addr);			}		}	}}/** * udc_disable_ep - disable endpoint * @ep: * * Disable specified endpoint */#if 0void udc_disable_ep (unsigned int ep_addr){	/*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */	int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK;	struct usb_endpoint_instance *endpoint = omap1510_find_ep (ep_addr);	/*udc_device->bus->endpoint_array + ep; */	UDCDBGA ("disable ep_addr %d", ep_addr);	if (!ep_num) {		/* nothing to do for endpoint 0 */ ;	} else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {		if (endpoint->tx_packetSize) {			/* we have a valid tx endpoint */			/*usbd_flush_tx(endpoint); */			endpoint->tx_urb = NULL;		}	} else {		if (endpoint->rcv_packetSize) {			/* we have a valid rx endpoint */			/*usbd_flush_rcv(endpoint); */			endpoint->rcv_urb = NULL;		}	}}#endif/* ************************************************************************** *//** * udc_connected - is the USB cable connected * * Return non-zero if cable is connected. */#if 0int udc_connected (void){	return ((inw (UDC_DEVSTAT) & UDC_ATT) == UDC_ATT);}#endif/* Turn on the USB connection by enabling the pullup resistor */void udc_connect (void){	UDCDBG ("connect, enable Pullup");	outl (0x00000018, FUNC_MUX_CTRL_D);}/* Turn off the USB connection by disabling the pullup resistor */void udc_disconnect (void){	UDCDBG ("disconnect, disable Pullup");	outl (0x00000000, FUNC_MUX_CTRL_D);}/* ************************************************************************** *//* * udc_disable_interrupts - disable interrupts * switch off interrupts */#if 0void udc_disable_interrupts (struct usb_device_instance *device){	UDCDBG ("disabling all interrupts");	outw (0, UDC_IRQ_EN);}#endif/* ************************************************************************** *//** * udc_ep0_packetsize - return ep0 packetsize */#if 0int udc_ep0_packetsize (void){	return EP0_PACKETSIZE;}#endif/* Switch on the UDC */void udc_enable (struct usb_device_instance *device){	UDCDBGA ("enable device %p, status %d", device, device->status);	/* initialize driver state variables */	udc_devstat = 0;	/* Save the device structure pointer */	udc_device = device;	/* Setup ep0 urb */	if (!ep0_urb) {		ep0_urb =			usbd_alloc_urb (udc_device,					udc_device->bus->endpoint_array);	} else {		serial_printf ("udc_enable: ep0_urb already allocated %p\n",			       ep0_urb);	}	UDCDBG ("Check clock status");	UDCREG (STATUS_REQ);	/* The VBUS_MODE bit selects whether VBUS detection is done via	 * software (1) or hardware (0).  When software detection is	 * selected, VBUS_CTRL selects whether USB is not connected (0)	 * or connected (1).	 */	outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_CTRL | UDC_VBUS_MODE,	      FUNC_MUX_CTRL_0);	UDCREGL (FUNC_MUX_CTRL_0);	omap1510_configure_device (device);}/* Switch off the UDC */void udc_disable (void){	UDCDBG ("disable UDC");	omap1510_deconfigure_device ();	/* The VBUS_MODE bit selects whether VBUS detection is done via	 * software (1) or hardware (0).  When software detection is	 * selected, VBUS_CTRL selects whether USB is not connected (0)	 * or connected (1).	 */	outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_MODE, FUNC_MUX_CTRL_0);	outl (inl (FUNC_MUX_CTRL_0) & ~UDC_VBUS_CTRL, FUNC_MUX_CTRL_0);	UDCREGL (FUNC_MUX_CTRL_0);	/* Free ep0 URB */	if (ep0_urb) {		/*usbd_dealloc_urb(ep0_urb); */		ep0_urb = NULL;	}	/* Reset device pointer.	 * We ought to do this here to balance the initialization of udc_device	 * in udc_enable, but some of our other exported functions get called	 * by the bus interface driver after udc_disable, so we have to hang on	 * to the device pointer to avoid a null pointer dereference. */	/* udc_device = NULL; */}/** * udc_startup - allow udc code to do any additional startup */void udc_startup_events (struct usb_device_instance *device){	/* The DEVICE_INIT event puts the USB device in the state STATE_INIT. */	usbd_device_event_irq (device, DEVICE_INIT, 0);	/* The DEVICE_CREATE event puts the USB device in the state	 * STATE_ATTACHED.	 */	usbd_device_event_irq (device, DEVICE_CREATE, 0);	/* Some USB controller driver implementations signal	 * DEVICE_HUB_CONFIGURED and DEVICE_RESET events here.	 * DEVICE_HUB_CONFIGURED causes a transition to the state STATE_POWERED,	 * and DEVICE_RESET causes a transition to the state STATE_DEFAULT.	 * The OMAP USB client controller has the capability to detect when the	 * USB cable is connected to a powered USB bus via the ATT bit in the	 * DEVSTAT register, so we will defer the DEVICE_HUB_CONFIGURED and	 * DEVICE_RESET events until later.	 */	udc_enable (device);}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品在线观看网站| 激情偷乱视频一区二区三区| 国产精品麻豆视频| 亚洲国产成人在线| 国产精品国产三级国产三级人妇 | 精品成人私密视频| 精品国产一区二区亚洲人成毛片 | 一区二区激情视频| 亚洲高清免费一级二级三级| 午夜精品一区在线观看| 三级久久三级久久久| 久久精品99国产精品| 国产一区二区三区在线观看精品| 国产精品自在欧美一区| 国产suv精品一区二区三区 | 久久久久国产一区二区三区四区| 337p粉嫩大胆噜噜噜噜噜91av| 久久综合九色综合97婷婷女人| 久久精品一区二区三区四区| 国产精品素人一区二区| 亚洲美女在线一区| 午夜精品久久久久影视| 激情五月播播久久久精品| 国产精品一区免费视频| 97se亚洲国产综合自在线不卡| 色噜噜久久综合| 欧美一区二区三区四区在线观看 | 日本特黄久久久高潮| 国产在线精品免费| 一本一道综合狠狠老| 欧美美女一区二区在线观看| 久久影音资源网| 日韩毛片精品高清免费| 日本成人在线网站| 国产福利一区在线观看| 色综合一个色综合| 欧美刺激脚交jootjob| 国产精品麻豆视频| 无码av免费一区二区三区试看 | 日韩免费一区二区| 欧美激情中文字幕一区二区| 亚洲综合激情网| 极品少妇xxxx精品少妇| 99re热这里只有精品免费视频| 欧美日韩二区三区| 国产日韩欧美精品综合| 亚洲最新在线观看| 国产成人综合亚洲网站| 欧美日韩一级二级三级| 国产精品日日摸夜夜摸av| 日韩av电影一区| 色呦呦日韩精品| 久久久美女毛片| 午夜精品一区二区三区电影天堂| 国产精品夜夜嗨| 欧美精品第1页| 亚洲天堂福利av| 韩国女主播成人在线观看| 91国内精品野花午夜精品| 国产视频视频一区| 日韩国产欧美在线视频| 91蜜桃传媒精品久久久一区二区| 欧美va亚洲va在线观看蝴蝶网| 亚洲一级在线观看| thepron国产精品| www国产亚洲精品久久麻豆| 亚洲综合丁香婷婷六月香| 成人一区二区三区视频 | 日韩高清在线不卡| 色婷婷av一区二区三区之一色屋| 国产三区在线成人av| 日韩 欧美一区二区三区| 91久久精品一区二区三| 国产精品美女久久久久aⅴ| 九九久久精品视频| 91精品婷婷国产综合久久性色 | 一级日本不卡的影视| 大桥未久av一区二区三区中文| 日韩一区二区精品| 午夜视频在线观看一区二区| 97超碰欧美中文字幕| 亚洲国产成人在线| 国产精品中文有码| 久久综合网色—综合色88| 日本成人中文字幕| 91精品国产综合久久久久久久| 一区二区三区四区不卡在线 | 一本大道久久a久久精品综合| 国产女人水真多18毛片18精品视频| 青青青爽久久午夜综合久久午夜| 欧美日韩精品高清| 一区二区三区产品免费精品久久75| 波多野结衣精品在线| 欧美国产日本韩| 国产一区二区女| 久久久久久99精品| 国产精品一二一区| 亚洲国产精华液网站w | 欧美大片日本大片免费观看| 水蜜桃久久夜色精品一区的特点| 91久久精品网| 亚洲成人激情自拍| 欧美日韩成人在线一区| 日本欧美韩国一区三区| 欧美一区二区不卡视频| 美女一区二区久久| 精品国精品自拍自在线| 国产成人综合精品三级| 国产精品全国免费观看高清| 91免费国产在线观看| 一区二区三区在线视频免费观看 | 亚洲自拍偷拍网站| 欧美日韩亚洲另类| 日韩avvvv在线播放| 精品国产精品一区二区夜夜嗨| 精品一区二区在线免费观看| 2021久久国产精品不只是精品| 国产一区视频在线看| 国产精品污网站| 色八戒一区二区三区| 亚洲成人福利片| 日韩午夜在线影院| 国产精品影音先锋| 亚洲天堂2014| 欧美日韩精品专区| 国产中文字幕一区| 亚洲欧美经典视频| 欧美一级二级在线观看| 国产精品一区二区男女羞羞无遮挡| 国产精品你懂的在线| 欧美午夜在线一二页| 另类的小说在线视频另类成人小视频在线| 精品欧美一区二区久久| 99视频热这里只有精品免费| 亚洲成a人v欧美综合天堂| 久久综合色综合88| 91国在线观看| 激情国产一区二区| 亚洲图片另类小说| 在线不卡一区二区| 成人黄动漫网站免费app| 午夜精品国产更新| 国产欧美日韩在线视频| 欧美综合色免费| 国产另类ts人妖一区二区| 亚洲乱码国产乱码精品精小说| 欧美一卡二卡在线观看| 成人妖精视频yjsp地址| 午夜久久久久久电影| 国产偷国产偷精品高清尤物| 欧美唯美清纯偷拍| 成人综合激情网| 视频一区欧美精品| 中文在线一区二区| 欧美一区二区在线不卡| 91在线观看污| 麻豆一区二区三| 亚洲激情图片一区| 国产日本一区二区| 欧美一区二区三区视频免费播放| 成人网在线免费视频| 久久超级碰视频| 亚洲一区成人在线| 国产精品久久777777| 日韩免费高清视频| 欧洲精品中文字幕| 成人黄色av网站在线| 经典三级视频一区| 日本欧美韩国一区三区| 亚洲精品菠萝久久久久久久| 国产亚洲自拍一区| 91精品国产91热久久久做人人| 99精品视频在线播放观看| 国产在线日韩欧美| 日本少妇一区二区| 亚洲国产精品久久久久婷婷884 | 久久一区二区视频| 欧美日韩国产片| 91丨porny丨中文| 岛国精品在线观看| 国产综合久久久久久鬼色| 日韩激情视频在线观看| 亚洲一区二区三区四区的| 亚洲四区在线观看| 国产精品久久久久一区二区三区共 | 欧美日韩精品欧美日韩精品一综合| 成人国产精品免费观看动漫 | 欧美一区二区成人| 欧美日本精品一区二区三区| 国产婷婷色一区二区三区在线| 欧美一区二区三区小说| 欧美丰满高潮xxxx喷水动漫| 欧美性色欧美a在线播放| 白白色 亚洲乱淫| 成人黄色国产精品网站大全在线免费观看 | 欧美日韩一卡二卡三卡| 在线观看日韩高清av| 91女人视频在线观看| 91香蕉视频污| 在线观看中文字幕不卡|