Changeset 3920

Show
Ignore:
Timestamp:
09/13/04 22:23:47 (4 years ago)
Author:
khali
Message:

Update section about client driver ID.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • i2c/trunk/doc/writing-clients

    r3828 r3920  
    2525address. 
    2626 
    27   static struct i2c_driver foo_driver = { 
    28     .owner          = THIS_MODULE, 
    29     .name           = "Foo version 2.3 driver", 
    30     .id             = I2C_DRIVERID_FOO, /* usually from i2c-id.h */ 
    31     .flags          = I2C_DF_NOTIFY, 
    32     .attach_adapter = &foo_attach_adapter, 
    33     .detach_client  = &foo_detach_client, 
    34     .command        = &foo_command /* may be NULL */ 
    35  
     27static struct i2c_driver foo_driver = { 
     28       .owner          = THIS_MODULE, 
     29       .name           = "Foo version 2.3 driver", 
     30       .id             = I2C_DRIVERID_FOO, /* from i2c-id.h, optional */ 
     31       .flags          = I2C_DF_NOTIFY, 
     32       .attach_adapter = &foo_attach_adapter, 
     33       .detach_client  = &foo_detach_client, 
     34       .command        = &foo_command /* may be NULL */ 
     35
    3636  
    3737The name can be chosen freely, and may be upto 40 characters long. Please 
    3838use something descriptive here. 
    3939 
    40 The id should be a unique ID. The range 0xf000 to 0xffff is reserved for 
    41 local use, and you can use one of those until you start distributing the 
    42 driver. Before you do that, contact the i2c authors to get your own ID(s). 
     40If used, the id should be a unique ID. The range 0xf000 to 0xffff is 
     41reserved for local use, and you can use one of those until you start 
     42distributing the driver, at which time you should contact the i2c authors 
     43to get your own ID(s). Note that most of the time you don't need an ID 
     44at all so you can just omit it. 
    4345 
    4446Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This