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

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

?? i2c-adap-ite.c

?? linux下S3C2410的I2C總線的驅動
?? C
字號:
/*   -------------------------------------------------------------------------   i2c-adap-ite.c i2c-hw access for the IIC peripheral on the ITE MIPS system   -------------------------------------------------------------------------   Hai-Pao Fan, MontaVista Software, Inc.   hpfan@mvista.com or source@mvista.com   Copyright 2001 MontaVista Software Inc.   ----------------------------------------------------------------------------   This file was highly leveraged from i2c-elektor.c, which was created   by Simon G. Vogl and Hans Berglund:      Copyright (C) 1995-97 Simon G. Vogl                   1998-99 Hans Berglund    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     *//* ------------------------------------------------------------------------- *//* With some changes from Ky鰏ti M鋖kki <kmalkki@cc.hut.fi> and even   Frodo Looijaard <frodol@dds.nl> */#include <linux/kernel.h>#include <linux/ioport.h>#include <linux/module.h>#include <linux/delay.h>#include <linux/slab.h>#include <linux/version.h>#include <linux/init.h>#include <asm/irq.h>#include <asm/io.h>#include <linux/i2c.h>#include <linux/i2c-algo-ite.h>#include <linux/i2c-adap-ite.h>#include "i2c-ite.h"#define DEFAULT_BASE  0x14014030#define ITE_IIC_IO_SIZE	0x40#define DEFAULT_IRQ   0#define DEFAULT_CLOCK 0x1b0e	/* default 16MHz/(27+14) = 400KHz */#define DEFAULT_OWN   0x55static int base  = 0;static int irq   = 0;static int clock = 0;static int own   = 0;static int i2c_debug=0;static struct iic_ite gpi;#if (LINUX_VERSION_CODE < 0x020301)static struct wait_queue *iic_wait = NULL;#elsestatic wait_queue_head_t iic_wait;#endifstatic int iic_pending;/* ----- global defines -----------------------------------------------	*/#define DEB(x)	if (i2c_debug>=1) x#define DEB2(x) if (i2c_debug>=2) x#define DEB3(x) if (i2c_debug>=3) x#define DEBE(x)	x	/* error messages 				*//* ----- local functions ----------------------------------------------	*/static void iic_ite_setiic(void *data, int ctl, short val){        unsigned long j = jiffies + 10;	DEB3(printk(" Write 0x%02x to 0x%x\n",(unsigned short)val, ctl&0xff));	DEB3({while (jiffies < j) schedule();}) 	outw(val,ctl);}static short iic_ite_getiic(void *data, int ctl){	short val;	val = inw(ctl);	DEB3(printk("Read 0x%02x from 0x%x\n",(unsigned short)val, ctl&0xff));  	return (val);}/* Return our slave address.  This is the address * put on the I2C bus when another master on the bus wants to address us * as a slave */static int iic_ite_getown(void *data){	return (gpi.iic_own);}static int iic_ite_getclock(void *data){	return (gpi.iic_clock);}#if 0static void iic_ite_sleep(unsigned long timeout){	schedule_timeout( timeout * HZ);}#endif/* Put this process to sleep.  We will wake up when the * IIC controller interrupts. */static void iic_ite_waitforpin(void) {   int timeout = 2;   /* If interrupts are enabled (which they are), then put the process to    * sleep.  This process will be awakened by two events -- either the    * the IIC peripheral interrupts or the timeout expires.     * If interrupts are not enabled then delay for a reasonable amount     * of time and return.    */   if (gpi.iic_irq > 0) {	cli();	if (iic_pending == 0) {		interruptible_sleep_on_timeout(&iic_wait, timeout*HZ );	} else		iic_pending = 0;	sti();   } else {      udelay(100);   }}static void iic_ite_handler(int this_irq, void *dev_id, struct pt_regs *regs) {	   iic_pending = 1;   DEB2(printk("iic_ite_handler: in interrupt handler\n"));   wake_up_interruptible(&iic_wait);}/* Lock the region of memory where I/O registers exist.  Request our * interrupt line and register its associated handler. */static int iic_hw_resrc_init(void){  	if (check_region(gpi.iic_base, ITE_IIC_IO_SIZE) < 0 ) {   	   return -ENODEV;  	} else {  	   request_region(gpi.iic_base, ITE_IIC_IO_SIZE, 		"i2c (i2c bus adapter)");  	}	if (gpi.iic_irq > 0) {	   if (request_irq(gpi.iic_irq, iic_ite_handler, 0, "ITE IIC", 0) < 0) {	      gpi.iic_irq = 0;	   } else	      DEB3(printk("Enabled IIC IRQ %d\n", gpi.iic_irq));	      enable_irq(gpi.iic_irq);	}	return 0;}static void iic_ite_release(void){	if (gpi.iic_irq > 0) {		disable_irq(gpi.iic_irq);		free_irq(gpi.iic_irq, 0);	}	release_region(gpi.iic_base , 2);}static int iic_ite_reg(struct i2c_client *client){	return 0;}static int iic_ite_unreg(struct i2c_client *client){	return 0;}static void iic_ite_inc_use(struct i2c_adapter *adap){#ifdef MODULE	MOD_INC_USE_COUNT;#endif}static void iic_ite_dec_use(struct i2c_adapter *adap){#ifdef MODULE	MOD_DEC_USE_COUNT;#endif}/* ------------------------------------------------------------------------ * Encapsulate the above functions in the correct operations structure. * This is only done when more than one hardware adapter is supported. */static struct i2c_algo_iic_data iic_ite_data = {	NULL,	iic_ite_setiic,	iic_ite_getiic,	iic_ite_getown,	iic_ite_getclock,	iic_ite_waitforpin,	80, 80, 100,		/*	waits, timeout */};static struct i2c_adapter iic_ite_ops = {	"ITE IIC adapter",	I2C_HW_I_IIC,	NULL,	&iic_ite_data,	iic_ite_inc_use,	iic_ite_dec_use,	iic_ite_reg,	iic_ite_unreg,};/* Called when the module is loaded.  This function starts the * cascade of calls up through the heirarchy of i2c modules (i.e. up to the *  algorithm layer and into to the core layer) */static int __init iic_ite_init(void) {	struct iic_ite *piic = &gpi;	printk(KERN_INFO "Initialize ITE IIC adapter module\n");	if (base == 0)		piic->iic_base = DEFAULT_BASE;	else		piic->iic_base = base;	if (irq == 0)		piic->iic_irq = DEFAULT_IRQ;	else		piic->iic_irq = irq;	if (clock == 0)		piic->iic_clock = DEFAULT_CLOCK;	else		piic->iic_clock = clock;	if (own == 0)		piic->iic_own = DEFAULT_OWN;	else		piic->iic_own = own;	iic_ite_data.data = (void *)piic;#if (LINUX_VERSION_CODE >= 0x020301)	init_waitqueue_head(&iic_wait);#endif	if (iic_hw_resrc_init() == 0) {		if (i2c_iic_add_bus(&iic_ite_ops) < 0)			return -ENODEV;	} else {		return -ENODEV;	}	printk(KERN_INFO " found device at %#x irq %d.\n", 		piic->iic_base, piic->iic_irq);	return 0;}static void iic_ite_exit(void){	i2c_iic_del_bus(&iic_ite_ops);        iic_ite_release();}EXPORT_NO_SYMBOLS;/* If modules is NOT defined when this file is compiled, then the MODULE_* * macros will resolve to nothing */MODULE_AUTHOR("MontaVista Software <www.mvista.com>");MODULE_DESCRIPTION("I2C-Bus adapter routines for ITE IIC bus adapter");MODULE_LICENSE("GPL");MODULE_PARM(base, "i");MODULE_PARM(irq, "i");MODULE_PARM(clock, "i");MODULE_PARM(own, "i");MODULE_PARM(i2c_debug,"i");/* Called when module is loaded or when kernel is intialized. * If MODULES is defined when this file is compiled, then this function will * resolve to init_module (the function called when insmod is invoked for a * module).  Otherwise, this function is called early in the boot, when the * kernel is intialized.  Check out /include/init.h to see how this works. */module_init(iic_ite_init);/* Resolves to module_cleanup when MODULES is defined. */module_exit(iic_ite_exit); 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色婷婷久久久久合中文| 国产凹凸在线观看一区二区| 欧美日韩成人一区二区| 亚洲欧洲一区二区三区| 精品国产乱码久久| 婷婷开心激情综合| 久久久久久免费网| 日韩三级在线观看| 欧美成人艳星乳罩| 久久婷婷综合激情| 欧美韩国日本综合| 国产精品传媒视频| 亚洲一区二区三区四区中文字幕 | 精品成a人在线观看| 69堂国产成人免费视频| 精品三级在线观看| 中文字幕av一区 二区| 国产精品久久久久久久久动漫 | 欧美日韩dvd在线观看| 欧美视频一区二区三区四区| 欧美群妇大交群中文字幕| 日韩一级片在线播放| 久久久噜噜噜久久人人看 | 一区二区三区中文在线观看| 亚洲成人动漫av| 久久国产精品99精品国产| 成人美女视频在线观看18| 91黄色免费看| 精品国产区一区| 日韩久久一区二区| 麻豆91在线看| av一区二区三区黑人| 欧美日本一道本在线视频| 精品国产电影一区二区| 亚洲色图欧洲色图| 久久av资源站| 日本高清无吗v一区| 日韩欧美激情在线| 亚洲欧美视频在线观看| 久久99热这里只有精品| 91成人在线免费观看| 久久综合狠狠综合| 亚洲图片欧美视频| 成人做爰69片免费看网站| 欧美日韩成人在线一区| 国产精品九色蝌蚪自拍| 老司机午夜精品| 欧美无砖砖区免费| 中文字幕一区二区三区四区 | 成人少妇影院yyyy| 欧美一区二区三区在线观看| 欧美国产日产图区| 精品一区二区免费在线观看| 欧美最猛黑人xxxxx猛交| 国产精品久久久一本精品| 精品一二三四在线| 欧美精三区欧美精三区| 亚洲视频在线观看一区| 国产成人综合亚洲网站| 精品奇米国产一区二区三区| 国产精品第13页| 成人性生交大片免费看视频在线 | 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 青青草97国产精品免费观看无弹窗版| 91影视在线播放| 亚洲色图另类专区| 91色porny| 中文字幕在线不卡一区| 成人av集中营| 国产精品萝li| youjizz国产精品| 国产精品免费视频网站| 国产成人精品一区二区三区四区 | 国产一区在线看| www国产成人| 国产成人综合在线观看| 精品乱人伦小说| 精品一区二区三区在线观看| 日韩丝袜情趣美女图片| 九九久久精品视频| 久久久久久久久久久久久久久99| 六月丁香综合在线视频| 精品福利一二区| 国产高清精品久久久久| 亚洲欧美自拍偷拍| 色吧成人激情小说| 亚洲成人精品一区二区| 日韩一卡二卡三卡四卡| 国内外成人在线| 国产日韩精品一区二区三区 | 秋霞午夜av一区二区三区| 欧美日本视频在线| 麻豆精品新av中文字幕| 久久久99久久| 91免费小视频| 婷婷一区二区三区| 亚洲精品自拍动漫在线| 欧美色偷偷大香| 韩国毛片一区二区三区| 日本一区二区三区在线不卡| 91老师片黄在线观看| 午夜久久久影院| 久久综合久久综合久久| 成人av影视在线观看| 亚洲国产视频一区| 精品欧美一区二区久久| www.日韩精品| 日韩一区精品视频| 中文字幕va一区二区三区| 欧美日韩免费在线视频| 国产一区二区三区免费观看| 一个色综合av| 久久精品夜夜夜夜久久| 欧美性猛片xxxx免费看久爱| 九九九精品视频| 亚洲精品videosex极品| 日韩精品最新网址| 在线亚洲欧美专区二区| 国产伦精品一区二区三区免费迷| 亚洲日本青草视频在线怡红院| 91精品国产一区二区三区| jizzjizzjizz欧美| 毛片基地黄久久久久久天堂| 亚洲精品乱码久久久久久黑人| 日韩视频不卡中文| 91精品办公室少妇高潮对白| 国产一区二区三区久久悠悠色av| 成人av高清在线| 国产一区视频在线看| 婷婷丁香激情综合| 国产精品成人免费在线| 精品不卡在线视频| 欧美久久久久久蜜桃| 色婷婷国产精品综合在线观看| 精品一区二区三区的国产在线播放| 亚洲欧美一区二区三区久本道91| 久久男人中文字幕资源站| 制服丝袜在线91| 欧美最新大片在线看| 一本色道久久加勒比精品| 高清免费成人av| 国产老肥熟一区二区三区| 免费成人在线播放| 偷拍亚洲欧洲综合| 亚洲国产视频在线| 亚洲最大成人综合| 亚洲天堂免费在线观看视频| 国产精品网站一区| 欧美国产激情一区二区三区蜜月| 日韩欧美成人激情| 日韩三级高清在线| 欧美一区二区三区免费视频| 91在线视频18| 色哟哟亚洲精品| 91精彩视频在线观看| 99精品久久只有精品| av在线播放不卡| 色综合中文字幕国产 | 久久精品日韩一区二区三区| 日韩免费看的电影| 日韩视频一区二区| 日本成人在线一区| 亚洲国产精品影院| 亚洲18色成人| 精品亚洲porn| 国产成人精品午夜视频免费| 国产精品综合二区| 成人av在线网站| 99精品1区2区| 欧美老肥妇做.爰bbww视频| 91.xcao| 精品国产一区二区三区久久久蜜月| 337p日本欧洲亚洲大胆精品| 欧美国产一区二区| 亚洲图片欧美激情| 日日骚欧美日韩| 国产福利一区在线观看| 色婷婷久久99综合精品jk白丝 | 精品久久久久一区| 国产亚洲欧美一级| 亚洲欧美国产高清| 七七婷婷婷婷精品国产| 国产成人av电影在线播放| 99久久亚洲一区二区三区青草| 欧美优质美女网站| 欧美二区三区91| 国产欧美中文在线| 国内成+人亚洲+欧美+综合在线| 国产一区二区在线视频| 93久久精品日日躁夜夜躁欧美| 欧美日韩免费电影| 国产丝袜在线精品| 亚洲第一电影网| 成人h动漫精品一区二| 6080国产精品一区二区| 亚洲国产精华液网站w| 日日夜夜免费精品视频| k8久久久一区二区三区| 日韩美女一区二区三区四区| 亚洲三级免费观看|