⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb-ohci-s3c2410.c

📁 基于S3CEB2410平台LINUX操作系统下 USB驱动源代码
💻 C
字号:
/* *  linux/drivers/usb/usb-ohci-s3c2410.c * *  OHCI r1.0 compatible, CPU embedded USB host controller * */#include <linux/module.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/ioport.h>#include <linux/interrupt.h>#include <linux/slab.h>#include <linux/usb.h>#include <linux/pci.h>#include <asm/hardware.h>#include <asm/irq.h>#include <asm/io.h>#define OHCI_HW_DRIVER 1#include "usb-ohci.h"/* * S3C2410 user's guide 俊 乐绰 1厘 楼府 汲疙俊 狼窍搁, * OHCI 龋券捞扼绊 茄促. * * UPLL 汲沥苞 MISC 饭瘤胶磐俊辑 器飘 磷捞绊 混府绊 窍绰 巴阑 哗冈瘤 富 巴. * * 弊府绊, s3c2410 俊辑 USB slave 甫 静妨搁 host 器飘 窍唱甫 磷咯具 茄促绰 巴 * 镭瘤 富 巴. * 窍瘤父, 捞犯霸 秦档 slave 脚龋啊 root hub 率俊 林绰 康氢阑 阜阑 规过捞 绝促. * hub.c 甫 绊媚辑 root hub 捞绊, 1 host port 肺 config 沁阑 版快, * 滴 锅掳 器飘甫 酒抗 媚促档 焊瘤 臼档废 沁栏聪 曼绊且 巴. */int __devinithc_add_ohci(struct pci_dev *dev, int irq, void *membase, unsigned long flags,	    ohci_t **ohci, const char *name, const char *slot_name);extern void hc_remove_ohci(ohci_t *ohci);static ohci_t *s3c2410_ohci;static void __init s3c2410_ohci_configure(void){#if CONFIG_MAX_ROOT_PORTS < 2	/* 1 host port, 1 slave port*/	MISCCR &= ~MISCCR_USBPAD;#if 0 // confused - bushi	/* wakeup port 0 */	MISCCR &= ~MISCCR_USB0_SUSPEND;	/* sleep port 1 */	MISCCR |= MISCCR_USB1_SUSPEND;#endif#else	/* 2 host port */	MISCCR |= MISCCR_USBPAD;#if 0 // confused - bushi	/* wakeup port 0 */	MISCCR &= ~MISCCR_USB0_SUSPEND;	/* wakeup port 1 */	MISCCR &= ~MISCCR_USB1_SUSPEND;#endif#endif	/* UPLLCON */	UPLLCON = FInsrt(0x78, fPLL_MDIV) | FInsrt(0x02, fPLL_PDIV) 		| FInsrt(0x03, fPLL_SDIV);	/* CLKCON */	CLKCON |= CLKCON_USBH;	udelay(11);}static int __init s3c2410_ohci_init(void){	int ret;	s3c2410_ohci_configure();	/*	 * Initialise the generic OHCI driver.	 */	// FIXME : io_p2v() ?	ret = hc_add_ohci((struct pci_dev *)1, IRQ_USBH,			  (void *)(io_p2v(USBHOST_CTL_BASE)), 0, &s3c2410_ohci,			  "usb-ohci", "s3c2410");	return ret;}static void __exit s3c2410_ohci_exit(void){	hc_remove_ohci(s3c2410_ohci);	/*	 * Stop the USB clock.	 */	CLKCON &= ~CLKCON_USBH;}module_init(s3c2410_ohci_init);module_exit(s3c2410_ohci_exit);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -