Changeset 5570
- Timestamp:
- 12/15/08 13:45:58 (4 years ago)
- Location:
- i2c/trunk
- Files:
-
- 3 modified
-
CHANGES (modified) (1 diff)
-
kernel/i2c-core.c (modified) (6 diffs)
-
kernel/i2c.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c/trunk/CHANGES
r5377 r5570 12 12 doc/writing-clients: Cleanups (2.6 backport) 13 13 i2c.h: Drop I2C_FUNC_SMBUS_*I2C_BLOCK_2 defines 14 i2c-core: Drop Linux 2.4 incompatibility mode 14 15 15 16 2.10.5 (20071024) -
i2c/trunk/kernel/i2c-core.c
r4245 r5570 36 36 /* ----- global defines ---------------------------------------------------- */ 37 37 38 #if I2C_LINUX_2_4_BINARY_COMPATIBILITY 39 #define I2C_LOCK_LIST(adap) down(&adap->bus) 40 #define I2C_UNLOCK_LIST(adap) up(&adap->bus) 41 #else 42 #define I2C_LOCK_LIST(adap) down(&adap->list) 43 #define I2C_UNLOCK_LIST(adap) up(&adap->list) 44 #endif 38 #define I2C_LOCK_LIST(adap) down(&adap->lock) 39 #define I2C_UNLOCK_LIST(adap) up(&adap->lock) 45 40 46 41 #define DEB(x) if (i2c_debug>=1) x; … … 114 109 115 110 /* init data types */ 116 init_MUTEX(&adap->bus); 117 #if !I2C_LINUX_2_4_BINARY_COMPATIBILITY 118 init_MUTEX(&adap->list); 119 #endif 111 init_MUTEX(&adap->lock); 120 112 121 113 /* inform drivers of new adapters */ … … 701 693 } 702 694 703 down(&adap-> bus);695 down(&adap->lock); 704 696 ret = adap->algo->master_xfer(adap,msgs,num); 705 up(&adap-> bus);697 up(&adap->lock); 706 698 707 699 return ret; … … 728 720 count,client->adapter->name)); 729 721 730 down(&adap-> bus);722 down(&adap->lock); 731 723 ret = adap->algo->master_xfer(adap,&msg,1); 732 up(&adap-> bus);724 up(&adap->lock); 733 725 734 726 /* if everything went ok (i.e. 1 msg transmitted), return #bytes … … 758 750 count,client->adapter->name)); 759 751 760 down(&adap-> bus);752 down(&adap->lock); 761 753 ret = adap->algo->master_xfer(adap,&msg,1); 762 up(&adap-> bus);754 up(&adap->lock); 763 755 764 756 DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n", … … 1355 1347 1356 1348 if (adapter->algo->smbus_xfer) { 1357 down(&adapter-> bus);1349 down(&adapter->lock); 1358 1350 res = adapter->algo->smbus_xfer(adapter,addr,flags,read_write, 1359 1351 command,size,data); 1360 up(&adapter-> bus);1352 up(&adapter->lock); 1361 1353 } else 1362 1354 res = i2c_smbus_xfer_emulated(adapter,addr,flags,read_write, -
i2c/trunk/kernel/i2c.h
r5363 r5570 31 31 #define I2C_DATE "SVN" 32 32 #define I2C_VERSION "2.10.5-SVN" 33 34 /* You can set this to 0 if you patch i2c into your kernel tree35 and have no i2c module that have been compiled using a36 Linux-2.4-compatible i2c.h header file left.37 As a result, you'll get a different code (can't really38 say whether it's any better, but it's different). */39 #define I2C_LINUX_2_4_BINARY_COMPATIBILITY 140 33 41 34 #include <linux/module.h> … … 239 232 240 233 /* data fields that are valid for all devices */ 241 struct semaphore bus; 242 #if !I2C_LINUX_2_4_BINARY_COMPATIBILITY 243 struct semaphore list; 244 #endif 234 struct semaphore lock; 245 235 unsigned int flags;/* flags specifying div. data */ 246 236 247 237 struct i2c_client *clients[I2C_CLIENT_MAX]; 248 #if I2C_LINUX_2_4_BINARY_COMPATIBILITY 249 int client_count; /* not used anywhere */ 250 #endif 238 int client_count; /* not used anywhere, kept for binary compat. */ 251 239 252 240 int timeout;
