]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/i2c.h
Manual merge with Linus.
[linux-2.6-omap-h63xx.git] / include / linux / i2c.h
index a9cea62fd486af8cac138bdb9b455af75255e98d..1635ee25918fc19ea613d1e8dbcb672075220efb 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/device.h>      /* for struct device */
 #include <linux/sched.h>       /* for completion */
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 
 /* --- For i2c-isa ---------------------------------------------------- */
 
@@ -100,16 +100,20 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
 /* 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,
+                                         u8 *values);
 
 /*
  * A driver is capable of handling one or more physical devices present on
  * I2C adapters. This information is used to inform the driver of adapter
  * events.
+ *
+ * The driver.owner field should be set to the module owner of this driver.
+ * The driver.name field should be set to the name of this driver.
  */
 
 struct i2c_driver {
-       struct module *owner;
-       char name[32];
        int id;
        unsigned int class;
 
@@ -221,8 +225,8 @@ struct i2c_adapter {
        int (*client_unregister)(struct i2c_client *);
 
        /* data fields that are valid for all devices   */
-       struct semaphore bus_lock;
-       struct semaphore clist_lock;
+       struct mutex bus_lock;
+       struct mutex clist_lock;
 
        int timeout;
        int retries;
@@ -290,9 +294,14 @@ struct i2c_client_address_data {
 extern int i2c_add_adapter(struct i2c_adapter *);
 extern int i2c_del_adapter(struct i2c_adapter *);
 
-extern int i2c_add_driver(struct i2c_driver *);
+extern int i2c_register_driver(struct module *, struct i2c_driver *);
 extern int i2c_del_driver(struct i2c_driver *);
 
+static inline int i2c_add_driver(struct i2c_driver *driver)
+{
+       return i2c_register_driver(THIS_MODULE, driver);
+}
+
 extern int i2c_attach_client(struct i2c_client *);
 extern int i2c_detach_client(struct i2c_client *);