提交 f7572da5 编写于 作者: L Linus Torvalds

Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c: Fix bad hint about irqs in i2c.h
  i2c: Documentation: fix device matching description
...@@ -25,12 +25,23 @@ routines, and should be zero-initialized except for fields with data you ...@@ -25,12 +25,23 @@ routines, and should be zero-initialized except for fields with data you
provide. A client structure holds device-specific information like the provide. A client structure holds device-specific information like the
driver model device node, and its I2C address. driver model device node, and its I2C address.
/* iff driver uses driver model ("new style") binding model: */
static struct i2c_device_id foo_idtable[] = {
{ "foo", my_id_for_foo },
{ "bar", my_id_for_bar },
{ }
};
MODULE_DEVICE_TABLE(i2c, foo_idtable);
static struct i2c_driver foo_driver = { static struct i2c_driver foo_driver = {
.driver = { .driver = {
.name = "foo", .name = "foo",
}, },
/* iff driver uses driver model ("new style") binding model: */ /* iff driver uses driver model ("new style") binding model: */
.id_table = foo_ids,
.probe = foo_probe, .probe = foo_probe,
.remove = foo_remove, .remove = foo_remove,
...@@ -173,10 +184,9 @@ handle may be used during foo_probe(). If foo_probe() reports success ...@@ -173,10 +184,9 @@ handle may be used during foo_probe(). If foo_probe() reports success
(zero not a negative status code) it may save the handle and use it until (zero not a negative status code) it may save the handle and use it until
foo_remove() returns. That binding model is used by most Linux drivers. foo_remove() returns. That binding model is used by most Linux drivers.
Drivers match devices when i2c_client.driver_name and the driver name are The probe function is called when an entry in the id_table name field
the same; this approach is used in several other busses that don't have matches the device's name. It is passed the entry that was matched so
device typing support in the hardware. The driver and module name should the driver knows which one in the table matched.
match, so hotplug/coldplug mechanisms will modprobe the driver.
Device Creation (Standard driver model) Device Creation (Standard driver model)
......
...@@ -171,7 +171,7 @@ struct i2c_client { ...@@ -171,7 +171,7 @@ struct i2c_client {
struct i2c_adapter *adapter; /* the adapter we sit on */ struct i2c_adapter *adapter; /* the adapter we sit on */
struct i2c_driver *driver; /* and our access routines */ struct i2c_driver *driver; /* and our access routines */
struct device dev; /* the device structure */ struct device dev; /* the device structure */
int irq; /* irq issued by device (or -1) */ int irq; /* irq issued by device */
struct list_head list; /* DEPRECATED */ struct list_head list; /* DEPRECATED */
struct completion released; struct completion released;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册