X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fi2c.h;fp=include%2Flinux%2Fi2c.h;h=63f1d63cc1d8cd93154d0874421e2b509c08ddfa;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=eb0628a7ecc637ec71e18714105ac814f679f718;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eb0628a7e..63f1d63cc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -20,20 +20,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ------------------------------------------------------------------------- */ -/* With some changes from Kyösti Mälkki and +/* With some changes from Kyösti Mälkki and Frodo Looijaard */ #ifndef _LINUX_I2C_H #define _LINUX_I2C_H -#include -#ifdef __KERNEL__ #include +#include #include #include #include /* for struct device */ #include /* for completion */ -#include +#include /* --- For i2c-isa ---------------------------------------------------- */ @@ -97,13 +96,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client, u8 command, u16 value); extern s32 i2c_smbus_write_block_data(struct i2c_client * client, u8 command, u8 length, - const u8 *values); + u8 *values); /* Returns the number of read bytes */ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, u8 command, u8 *values); extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, u8 command, u8 length, - const u8 *values); + u8 *values); /* * A driver is capable of handling one or more physical devices present on @@ -193,8 +192,6 @@ struct i2c_algorithm { to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */ - /* master_xfer should return the number of messages successfully - processed, or a negative value on error */ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, int num); int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, @@ -228,8 +225,8 @@ struct i2c_adapter { int (*client_unregister)(struct i2c_client *); /* data fields that are valid for all devices */ - struct mutex bus_lock; - struct mutex clist_lock; + struct semaphore bus_lock; + struct semaphore clist_lock; int timeout; int retries; @@ -357,7 +354,6 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) { return adap->nr; } -#endif /* __KERNEL__ */ /* * I2C Message - used for pure i2c transaction, also from /dev interface @@ -473,7 +469,6 @@ union i2c_smbus_data { #define I2C_SMBUS 0x0720 /* SMBus-level access */ /* ----- I2C-DEV: char device interface stuff ------------------------- */ -#ifdef __KERNEL__ #define I2C_MAJOR 89 /* Device major number */ @@ -651,5 +646,5 @@ static unsigned short *forces[] = { force, force_##chip1, \ force_##chip6, force_##chip7, \ force_##chip8, NULL }; \ I2C_CLIENT_INSMOD_COMMON -#endif /* __KERNEL__ */ + #endif /* _LINUX_I2C_H */