[PATCH 2.4] Update Documentation/i2c/writing-clients

From: Jean Delvare (khali_at_linux-fr.org)
Date: 09/14/04

  • Next message: Alan Cox: "Re: I2O Updates + Questions"
    Date:	Tue, 14 Sep 2004 22:22:34 +0200
    To: marcelo.tosatti@cyclades.com
    
    

    Hi Marcelo,

    This is a quick update to the Documentation/i2c/writing-clients file. A
    similar change was accepted by Greg KH in 2.6 and was also applied to
    the i2c CVS repository.

    The changes are about i2c client driver IDs. It used to say that chip
    driver writers should ask for a unique ID. It now explains that such an
    ID is not required and they can go without it. The patch additionally
    features CodingStyle updates.

    Fell free to apply it if you want,
    thanks.

    Signed-off-by: Jean Delvare <khali@linux-fr.org>

    --- linux-2.4.28-pre3/Documentation/i2c/writing-clients.orig 2004-09-14 21:46:41.000000000 +0200
    +++ linux-2.4.28-pre3/Documentation/i2c/writing-clients 2004-09-14 22:15:14.000000000 +0200
    @@ -24,24 +24,25 @@
     routines, a client structure specific information like the actual I2C
     address.
     
    - struct i2c_driver foo_driver
    - {
    - /* name */ "Foo version 2.3 and later driver",
    - /* id */ I2C_DRIVERID_FOO,
    - /* flags */ I2C_DF_NOTIFY,
    - /* attach_adapter */ &foo_attach_adapter,
    - /* detach_client */ &foo_detach_client,
    - /* command */ &foo_command, /* May be NULL */
    - /* inc_use */ &foo_inc_use, /* May be NULL */
    - /* dec_use */ &foo_dec_use /* May be NULL */
    - }
    +static struct i2c_driver foo_driver = {
    + .name = "Foo version 2.3 driver",
    + .id = I2C_DRIVERID_FOO, /* from i2c-id.h, optional */
    + .flags = I2C_DF_NOTIFY,
    + .attach_adapter = &foo_attach_adapter,
    + .detach_client = &foo_detach_client,
    + .command = &foo_command, /* may be NULL */
    + .inc_use = &foo_inc_use, /* May be NULL */
    + .dec_use = &foo_dec_use, /* May be NULL */
    +}
      
     The name can be chosen freely, and may be upto 40 characters long. Please
     use something descriptive here.
     
    -The id should be a unique ID. The range 0xf000 to 0xffff is reserved for
    -local use, and you can use one of those until you start distributing the
    -driver. Before you do that, contact the i2c authors to get your own ID(s).
    +If used, the id should be a unique ID. The range 0xf000 to 0xffff is
    +reserved for local use, and you can use one of those until you start
    +distributing the driver, at which time you should contact the i2c authors
    +to get your own ID(s). Note that most of the time you don't need an ID
    +at all so you can just omit it.
     
     Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This
     means that your driver will be notified when new adapters are found.

    -- 
    Jean "Khali" Delvare
    http://khali.linux-fr.org/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Alan Cox: "Re: I2O Updates + Questions"

    Relevant Pages

    • Re: My thoughts on the "new development model"
      ... |>>> 2.6 tree is great for gentoo users who like gcc consuming all CPU ... |>> that after a month or so of fixes etc it will be a very stable kernel ... driver for 2.6.7 for an ADSL card; a development driver for 2.6.5 for a ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: sata related hang with linux-2.6
      ... IMHO there's something not quite right with the Silicon Image libata ... Perhaps the driver is enabling the hardware to generate interrupts ... before setting up the interrupt routine for it? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: SL811 problem on mach-pxa
      ... It was tested with _both_ workarounds for IRQ issues; ... unlike the predecessors to this driver). ... I've had reports that one of the ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.7 (future kernel) wish
      ... > I've never seen one give a STOP error from that but I guess a bad driver ... I would like to see the HAL type crap for Linux. ... to have uniform user device control from a gui programmable means. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [RFC] removal of legacy cdrom drivers (Re: [PATCH] mcdx.c insanity removal)
      ... bar and baz and fairly long expressions. ... if we want to keep the FPOS in the tree. ... Driver is obviously ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)