Changeset 3765 for i2c/trunk/kernel/i2c.h
- Timestamp:
- 01/21/03 09:08:16 (10 years ago)
- Files:
-
- 1 modified
-
i2c/trunk/kernel/i2c.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c/trunk/kernel/i2c.h
r3758 r3765 32 32 #define I2C_VERSION "2.7.0" 33 33 34 #include "i2c-id.h" /* id values of adapters et. al. */34 #include <linux/module.h> 35 35 #include <linux/types.h> 36 37 38 struct i2c_msg; 39 40 41 #ifdef __KERNEL__ 42 43 #include <linux/config.h> 36 #include "i2c-id.h" 44 37 #include <asm/semaphore.h> 45 46 38 47 39 /* --- General options ------------------------------------------------ */ … … 53 45 #define I2C_DUMMY_MAX 4 54 46 47 struct i2c_msg; 55 48 struct i2c_algorithm; 56 49 struct i2c_adapter; … … 59 52 struct i2c_client_address_data; 60 53 union i2c_smbus_data; 61 62 54 63 55 /* … … 183 175 */ 184 176 struct i2c_algorithm { 177 struct module *owner; /* future use --km */ 185 178 char name[32]; /* textual description */ 186 179 unsigned int id; … … 207 200 }; 208 201 209 210 202 /* 211 203 * i2c_adapter is the structure used to identify a physical i2c bus along … … 230 222 231 223 /* data fields that are valid for all devices */ 232 struct semaphore lock; 224 struct semaphore bus; 225 struct semaphore list; 233 226 unsigned int flags;/* flags specifying div. data */ 234 227 235 228 struct i2c_client *clients[I2C_CLIENT_MAX]; 236 int client_count;237 229 238 230 int timeout; … … 327 319 i2c_client_found_addr_proc *found_proc); 328 320 321 static inline int i2c_client_command(struct i2c_client *client, 322 unsigned int cmd, void *arg) 323 { 324 if (client->driver && client->driver->command) 325 return client->driver->command(client, cmd, arg); 326 else 327 return -EINVAL; 328 } 329 329 330 /* An ioctl like call to set div. parameters of the adapter. 330 331 */ … … 343 344 /* Return 1 if adapter supports everything we need, 0 if not. */ 344 345 extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); 345 346 #endif /* __KERNEL__ */347 346 348 347 /* … … 497 496 #define I2C_MAJOR 89 /* Device major number */ 498 497 499 #ifdef __KERNEL__500 501 # ifndef NULL502 # define NULL ( (void *) 0 )503 # endif504 505 # ifndef ENODEV506 # include <asm/errno.h>507 # endif508 509 498 /* These defines are used for probing i2c client addresses */ 510 499 /* Default fill of many variables */ … … 568 557 ((adapptr)->algo->id == I2C_ALGO_ISA) 569 558 570 #endif /* def __KERNEL__ */571 559 #endif /* _LINUX_I2C_H */
