aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/i2c/writing-clients
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/i2c/writing-clients')
-rw-r--r--Documentation/i2c/writing-clients20
1 files changed, 6 insertions, 14 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index d19993cc0604..3a057c8e5507 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -25,9 +25,9 @@ routines, a client structure specific information like the actual I2C
25address. 25address.
26 26
27static struct i2c_driver foo_driver = { 27static struct i2c_driver foo_driver = {
28 .owner = THIS_MODULE, 28 .driver = {
29 .name = "Foo version 2.3 driver", 29 .name = "foo",
30 .flags = I2C_DF_NOTIFY, 30 },
31 .attach_adapter = &foo_attach_adapter, 31 .attach_adapter = &foo_attach_adapter,
32 .detach_client = &foo_detach_client, 32 .detach_client = &foo_detach_client,
33 .command = &foo_command /* may be NULL */ 33 .command = &foo_command /* may be NULL */
@@ -36,10 +36,6 @@ static struct i2c_driver foo_driver = {
36The name field must match the driver name, including the case. It must not 36The name field must match the driver name, including the case. It must not
37contain spaces, and may be up to 31 characters long. 37contain spaces, and may be up to 31 characters long.
38 38
39Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This
40means that your driver will be notified when new adapters are found.
41This is almost always what you want.
42
43All other fields are for call-back functions which will be explained 39All other fields are for call-back functions which will be explained
44below. 40below.
45 41
@@ -496,17 +492,13 @@ Note that some functions are marked by `__init', and some data structures
496by `__init_data'. Hose functions and structures can be removed after 492by `__init_data'. Hose functions and structures can be removed after
497kernel booting (or module loading) is completed. 493kernel booting (or module loading) is completed.
498 494
495
499Command function 496Command function
500================ 497================
501 498
502A generic ioctl-like function call back is supported. You will seldom 499A generic ioctl-like function call back is supported. You will seldom
503need this. You may even set it to NULL. 500need this, and its use is deprecated anyway, so newer design should not
504 501use it. Set it to NULL.
505 /* No commands defined */
506 int foo_command(struct i2c_client *client, unsigned int cmd, void *arg)
507 {
508 return 0;
509 }
510 502
511 503
512Sending and receiving 504Sending and receiving