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

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

?? ohci-s3c2410.c

?? LINUX下面的USB主機控制器驅動源代碼,是標準的,大家可以進行相應的修改來達到自己的功能!
?? 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>#define valid_port(idx) ((idx) == 1 || (idx) == 2)/* clock device associated with the hcd */static struct clk *clk;/* forward definitions */static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);/* conversion functions */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(clk);	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);}/* 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 capabilites	 * 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. **/void usb_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. * */int usb_hcd_s3c2410_probe (const struct hc_driver *driver,			   struct platform_device *dev){	struct usb_hcd *hcd = NULL;	int retval;	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 err0;	}	clk = clk_get(NULL, "usb-host");	if (IS_ERR(clk)) {		dev_err(&dev->dev, "cannot get usb-host clock\n");		retval = -ENOENT;		goto err1;	}	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 err2;	}	ohci_hcd_init(hcd_to_ohci(hcd));	retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);	if (retval != 0)		goto err2;	return 0; err2:	s3c2410_stop_hc(dev);	iounmap(hcd->regs);	clk_put(clk); err1:	release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err0:	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,	/*	 * 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,#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,	/*.suspend	= ohci_hcd_s3c2410_drv_suspend, */	/*.resume	= ohci_hcd_s3c2410_drv_resume, */	.driver		= {		.owner	= THIS_MODULE,		.name	= "s3c2410-ohci",	},};static int __init ohci_hcd_s3c2410_init (void){	return platform_driver_register(&ohci_hcd_s3c2410_driver);}static void __exit ohci_hcd_s3c2410_cleanup (void){	platform_driver_unregister(&ohci_hcd_s3c2410_driver);}module_init (ohci_hcd_s3c2410_init);module_exit (ohci_hcd_s3c2410_cleanup);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文av字幕一区| 中文一区在线播放| 久久久精品免费免费| 成人免费小视频| 久久精品国产精品亚洲综合| 色婷婷亚洲精品| 久久精品夜夜夜夜久久| 日韩vs国产vs欧美| 91丨porny丨蝌蚪视频| 久久综合色婷婷| 日本欧美肥老太交大片| 91免费看`日韩一区二区| xvideos.蜜桃一区二区| 日韩在线卡一卡二| 欧美午夜电影一区| 一区二区三区在线观看欧美| 国产成人午夜高潮毛片| 日韩欧美国产系列| 亚洲午夜一区二区| 日本电影欧美片| 国产精品久久久久久妇女6080| 久久av资源站| 日韩欧美一区在线观看| 日本中文在线一区| 欧美日韩国产a| 午夜精品免费在线| 91福利社在线观看| 一区二区三区四区视频精品免费 | 一区二区三区国产精华| 欧美唯美清纯偷拍| 亚洲六月丁香色婷婷综合久久| 成人精品国产免费网站| 国产精品视频九色porn| 成人免费视频国产在线观看| 久久久久久久综合日本| 韩国三级在线一区| 国产亚洲精品bt天堂精选| 国产精品综合二区| 欧美韩国一区二区| 不卡一区二区在线| 亚洲欧美日韩中文播放| 色欧美片视频在线观看| 亚洲国产日产av| 884aa四虎影成人精品一区| 日韩精品亚洲专区| 欧美电影免费观看高清完整版在 | 国产美女在线精品| 欧美韩日一区二区三区四区| 成人国产亚洲欧美成人综合网| 国产精品久久看| 色狠狠综合天天综合综合| 亚洲成人av电影在线| 日韩一级欧美一级| 国产福利一区二区三区视频| 国产精品久久久久久久久免费桃花| 不卡一区中文字幕| 亚洲成av人**亚洲成av**| 欧美一区二区免费| 成人综合激情网| 亚洲免费在线看| 制服丝袜中文字幕亚洲| 国产一区二区在线观看免费| 国产精品国产三级国产三级人妇 | 91亚洲午夜精品久久久久久| 亚洲国产综合在线| 久久综合999| 91麻豆成人久久精品二区三区| 亚洲h在线观看| 久久久亚洲精品石原莉奈| 色94色欧美sute亚洲线路一久| 丝袜美腿一区二区三区| 精品久久久久久久久久久久久久久久久 | 综合在线观看色| 91丨porny丨首页| 蜜臀av一级做a爰片久久| 亚洲一区二三区| 精品国产免费一区二区三区香蕉| 99久久久久久99| 日韩av电影免费观看高清完整版 | 国产成人99久久亚洲综合精品| 91久久久免费一区二区| 久久精品国产亚洲高清剧情介绍| 欧美国产日韩亚洲一区| 欧美日韩高清不卡| 成人av高清在线| 久久国产视频网| 一区二区三区在线视频观看| 精品成a人在线观看| 色婷婷国产精品| 国产精品一级二级三级| 亚洲第一福利一区| 亚洲欧美综合另类在线卡通| 日韩精品资源二区在线| 欧美三区在线视频| 成+人+亚洲+综合天堂| 激情综合网av| 视频一区欧美精品| 亚洲猫色日本管| 国产精品福利一区| 久久你懂得1024| 欧美一区二区三区在线视频| 欧美亚洲国产一区二区三区va| www.日韩在线| 成人一级黄色片| 国产精品456露脸| 国产一区欧美一区| 九色综合国产一区二区三区| 日本vs亚洲vs韩国一区三区二区| 亚洲一区在线观看视频| 一区二区三区四区在线| 一区二区三区精品在线| 亚洲精品中文字幕乱码三区| 国产精品青草久久| 国产精品久久久久影视| 中文字幕欧美日韩一区| 秋霞成人午夜伦在线观看| 日韩黄色一级片| 日韩电影免费在线观看网站| 亚洲国产成人av好男人在线观看| 一区二区成人在线观看| 亚洲一级二级三级| 亚洲成人精品影院| 日韩制服丝袜av| 久久99国内精品| 国产一区二区三区四区五区入口 | 欧美日韩国产综合久久| 欧美日韩视频在线观看一区二区三区| 欧美在线小视频| 欧美日产在线观看| 日韩精品一区国产麻豆| 国产亚洲制服色| 中文字幕亚洲一区二区av在线| 亚洲视频一二三| 亚洲国产精品综合小说图片区| 日韩电影网1区2区| 国产精品18久久久久久久久久久久| 成人久久18免费网站麻豆| 91免费观看视频| 在线电影一区二区三区| 亚洲精品一区二区三区蜜桃下载| 国产精品美女久久久久久2018 | 无码av中文一区二区三区桃花岛| 99re成人在线| 欧美日韩精品欧美日韩精品| 欧美一区二区私人影院日本| 久久色中文字幕| 一区二区三区欧美久久| 免费看欧美女人艹b| 懂色av中文一区二区三区| 91在线免费视频观看| 91精品在线观看入口| 日本一区二区视频在线| 亚洲国产综合色| 国产精品一区二区久久精品爱涩 | 亚洲国产精品精华液ab| 一区二区成人在线| 国内成人免费视频| 欧美影院午夜播放| 久久久精品国产99久久精品芒果 | 99re6这里只有精品视频在线观看| 欧美日韩综合不卡| 国产欧美一区二区精品婷婷 | 久久成人麻豆午夜电影| 色综合天天做天天爱| 日韩免费在线观看| 亚洲免费高清视频在线| 国产永久精品大片wwwapp| 欧洲生活片亚洲生活在线观看| 久久精品亚洲乱码伦伦中文| 天天色 色综合| 91色综合久久久久婷婷| 久久久亚洲午夜电影| 视频一区在线播放| 91免费在线看| 国产精品久久久一本精品| 久久精品国产亚洲一区二区三区| 在线观看免费一区| 国产精品久久久久久亚洲伦 | 久久欧美一区二区| 亚洲成人久久影院| 91免费精品国自产拍在线不卡| ww久久中文字幕| 另类人妖一区二区av| 欧美日韩久久不卡| 亚洲精品写真福利| 97aⅴ精品视频一二三区| 国产亚洲短视频| 国产在线不卡一区| 欧美本精品男人aⅴ天堂| 亚洲电影视频在线| 欧美在线一区二区| 亚洲自拍另类综合| 色综合久久久久综合99| 中文字幕一区三区| av网站免费线看精品| 国产精品久久久久久久午夜片| 国产乱妇无码大片在线观看| 久久只精品国产| 欧美日韩另类一区| 亚洲va国产va欧美va观看|