]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/i2c.h
i2c: Let framebuffer drivers set their I2C bus class to DDC
[linux-2.6-omap-h63xx.git] / include / linux / i2c.h
index 365e0df3646baf525d94aaec7899fa93a8f2a05c..145797fe6a310b128f42396619264638f131c71e 100644 (file)
@@ -69,9 +69,8 @@ extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
                            union i2c_smbus_data * data);
 
 /* Now follow the 'nice' access routines. These also document the calling
-   conventions of smbus_access. */
+   conventions of i2c_smbus_xfer. */
 
-extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
 extern s32 i2c_smbus_read_byte(struct i2c_client * client);
 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
@@ -126,7 +125,7 @@ struct i2c_driver {
         * With the driver model, device enumeration is NEVER done by drivers;
         * it's done by infrastructure.  (NEW STYLE DRIVERS ONLY)
         */
-       int (*probe)(struct i2c_client *);
+       int (*probe)(struct i2c_client *, const struct i2c_device_id *);
        int (*remove)(struct i2c_client *);
 
        /* driver model interfaces that don't relate to enumeration  */
@@ -140,11 +139,10 @@ struct i2c_driver {
        int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
 
        struct device_driver driver;
+       const struct i2c_device_id *id_table;
 };
 #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
 
-#define I2C_NAME_SIZE  20
-
 /**
  * struct i2c_client - represent an I2C slave device
  * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
@@ -156,8 +154,6 @@ struct i2c_driver {
  * @driver: device's driver, hence pointer to access routines
  * @dev: Driver model device node for the slave.
  * @irq: indicates the IRQ generated by this device (if any)
- * @driver_name: Identifies new-style driver used with this device; also
- *     used as the module name for hotplug/coldplug modprobe support.
  * @list: list of active/busy clients (DEPRECATED)
  * @released: used to synchronize client releases & detaches and references
  *
@@ -174,8 +170,7 @@ struct i2c_client {
        struct i2c_adapter *adapter;    /* the adapter we sit on        */
        struct i2c_driver *driver;      /* and our access routines      */
        struct device dev;              /* the device structure         */
-       int irq;                        /* irq issued by device (or -1) */
-       char driver_name[KOBJ_NAME_LEN];
+       int irq;                        /* irq issued by device         */
        struct list_head list;          /* DEPRECATED */
        struct completion released;
 };
@@ -201,8 +196,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
 
 /**
  * struct i2c_board_info - template for device creation
- * @driver_name: identifies the driver to be bound to the device
- * @type: optional chip type information, to initialize i2c_client.name
+ * @type: chip type, to initialize i2c_client.name
  * @flags: to initialize i2c_client.flags
  * @addr: stored in i2c_client.addr
  * @platform_data: stored in i2c_client.dev.platform_data
@@ -221,7 +215,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
  * with the adapter already known.
  */
 struct i2c_board_info {
-       char            driver_name[KOBJ_NAME_LEN];
        char            type[I2C_NAME_SIZE];
        unsigned short  flags;
        unsigned short  addr;
@@ -230,17 +223,17 @@ struct i2c_board_info {
 };
 
 /**
- * I2C_BOARD_INFO - macro used to list an i2c device and its driver
- * @driver: identifies the driver to use with the device
+ * I2C_BOARD_INFO - macro used to list an i2c device and its address
+ * @dev_type: identifies the device type
  * @dev_addr: the device's address on the bus.
  *
  * This macro initializes essential fields of a struct i2c_board_info,
  * declaring what has been provided on a particular board.  Optional
- * fields (such as the chip type, its associated irq, or device-specific
- * platform_data) are provided using conventional syntax.
+ * fields (such as associated irq, or device-specific platform_data)
+ * are provided using conventional syntax.
  */
-#define I2C_BOARD_INFO(driver,dev_addr) \
-       .driver_name = (driver), .addr = (dev_addr)
+#define I2C_BOARD_INFO(dev_type,dev_addr) \
+       .type = (dev_type), .addr = (dev_addr)
 
 
 /* Add-on boards should register/unregister their devices; e.g. a board
@@ -263,7 +256,7 @@ i2c_new_probed_device(struct i2c_adapter *adap,
  * client handles for the extra addresses.
  */
 extern struct i2c_client *
-i2c_new_dummy(struct i2c_adapter *adap, u16 address, const char *type);
+i2c_new_dummy(struct i2c_adapter *adap, u16 address);
 
 extern void i2c_unregister_device(struct i2c_client *);
 
@@ -356,7 +349,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
 #define I2C_CLASS_HWMON                (1<<0)  /* lm_sensors, ... */
 #define I2C_CLASS_TV_ANALOG    (1<<1)  /* bttv + friends */
 #define I2C_CLASS_TV_DIGITAL   (1<<2)  /* dvb cards */
-#define I2C_CLASS_DDC          (1<<3)  /* i2c-matroxfb ? */
+#define I2C_CLASS_DDC          (1<<3)  /* DDC bus on graphics adapters */
 #define I2C_CLASS_CAM_ANALOG   (1<<4)  /* camera with analog CCD */
 #define I2C_CLASS_CAM_DIGITAL  (1<<5)  /* most webcams */
 #define I2C_CLASS_SOUND                (1<<6)  /* sound devices */
@@ -543,7 +536,7 @@ union i2c_smbus_data {
                               /* and one more for user-space compatibility */
 };
 
-/* smbus_access read or write markers */
+/* i2c_smbus_xfer read or write markers */
 #define I2C_SMBUS_READ 1
 #define I2C_SMBUS_WRITE        0