Changeset 3433
- Timestamp:
- 01/19/00 00:02:53 (13 years ago)
- Location:
- i2c/trunk
- Files:
-
- 9 modified
-
INSTALL (modified) (1 diff)
-
kernel/i2c-algo-bit.c (modified) (3 diffs)
-
kernel/i2c-algo-pcf.c (modified) (3 diffs)
-
kernel/i2c-core.c (modified) (14 diffs)
-
kernel/i2c-dev.c (modified) (11 diffs)
-
kernel/i2c-elektor.c (modified) (3 diffs)
-
kernel/i2c-elv.c (modified) (1 diff)
-
kernel/i2c-philips-par.c (modified) (1 diff)
-
kernel/i2c-velleman.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
i2c/trunk/INSTALL
r3383 r3433 18 18 either method 1 or 3; method 2 is less well maintained. 19 19 20 NOTE: OPTION 3 WILL CURRENTLY NOT WORK FOR 2.0 AND OLDER 2.1 KERNELS!20 NOTE: SUPPORT FOR 2.0 AND 2.1 KERNELS HAS BEEN DROPPED! 21 21 22 22 -
i2c/trunk/kernel/i2c-algo-bit.c
r3430 r3433 29 29 #include <linux/malloc.h> 30 30 #include <linux/version.h> 31 #if LINUX_VERSION_CODE >= 0x02013532 31 #include <linux/init.h> 33 #else 34 #define __init 35 #endif 36 37 #if LINUX_VERSION_CODE >= 0x020100 38 # include <asm/uaccess.h> 39 #else 40 # include <asm/segment.h> 41 #endif 42 43 /* 2.0.0 kernel compatibility */ 44 #if LINUX_VERSION_CODE < 0x020100 45 #define MODULE_AUTHOR(noone) 46 #define MODULE_DESCRIPTION(none) 47 #define MODULE_PARM(no,param) 48 #define MODULE_PARM_DESC(no,description) 49 #define EXPORT_SYMBOL(noexport) 50 #define EXPORT_NO_SYMBOLS 51 #endif 52 32 #include <asm/uaccess.h> 53 33 #include <linux/ioport.h> 54 34 #include <linux/errno.h> … … 70 50 /* might not like this, as they have an internal timeout of some mils */ 71 51 /* 72 #if LINUX_VERSION_CODE >= 0x02016e73 52 #define SLO_IO jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\ 74 53 if (need_resched) schedule(); 75 #else76 #define SLO_IO jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\77 if (need_resched) schedule();78 #endif79 54 */ 80 55 … … 146 121 return -ETIMEDOUT; 147 122 } 148 #if LINUX_VERSION_CODE >= 0x02016e149 123 if (current->need_resched) 150 124 schedule(); 151 #else152 if (need_resched)153 schedule();154 #endif155 125 } 156 126 DEBSTAT(printk("needed %ld jiffies\n", jiffies-start)); -
i2c/trunk/kernel/i2c-algo-pcf.c
r3430 r3433 31 31 #include <linux/malloc.h> 32 32 #include <linux/version.h> 33 #if LINUX_VERSION_CODE >= 0x02013534 33 #include <linux/init.h> 35 #else 36 #define __init 37 #endif 38 39 #if LINUX_VERSION_CODE >= 0x020100 40 # include <asm/uaccess.h> 41 #else 42 # include <asm/segment.h> 43 #endif 44 45 34 #include <asm/uaccess.h> 46 35 #include <linux/ioport.h> 47 36 #include <linux/errno.h> 48 37 #include <linux/sched.h> 49 50 /* 2.0.0 kernel compatibility */51 #if LINUX_VERSION_CODE < 0x02010052 #define MODULE_AUTHOR(noone)53 #define MODULE_DESCRIPTION(none)54 #define MODULE_PARM(no,param)55 #define MODULE_PARM_DESC(no,description)56 #define EXPORT_SYMBOL(noexport)57 #define EXPORT_NO_SYMBOLS58 #endif59 38 60 39 #include "i2c.h" … … 75 54 /* might not like this, as they have an internal timeout of some mils */ 76 55 /* 77 #if LINUX_VERSION_CODE >= 0x02016e78 56 #define SLO_IO jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\ 79 57 if (need_resched) schedule(); 80 #else81 #define SLO_IO jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\82 if (need_resched) schedule();83 #endif84 58 */ 85 59 … … 108 82 109 83 /* --- other auxiliary functions -------------------------------------- */ 110 111 #if LINUX_VERSION_CODE < 0x02017f112 static void schedule_timeout(int j)113 {114 current->state = TASK_INTERRUPTIBLE;115 current->timeout = jiffies + j;116 schedule();117 }118 #endif119 120 84 121 85 static void i2c_start(struct i2c_algo_pcf_data *adap) -
i2c/trunk/kernel/i2c-core.c
r3421 r3433 34 34 /* ----- compatibility stuff ----------------------------------------------- */ 35 35 36 /* 2.0.0 kernel compatibility */37 #if LINUX_VERSION_CODE < 0x02010038 #define MODULE_AUTHOR(noone)39 #define MODULE_DESCRIPTION(none)40 #define MODULE_PARM(no,param)41 #define MODULE_PARM_DESC(no,description)42 #define EXPORT_SYMBOL(noexport)43 #define EXPORT_NO_SYMBOLS44 #endif45 46 36 #include <linux/version.h> 47 #ifndef KERNEL_VERSION48 #define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))49 #endif50 51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)52 37 #include <linux/init.h> 53 #else54 #define __init55 #endif56 38 57 39 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) … … 59 41 #endif 60 42 61 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,4))62 #define copy_from_user memcpy_fromfs63 #define copy_to_user memcpy_tofs64 #else65 43 #include <asm/uaccess.h> 66 #endif67 44 68 45 /* ----- global defines ---------------------------------------------------- */ … … 105 82 */ 106 83 107 /* Note that quite some things changed within the 2.1 kernel series.108 Some things below are somewhat difficult to read because of this. */109 110 84 #ifdef CONFIG_PROC_FS 111 85 … … 113 87 static int i2cproc_cleanup(void); 114 88 115 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) && \ 116 (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27)) 89 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27)) 117 90 static void monitor_bus_i2c(struct inode *inode, int fill); 118 91 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 119 120 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))121 92 122 93 static ssize_t i2cproc_bus_read(struct file * file, char * buf,size_t count, … … 124 95 static int read_bus_i2c(char *buf, char **start, off_t offset, int len, 125 96 int *eof , void *private); 126 127 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */128 129 static int i2cproc_bus_read(struct inode * inode, struct file * file,130 char * buf, int count);131 static int read_bus_i2c(char *buf, char **start, off_t offset, int len,132 int unused);133 134 static struct proc_dir_entry proc_bus_dir =135 {136 /* low_ino */ 0, /* Set by proc_register_dynamic */137 /* namelen */ 3,138 /* name */ "bus",139 /* mode */ S_IRUGO | S_IXUGO | S_IFDIR,140 /* nlink */ 2, /* Corrected by proc_register[_dynamic] */141 /* uid */ 0,142 /* gid */ 0,143 /* size */ 0,144 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36))145 /* ops */ &proc_dir_inode_operations,146 #endif147 };148 149 static struct proc_dir_entry proc_bus_i2c_dir =150 {151 /* low_ino */ 0, /* Set by proc_register_dynamic */152 /* namelen */ 3,153 /* name */ "i2c",154 /* mode */ S_IRUGO | S_IFREG,155 /* nlink */ 1,156 /* uid */ 0,157 /* gid */ 0,158 /* size */ 0,159 /* ops */ NULL,160 /* get_info */ &read_bus_i2c161 };162 163 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */164 97 165 98 /* To implement the dynamic /proc/bus/i2c-? files, we need our own … … 223 156 char name[8]; 224 157 struct proc_dir_entry *proc_entry; 225 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29))226 int res;227 #endif228 158 229 159 sprintf(name,"i2c-%d", i); 230 160 231 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))232 161 proc_entry = create_proc_entry(name,0,proc_bus); 233 162 if (! proc_entry) { … … 239 168 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) 240 169 proc_entry->owner = THIS_MODULE; 241 #el if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))170 #else 242 171 proc_entry->fill_inode = &monitor_bus_i2c; 243 172 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 244 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */245 adap->proc_entry = NULL;246 if (!(proc_entry = kmalloc(sizeof(struct proc_dir_entry)+247 strlen(name)+1, GFP_KERNEL))) {248 printk("i2c-core.o: Out of memory!\n");249 return -ENOMEM;250 }251 memset(proc_entry,0,sizeof(struct proc_dir_entry));252 proc_entry->namelen = strlen(name);253 proc_entry->name = (char *) (proc_entry + 1);254 proc_entry->mode = S_IRUGO | S_IFREG;255 proc_entry->nlink = 1;256 proc_entry->ops = &i2cproc_inode_operations;257 258 /* Nasty stuff to keep GCC satisfied */259 {260 char *procname;261 (const char *) procname = proc_entry->name;262 strcpy (procname,name);263 }264 265 if ((res = proc_register_dynamic(&proc_bus_dir, proc_entry))) {266 printk("i2c-core.o: Could not create %s.\n",name);267 kfree(proc_entry);268 return res;269 }270 271 adap->proc_entry = proc_entry;272 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */273 274 173 adap->inode = proc_entry->low_ino; 275 174 } … … 307 206 #ifdef CONFIG_PROC_FS 308 207 if (i2cproc_initialized) { 309 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))310 208 char name[8]; 311 209 sprintf(name,"i2c-%d", i); 312 210 remove_proc_entry(name,proc_bus); 313 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */314 int res;315 if (adapters[i]->proc_entry) {316 if ((res = proc_unregister(&proc_bus_dir,317 adapters[i]->proc_entry->low_ino))) {318 printk("i2c-core.o: Deregistration of /proc "319 "entry failed\n");320 ADAP_UNLOCK();321 return res;322 }323 kfree(adapters[i]->proc_entry);324 }325 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */326 211 } 327 212 #endif /* def CONFIG_PROC_FS */ … … 544 429 #ifdef CONFIG_PROC_FS 545 430 546 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) && \ 547 (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27)) 431 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27)) 548 432 /* Monitor access to /proc/bus/i2c*; make unloading i2c-proc impossible 549 433 if some process still uses it or some file in it */ … … 555 439 MOD_DEC_USE_COUNT; 556 440 } 557 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */441 #endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,37)) */ 558 442 559 443 /* This function generates the output for /proc/bus/i2c */ 560 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))561 444 int read_bus_i2c(char *buf, char **start, off_t offset, int len, int *eof, 562 445 void *private) 563 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */564 int read_bus_i2c(char *buf, char **start, off_t offset, int len, int unused)565 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */566 446 { 567 447 int i; … … 588 468 589 469 /* This function generates the output for /proc/bus/i2c-? */ 590 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))591 470 ssize_t i2cproc_bus_read(struct file * file, char * buf,size_t count, 592 471 loff_t *ppos) 593 472 { 594 473 struct inode * inode = file->f_dentry->d_inode; 595 #else (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29))596 int i2cproc_bus_read(struct inode * inode, struct file * file,char * buf,597 int count)598 {599 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))600 474 char *kbuf; 601 475 struct i2c_client *client; … … 635 509 { 636 510 637 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))638 511 struct proc_dir_entry *proc_bus_i2c; 639 #else640 int res;641 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */642 512 643 513 i2cproc_initialized = 0; 644 514 645 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))646 515 if (! proc_bus) { 647 516 printk("i2c-core.o: /proc/bus/ does not exist"); … … 658 527 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) 659 528 proc_bus_i2c->owner = THIS_MODULE; 660 #el if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))529 #else 661 530 proc_bus_i2c->fill_inode = &monitor_bus_i2c; 662 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1,29)) */531 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) */ 663 532 i2cproc_initialized += 2; 664 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */665 /* In Linux 2.0.x, there is no /proc/bus! But I hope no other module666 introduced it, or we are fucked. And 2.0.35 and earlier does not667 export proc_dir_inode_operations, so we grab it from proc_net,668 which also uses it. Not nice. */669 proc_bus_dir.ops = proc_net.ops;670 if ((res = proc_register_dynamic(&proc_root, &proc_bus_dir))) {671 printk("i2c-core.o: Could not create /proc/bus/");672 i2cproc_cleanup();673 return res;674 }675 i2cproc_initialized ++;676 if ((res = proc_register_dynamic(&proc_bus_dir, &proc_bus_i2c_dir))) {677 printk("i2c-core.o: Could not create /proc/bus/i2c\n");678 i2cproc_cleanup();679 return res;680 }681 i2cproc_initialized ++;682 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */683 533 return 0; 684 534 } … … 688 538 689 539 if (i2cproc_initialized >= 1) { 690 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29))691 540 remove_proc_entry("i2c",proc_bus); 692 541 i2cproc_initialized -= 2; 693 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */694 int res;695 if (i2cproc_initialized >= 2) {696 if ((res = proc_unregister(&proc_bus_dir,697 proc_bus_i2c_dir.low_ino))) {698 printk("i2c-core.o: could not delete "699 "/proc/bus/i2c, module not removed.");700 return res;701 }702 i2cproc_initialized --;703 }704 if ((res = proc_unregister(&proc_root,proc_bus_dir.low_ino))) {705 printk("i2c-core.o: could not delete /proc/bus/, "706 "module not removed.");707 return res;708 }709 i2cproc_initialized --;710 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */711 542 } 712 543 return 0; -
i2c/trunk/kernel/i2c-dev.c
r3421 r3433 35 35 /* #define DEBUG */ 36 36 37 #ifndef KERNEL_VERSION38 #define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))39 #endif40 41 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,51)42 37 #include <linux/init.h> 43 #else44 #define __init45 #endif46 47 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,4))48 #define copy_from_user memcpy_fromfs49 #define copy_to_user memcpy_tofs50 #define get_user_data(to,from) ((to) = get_user(from),0)51 #else52 38 #include <asm/uaccess.h> 53 #define get_user_data(to,from) get_user(to,from)54 #endif55 56 /* 2.0.0 kernel compatibility */57 #if LINUX_VERSION_CODE < 0x02010058 #define MODULE_AUTHOR(noone)59 #define MODULE_DESCRIPTION(none)60 #define MODULE_PARM(no,param)61 #define MODULE_PARM_DESC(no,description)62 #define EXPORT_SYMBOL(noexport)63 #define EXPORT_NO_SYMBOLS64 #endif65 39 66 40 #include "i2c.h" … … 74 48 /* struct file_operations changed too often in the 2.1 series for nice code */ 75 49 76 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))77 50 static loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin); 78 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,56)) 79 static long long i2cdev_lseek (struct file *file, long long offset, int origin); 80 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)) 81 static long long i2cdev_llseek (struct inode *inode, struct file *file, 82 long long offset, int origin); 83 #else 84 static int i2cdev_lseek (struct inode *inode, struct file *file, off_t offset, 85 int origin); 86 #endif 87 88 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70)) 51 89 52 static ssize_t i2cdev_read (struct file *file, char *buf, size_t count, 90 53 loff_t *offset); 91 54 static ssize_t i2cdev_write (struct file *file, const char *buf, size_t count, 92 55 loff_t *offset); 93 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0))94 static long i2cdev_read (struct inode *inode, struct file *file, char *buf,95 unsigned long count);96 static long i2cdev_write (struct inode *inode, struct file *file,97 const char *buf, unsigned long offset);98 #else99 static int i2cdev_read(struct inode *inode, struct file *file, char *buf,100 int count);101 static int i2cdev_write(struct inode *inode, struct file *file,102 const char *buf, int count);103 #endif104 56 105 57 static int i2cdev_ioctl (struct inode *inode, struct file *file, … … 107 59 static int i2cdev_open (struct inode *inode, struct file *file); 108 60 109 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,31))110 61 static int i2cdev_release (struct inode *inode, struct file *file); 111 #else112 static void i2cdev_release (struct inode *inode, struct file *file);113 #endif114 115 62 116 63 static int i2cdev_attach_adapter(struct i2c_adapter *adap); … … 136 83 NULL, /* i2cdev_mmap */ 137 84 i2cdev_open, 138 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,118)139 85 NULL, /* i2cdev_flush */ 140 #endif141 86 i2cdev_release, 142 87 }; … … 170 115 /* Note that the lseek function is called llseek in 2.1 kernels. But things 171 116 are complicated enough as is. */ 172 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))173 117 loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin) 174 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,56)) 175 long long i2cdev_lseek (struct file *file, long long offset, int origin) 176 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)) 177 long long i2cdev_llseek (struct inode *inode, struct file *file, 178 long long offset, int origin) 179 #else 180 int i2cdev_lseek (struct inode *inode, struct file *file, off_t offset, 181 int origin) 182 #endif 183 { 184 #ifdef DEBUG 185 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,56)) 118 { 119 #ifdef DEBUG 186 120 struct inode *inode = file->f_dentry->d_inode; 187 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70)) */188 121 printk("i2c-dev,o: i2c-%d lseek to %ld bytes relative to %d.\n", 189 122 MINOR(inode->i_rdev),(long) offset,origin); … … 192 125 } 193 126 194 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))195 127 static ssize_t i2cdev_read (struct file *file, char *buf, size_t count, 196 128 loff_t *offset) 197 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0))198 static long i2cdev_read (struct inode *inode, struct file *file, char *buf,199 unsigned long count)200 #else201 static int i2cdev_read(struct inode *inode, struct file *file, char *buf,202 int count)203 #endif204 129 { 205 130 char *tmp; … … 207 132 208 133 #ifdef DEBUG 209 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))210 134 struct inode *inode = file->f_dentry->d_inode; 211 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70)) */212 135 #endif /* DEBUG */ 213 136 … … 229 152 } 230 153 231 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))232 154 static ssize_t i2cdev_write (struct file *file, const char *buf, size_t count, 233 155 loff_t *offset) 234 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0))235 static long i2cdev_write (struct inode *inode, struct file *file,236 const char *buf, unsigned long offset)237 #else238 static int i2cdev_write(struct inode *inode, struct file *file,239 const char *buf, int count)240 #endif241 156 { 242 157 int ret; … … 245 160 246 161 #ifdef DEBUG 247 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70))248 162 struct inode *inode = file->f_dentry->d_inode; 249 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70)) */250 163 #endif /* DEBUG */ 251 164 … … 436 349 } 437 350 438 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,31))439 351 static int i2cdev_release (struct inode *inode, struct file *file) 440 #else441 static void i2cdev_release (struct inode *inode, struct file *file)442 #endif443 352 { 444 353 unsigned int minor = MINOR(inode->i_rdev); … … 450 359 MOD_DEC_USE_COUNT; 451 360 i2cdev_adaps[minor]->dec_use(i2cdev_adaps[minor]); 452 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,31))453 361 return 0; 454 #endif455 362 } 456 363 -
i2c/trunk/kernel/i2c-elektor.c
r3421 r3433 31 31 #include <linux/malloc.h> 32 32 #include <linux/version.h> 33 #if LINUX_VERSION_CODE >= 0x02013534 33 #include <linux/init.h> 35 #else36 #define __init37 #endif38 34 #include <asm/irq.h> 39 35 #include <asm/io.h> 40 41 /* 2.0.0 kernel compatibility */42 #if LINUX_VERSION_CODE < 0x02010043 #define MODULE_AUTHOR(noone)44 #define MODULE_DESCRIPTION(none)45 #define MODULE_PARM(no,param)46 #define MODULE_PARM_DESC(no,description)47 #define EXPORT_SYMBOL(noexport)48 #define EXPORT_NO_SYMBOLS49 #endif50 36 51 37 #include "i2c.h" … … 129 115 130 116 131 #if LINUX_VERSION_CODE < 0x02017f132 static void schedule_timeout(int j)133 {134 current->state = TASK_INTERRUPTIBLE;135 current->timeout = jiffies + j;136 schedule();137 }138 #endif139 140 117 #if 0 141 118 static void pcf_isa_sleep(unsigned long timeout) … … 153 130 cli(); 154 131 if (pcf_pending == 0) { 155 #if LINUX_VERSION_CODE < 0x02017f156 current->timeout = jiffies + timeout * HZ;157 interruptible_sleep_on(&pcf_wait);158 #else159 132 interruptible_sleep_on_timeout(&pcf_wait, timeout*HZ ); 160 #endif161 133 } 162 134 else 163 135 pcf_pending = 0; 164 136 sti(); 165 #if LINUX_VERSION_CODE < 0x02017f166 current->timeout = 0;167 #endif168 137 } 169 138 else { -
i2c/trunk/kernel/i2c-elv.c
r3430 r3433 29 29 #include <linux/malloc.h> 30 30 #include <linux/version.h> 31 #if LINUX_VERSION_CODE >= 0x02013532 31 #include <linux/init.h> 33 #else 34 #define __init 35 #endif 36 37 /* 2.0.0 kernel compatibility */ 38 #if LINUX_VERSION_CODE < 0x020100 39 #define MODULE_AUTHOR(noone) 40 #define MODULE_DESCRIPTION(none) 41 #define MODULE_PARM(no,param) 42 #define MODULE_PARM_DESC(no,description) 43 #define EXPORT_SYMBOL(noexport) 44 #define EXPORT_NO_SYMBOLS 45 #endif 46 47 #if LINUX_VERSION_CODE >= 0x020100 48 # include <asm/uaccess.h> 49 #else 50 # include <asm/segment.h> 51 #endif 32 33 #include <asm/uaccess.h> 52 34 53 35 #include <linux/ioport.h> -
i2c/trunk/kernel/i2c-philips-par.c
r3430 r3433 27 27 #include <linux/ioport.h> 28 28 #include <linux/module.h> 29 #if LINUX_VERSION_CODE >= 0x02013530 29 #include <linux/init.h> 31 #else32 #define __init33 #endif34 30 #include <asm/io.h> 35 31 #include <linux/stddef.h> 36 37 /* 2.0.0 kernel compatibility */38 #if LINUX_VERSION_CODE < 0x02010039 #define MODULE_AUTHOR(noone)40 #define MODULE_DESCRIPTION(none)41 #define MODULE_PARM(no,param)42 #define MODULE_PARM_DESC(no,description)43 #define EXPORT_SYMBOL(noexport)44 #define EXPORT_NO_SYMBOLS45 #endif46 32 47 33 #include "i2c.h" -
i2c/trunk/kernel/i2c-velleman.c
r3430 r3433 24 24 #include <linux/ioport.h> 25 25 #include <linux/module.h> 26 #if LINUX_VERSION_CODE >= 0x02013527 26 #include <linux/init.h> 28 #else29 #define __init30 #endif31 27 #include <linux/string.h> /* for 2.0 kernels to get NULL */ 32 28 #include <asm/errno.h> /* for 2.0 kernels to get ENODEV */ 33 29 #include <asm/io.h> 34 35 /* 2.0.0 kernel compatibility */36 #if LINUX_VERSION_CODE < 0x02010037 #define MODULE_AUTHOR(noone)38 #define MODULE_DESCRIPTION(none)39 #define MODULE_PARM(no,param)40 #define MODULE_PARM_DESC(no,description)41 #define EXPORT_SYMBOL(noexport)42 #define EXPORT_NO_SYMBOLS43 #endif44 30 45 31 #include "i2c.h"
