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

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

?? ohci-s3c2410.c

?? host usb 主設備程序 支持sd卡 mouse keyboard 的最單單的驅動程序 gcc編譯
?? C
字號:
/* * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2002 Hewlett-Packard Company * * USB Bus Glue for Samsung S3C2410 * * Written by Christopher Hoover <ch@hpl.hp.com> * Based on fragments of previous driver by Rusell King et al. * * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c *	by Ben Dooks, <ben@simtec.co.uk> *	Copyright (C) 2004 Simtec Electronics * * Thanks to basprog@mail.ru for updates to newer kernels * * This file is licenced under the GPL.*/#include <linux/platform_device.h>#include <linux/clk.h>#include <asm/hardware.h>#include <asm/arch/usb-control.h>#include <asm/arch/regs-gpio.h>#if defined(CONFIG_CPU_S3C6400)#include <asm/arch/regs-s3c6400-clock.h>#elif defined(CONFIG_CPU_S3C6410)#include <asm/arch/regs-s3c6410-clock.h>#endif#define USB_HOST_PORT2_EN	0#if (USB_HOST_PORT2_EN == 1) && (CONFIG_PLAT_S3C64XX == 1)#include <asm/arch/regs-usb-otg-hs.h>#endif#define valid_port(idx) ((idx) == 1 || (idx) == 2)/* clock device associated with the hcd */static struct clk *clk;static struct clk *usb_clk;#if (USB_HOST_PORT2_EN == 1) && (CONFIG_PLAT_S3C64XX == 1)static struct clk *otg_clk;#endif/* forward definitions */static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);/* conversion functions */static struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd){	return hcd->self.controller->platform_data;}static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd){	struct s3c2410_hcd_info *info = dev->dev.platform_data;	dev_dbg(&dev->dev, "s3c2410_start_hc:\n");	clk_enable(usb_clk);	mdelay(2);			/* let the bus clock stabilise */	clk_enable(clk);#if (USB_HOST_PORT2_EN == 1) && (CONFIG_PLAT_S3C64XX == 1)	clk_enable(otg_clk);#endif	if (info != NULL) {		info->hcd	= hcd;		info->report_oc = s3c2410_hcd_oc;		if (info->enable_oc != NULL) {			(info->enable_oc)(info, 1);		}	}}static void s3c2410_stop_hc(struct platform_device *dev){	struct s3c2410_hcd_info *info = dev->dev.platform_data;	dev_dbg(&dev->dev, "s3c2410_stop_hc:\n");	if (info != NULL) {		info->report_oc = NULL;		info->hcd	= NULL;		if (info->enable_oc != NULL) {			(info->enable_oc)(info, 0);		}	}	clk_disable(clk);	clk_disable(usb_clk);}/* ohci_s3c2410_hub_status_data * * update the status data from the hub with anything that * has been detected by our system*/static intohci_s3c2410_hub_status_data (struct usb_hcd *hcd, char *buf){	struct s3c2410_hcd_info *info = to_s3c2410_info(hcd);	struct s3c2410_hcd_port *port;	int orig;	int portno;	orig  = ohci_hub_status_data (hcd, buf);	if (info == NULL)		return orig;	port = &info->port[0];	/* mark any changed port as changed */	for (portno = 0; portno < 2; port++, portno++) {		if (port->oc_changed == 1 &&		    port->flags & S3C_HCDFLG_USED) {			dev_dbg(hcd->self.controller,				"oc change on port %d\n", portno);			if (orig < 1)				orig = 1;			buf[0] |= 1<<(portno+1);		}	}	return orig;}/* s3c2410_usb_set_power * * configure the power on a port, by calling the platform device * routine registered with the platform device*/static void s3c2410_usb_set_power(struct s3c2410_hcd_info *info,				  int port, int to){	if (info == NULL)		return;	if (info->power_control != NULL) {		info->port[port-1].power = to;		(info->power_control)(port-1, to);	}}/* ohci_s3c2410_hub_control * * look at control requests to the hub, and see if we need * to take any action or over-ride the results from the * request.*/static int ohci_s3c2410_hub_control (	struct usb_hcd	*hcd,	u16		typeReq,	u16		wValue,	u16		wIndex,	char		*buf,	u16		wLength){	struct s3c2410_hcd_info *info = to_s3c2410_info(hcd);	struct usb_hub_descriptor *desc;	int ret = -EINVAL;	u32 *data = (u32 *)buf;	dev_dbg(hcd->self.controller,		"s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n",		hcd, typeReq, wValue, wIndex, buf, wLength);	/* if we are only an humble host without any special capabilities	 * process the request straight away and exit */	if (info == NULL) {		ret = ohci_hub_control(hcd, typeReq, wValue,				       wIndex, buf, wLength);		goto out;	}	/* check the request to see if it needs handling */	switch (typeReq) {	case SetPortFeature:		if (wValue == USB_PORT_FEAT_POWER) {			dev_dbg(hcd->self.controller, "SetPortFeat: POWER\n");			s3c2410_usb_set_power(info, wIndex, 1);			goto out;		}		break;	case ClearPortFeature:		switch (wValue) {		case USB_PORT_FEAT_C_OVER_CURRENT:			dev_dbg(hcd->self.controller,				"ClearPortFeature: C_OVER_CURRENT\n");			if (valid_port(wIndex)) {				info->port[wIndex-1].oc_changed = 0;				info->port[wIndex-1].oc_status = 0;			}			goto out;		case USB_PORT_FEAT_OVER_CURRENT:			dev_dbg(hcd->self.controller,				"ClearPortFeature: OVER_CURRENT\n");			if (valid_port(wIndex)) {				info->port[wIndex-1].oc_status = 0;			}			goto out;		case USB_PORT_FEAT_POWER:			dev_dbg(hcd->self.controller,				"ClearPortFeature: POWER\n");			if (valid_port(wIndex)) {				s3c2410_usb_set_power(info, wIndex, 0);				return 0;			}		}		break;	}	ret = ohci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);	if (ret)		goto out;	switch (typeReq) {	case GetHubDescriptor:		/* update the hub's descriptor */		desc = (struct usb_hub_descriptor *)buf;		if (info->power_control == NULL)			return ret;		dev_dbg(hcd->self.controller, "wHubCharacteristics 0x%04x\n",			desc->wHubCharacteristics);		/* remove the old configurations for power-switching, and		 * over-current protection, and insert our new configuration		 */		desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_LPSM);		desc->wHubCharacteristics |= cpu_to_le16(0x0001);		if (info->enable_oc) {			desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_OCPM);			desc->wHubCharacteristics |=  cpu_to_le16(0x0008|0x0001);		}		dev_dbg(hcd->self.controller, "wHubCharacteristics after 0x%04x\n",			desc->wHubCharacteristics);		return ret;	case GetPortStatus:		/* check port status */		dev_dbg(hcd->self.controller, "GetPortStatus(%d)\n", wIndex);		if (valid_port(wIndex)) {			if (info->port[wIndex-1].oc_changed) {				*data |= cpu_to_le32(RH_PS_OCIC);			}			if (info->port[wIndex-1].oc_status) {				*data |= cpu_to_le32(RH_PS_POCI);			}		}	} out:	return ret;}/* s3c2410_hcd_oc * * handle an over-current report*/static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc){	struct s3c2410_hcd_port *port;	struct usb_hcd *hcd;	unsigned long flags;	int portno;	if (info == NULL)		return;	port = &info->port[0];	hcd = info->hcd;	local_irq_save(flags);	for (portno = 0; portno < 2; port++, portno++) {		if (port_oc & (1<<portno) &&		    port->flags & S3C_HCDFLG_USED) {			port->oc_status = 1;			port->oc_changed = 1;			/* ok, once over-current is detected,			   the port needs to be powered down */			s3c2410_usb_set_power(info, portno+1, 0);		}	}	local_irq_restore(flags);}/* may be called without controller electrically present *//* may be called with controller, bus, and devices active *//* * usb_hcd_s3c2410_remove - shutdown processing for HCD * @dev: USB Host Controller being removed * Context: !in_interrupt() * * Reverses the effect of usb_hcd_3c2410_probe(), first invoking * the HCD's stop() method.  It is always called from a thread * context, normally "rmmod", "apmd", or something similar. **/static voidusb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev){	usb_remove_hcd(hcd);	s3c2410_stop_hc(dev);	iounmap(hcd->regs);	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);	usb_put_hcd(hcd);}/** * usb_hcd_s3c2410_probe - initialize S3C2410-based HCDs * Context: !in_interrupt() * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it * through the hotplug entry's driver_data. * */static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,				  struct platform_device *dev){	struct usb_hcd *hcd = NULL;	int retval;#if defined(CONFIG_CPU_S3C2450) || defined(CONFIG_CPU_S3C2416)	/* USB host Power enable */	s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP);	s3c2410_gpio_pullup(S3C2410_GPB4, 0);	s3c2410_gpio_setpin(S3C2410_GPB4, 1);#endif#if (USB_HOST_PORT2_EN == 1) && (CONFIG_PLAT_S3C64XX == 1)	/* set USB_SIG_MASK */	__raw_writel( __raw_readl(S3C_OTHERS)|(1<<16), S3C_OTHERS);	/* Initializes OTG PHY */	__raw_writel(0x0, S3C_USBOTG_PHYPWR);	__raw_writel(0x60, S3C_USBOTG_PHYCLK);	__raw_writel(0x1, S3C_USBOTG_RSTCON);		udelay(20);	__raw_writel(0x0, S3C_USBOTG_RSTCON);	udelay(20);#endif	s3c2410_usb_set_power(dev->dev.platform_data, 1, 1);	s3c2410_usb_set_power(dev->dev.platform_data, 2, 1);	hcd = usb_create_hcd(driver, &dev->dev, "s3c24xx");	if (hcd == NULL)		return -ENOMEM;	hcd->rsrc_start = dev->resource[0].start;	hcd->rsrc_len   = dev->resource[0].end - dev->resource[0].start + 1;	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {		dev_err(&dev->dev, "request_mem_region failed");		retval = -EBUSY;		goto err_put;	}	clk = clk_get(&dev->dev, "usb-host");	if (IS_ERR(clk)) {		dev_err(&dev->dev, "cannot get usb-host clock\n");		retval = -ENOENT;		goto err_mem;	}#if (USB_HOST_PORT2_EN == 1) && (CONFIG_PLAT_S3C64XX == 1)	otg_clk = clk_get(&dev->dev, "otg");	if (IS_ERR(clk)) {		dev_err(&dev->dev, "cannot get otg clock\n");		retval = -ENOENT;		goto err_mem;	}#endif#if !defined(CONFIG_CPU_S3C6400) && !defined(CONFIG_CPU_S3C6410)	usb_clk = clk_get(&dev->dev, "usb-bus-host");	if (IS_ERR(usb_clk)) {		dev_err(&dev->dev, "cannot get usb-host clock\n");		retval = -ENOENT;		goto err_clk;	}#endif	s3c2410_start_hc(dev, hcd);	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);	if (!hcd->regs) {		dev_err(&dev->dev, "ioremap failed\n");		retval = -ENOMEM;		goto err_ioremap;	}	ohci_hcd_init(hcd_to_ohci(hcd));	retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED);	if (retval != 0)		goto err_ioremap;	return 0; err_ioremap:	s3c2410_stop_hc(dev);	iounmap(hcd->regs);	clk_put(usb_clk);#if !defined(CONFIG_CPU_S3C6400) && !defined(CONFIG_CPU_S3C6410) err_clk:	clk_put(clk);#endif err_mem:	release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err_put:	usb_put_hcd(hcd);	return retval;}/*-------------------------------------------------------------------------*/static intohci_s3c2410_start (struct usb_hcd *hcd){	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);	int ret;	if ((ret = ohci_init(ohci)) < 0)		return ret;	if ((ret = ohci_run (ohci)) < 0) {		err ("can't start %s", hcd->self.bus_name);		ohci_stop (hcd);		return ret;	}	return 0;}static const struct hc_driver ohci_s3c2410_hc_driver = {	.description =		hcd_name,	.product_desc =		"S3C24XX OHCI",	.hcd_priv_size =	sizeof(struct ohci_hcd),	/*	 * generic hardware linkage	 */	.irq =			ohci_irq,	.flags =		HCD_USB11 | HCD_MEMORY,	/*	 * basic lifecycle operations	 */	.start =		ohci_s3c2410_start,	.stop =			ohci_stop,	.shutdown =		ohci_shutdown,	/*	 * managing i/o requests and associated device resources	 */	.urb_enqueue =		ohci_urb_enqueue,	.urb_dequeue =		ohci_urb_dequeue,	.endpoint_disable =	ohci_endpoint_disable,	/*	 * scheduling support	 */	.get_frame_number =	ohci_get_frame,	/*	 * root hub support	 */	.hub_status_data =	ohci_s3c2410_hub_status_data,	.hub_control =		ohci_s3c2410_hub_control,	.hub_irq_enable =	ohci_rhsc_enable,#ifdef	CONFIG_PM	.bus_suspend =		ohci_bus_suspend,	.bus_resume =		ohci_bus_resume,#endif	.start_port_reset =	ohci_start_port_reset,};/* device driver */static int ohci_hcd_s3c2410_drv_probe(struct platform_device *pdev){	return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev);}static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev){	struct usb_hcd *hcd = platform_get_drvdata(pdev);	usb_hcd_s3c2410_remove(hcd, pdev);	return 0;}static struct platform_driver ohci_hcd_s3c2410_driver = {	.probe		= ohci_hcd_s3c2410_drv_probe,	.remove		= ohci_hcd_s3c2410_drv_remove,	.shutdown	= usb_hcd_platform_shutdown,	/*.suspend	= ohci_hcd_s3c2410_drv_suspend, */	/*.resume	= ohci_hcd_s3c2410_drv_resume, */	.driver		= {		.owner	= THIS_MODULE,		.name	= "s3c2410-ohci",	},};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩理论片在线| 免费看日韩精品| 欧美一区二区三区影视| k8久久久一区二区三区| 久久99国产精品尤物| 色综合久久久久| 精品中文av资源站在线观看| 不卡视频在线观看| 99精品视频中文字幕| 91视频免费观看| 欧美绝品在线观看成人午夜影视| 欧美亚日韩国产aⅴ精品中极品| 99久久久久免费精品国产| 欧美成人欧美edvon| 欧美第一区第二区| 国产婷婷色一区二区三区四区| 久久免费国产精品| 国产精品色眯眯| 中文字幕在线不卡一区| 一区二区三区精品| 亚洲第一av色| 美洲天堂一区二卡三卡四卡视频| 精品一区二区三区在线播放| 欧美日韩久久久久久| 久久久久久免费毛片精品| 日韩av二区在线播放| 国产一区二区主播在线| 成人av小说网| 国产精品午夜在线观看| 国产精品一区在线观看乱码 | 亚洲一区二三区| 免费观看日韩av| 欧美精品在线观看一区二区| 亚洲综合丝袜美腿| 欧美日韩免费在线视频| 欧美不卡123| 精品一区二区三区久久| 久久精品欧美日韩| 东方aⅴ免费观看久久av| 欧美影院午夜播放| 视频一区在线播放| 99精品视频在线观看| 亚洲色图.com| 欧美三区免费完整视频在线观看| 亚洲国产精品一区二区久久 | 免费人成在线不卡| 日韩一级大片在线| 一区二区三区在线播放| 欧美亚洲禁片免费| 视频一区二区中文字幕| 日韩美女天天操| 高清视频一区二区| 亚洲精品久久久蜜桃| 国模大尺度一区二区三区| 精品视频免费在线| 久久电影国产免费久久电影| 欧美日韩国产三级| 精品一区二区免费视频| 欧美高清在线一区| 久久99精品国产91久久来源| 欧美国产欧美综合| 欧美日韩你懂的| 国产成人免费在线| 久久久三级国产网站| 99国产精品99久久久久久| 午夜婷婷国产麻豆精品| 欧美日韩亚洲国产综合| 极品少妇xxxx精品少妇| 亚洲色图视频网| 日韩欧美高清在线| 99精品视频在线观看免费| 日韩高清国产一区在线| 中文字幕一区二区三| 91精品国产91久久综合桃花| 波多野结衣欧美| 蜜臀av亚洲一区中文字幕| 欧美国产成人在线| 欧美xxxx在线观看| 在线观看区一区二| 亚洲国产欧美日韩另类综合 | 成人免费视频播放| 国产亚洲精品bt天堂精选| 91成人国产精品| 亚洲高清一区二区三区| 国产精品久久久久影院老司| 成人一区二区三区视频在线观看| 亚洲国产精品天堂| 自拍偷拍国产精品| 久久精品一区二区三区不卡牛牛| 欧美亚洲综合在线| 不卡av在线网| 国产一级精品在线| 麻豆91精品91久久久的内涵| 一区二区在线观看不卡| 国产欧美日产一区| 在线观看精品一区| 成人av手机在线观看| 国产在线精品一区二区夜色| 香蕉久久夜色精品国产使用方法 | 久久久久久麻豆| 日韩天堂在线观看| 3751色影院一区二区三区| 精品亚洲porn| 日韩极品在线观看| 亚洲成人综合在线| 亚洲一区二区在线观看视频| 亚洲欧美乱综合| 91麻豆精品国产自产在线| 99久久精品国产观看| 盗摄精品av一区二区三区| 国产综合色视频| 国内精品写真在线观看| 九色综合狠狠综合久久| 免费人成精品欧美精品| 美女任你摸久久| 久久精品72免费观看| 精品一区二区三区av| 国产在线国偷精品产拍免费yy| 日本中文字幕不卡| 秋霞午夜av一区二区三区| 天天综合日日夜夜精品| 日本va欧美va精品| 久久国产剧场电影| 国产成人激情av| av影院午夜一区| 日本韩国欧美在线| 欧美日韩aaaaaa| 日韩一区二区三免费高清| 欧美大肚乱孕交hd孕妇| 精品动漫一区二区三区在线观看| 国产精品一二三四区| 成人性视频网站| 色悠悠亚洲一区二区| 欧美日韩日日骚| 2023国产精品| 亚洲精品一区二区三区精华液 | 成人欧美一区二区三区在线播放| 国产精品久久久久aaaa| 一区二区三区欧美在线观看| 午夜精品久久久久久久99水蜜桃 | 欧美精品一区二区三区蜜桃视频| 国产亚洲一区二区在线观看| 国产精品免费看片| 午夜亚洲国产au精品一区二区| 久久精品理论片| www.欧美日韩| 3d成人h动漫网站入口| 国产欧美一区二区在线观看| 一区二区三区在线播| 久久成人麻豆午夜电影| 成人性视频网站| 欧美一区二区不卡视频| 国产精品大尺度| 免费在线成人网| 91久久一区二区| 久久久久国产精品人| 亚洲va欧美va人人爽午夜| 国内成人自拍视频| 欧美日韩国产另类不卡| 国产欧美一区二区三区在线老狼| 亚洲一区二区中文在线| 福利电影一区二区三区| 在线播放日韩导航| 亚洲丝袜美腿综合| 精品在线观看免费| 欧美在线一区二区三区| 国产欧美日韩亚州综合| 日本午夜精品一区二区三区电影| 国产69精品一区二区亚洲孕妇| 欧美理论电影在线| 亚洲精品伦理在线| www.日韩精品| 久久这里只有精品6| 丝袜亚洲另类欧美| 在线视频综合导航| 亚洲同性同志一二三专区| 精东粉嫩av免费一区二区三区| 欧美体内she精高潮| 中文字幕一区三区| 国产999精品久久久久久| 欧美一区二区视频免费观看| 亚洲国产一二三| 在线观看欧美黄色| 亚洲激情成人在线| 99re8在线精品视频免费播放| 国产亚洲一区二区在线观看| 激情文学综合网| 日韩欧美一区二区久久婷婷| 日韩二区在线观看| 欧美三级在线看| 亚洲自拍偷拍九九九| 99re热视频精品| 亚洲欧美日韩小说| 91丨九色porny丨蝌蚪| 亚洲欧美在线视频| 一本一本久久a久久精品综合麻豆| 国产精品久久久久一区二区三区共| 国产一区二区三区免费看 | 国产精品亚洲а∨天堂免在线| 日韩欧美一级特黄在线播放|