diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-05-01 23:26:35 +0200 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-05-01 23:26:35 +0200 |
commit | eefcd75e72f382270f8f64e030550b10e3882b2b (patch) | |
tree | ccd55fa7068067ddd6299fe62dc15b22cc3ca46a /Documentation/i2c/porting-clients | |
parent | 35532d20035d04b0ec28508583a56c7a65c5fa47 (diff) | |
download | linux-eefcd75e72f382270f8f64e030550b10e3882b2b.tar.bz2 |
i2c: Documentation update
Make the documentation on how to write and port i2c drivers more in
line with the current state of things:
* i2c-isa is deprecated and soon gone, so stop advertising it.
* Drop many sensors-specific references. Most of them were outdated
anyway.
* Update the example code to reflect the recent and not-so-recent
API and coding style preference changes.
* Simplify the example init and cleanup functions.
This should make things less complex to understand for newcomers.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'Documentation/i2c/porting-clients')
-rw-r--r-- | Documentation/i2c/porting-clients | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index ca272b263a92..7bf82c08f6ca 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients @@ -1,4 +1,4 @@ -Revision 6, 2005-11-20 +Revision 7, 2007-04-19 Jean Delvare <khali@linux-fr.org> Greg KH <greg@kroah.com> @@ -20,6 +20,10 @@ yours for best results. Technical changes: +* [Driver type] Any driver that was relying on i2c-isa has to be + converted to a proper isa, platform or pci driver. This is not + covered by this guide. + * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. Includes typically look like that: #include <linux/module.h> @@ -27,12 +31,10 @@ Technical changes: #include <linux/slab.h> #include <linux/jiffies.h> #include <linux/i2c.h> - #include <linux/i2c-isa.h> /* for ISA drivers */ #include <linux/hwmon.h> /* for hardware monitoring drivers */ #include <linux/hwmon-sysfs.h> #include <linux/hwmon-vid.h> /* if you need VRM support */ #include <linux/err.h> /* for class registration */ - #include <asm/io.h> /* if you have I/O operations */ Please respect this inclusion order. Some extra headers may be required for a given driver (e.g. "lm75.h"). @@ -69,20 +71,16 @@ Technical changes: sensors mailing list <lm-sensors@lm-sensors.org> by providing a patch to the Documentation/hwmon/sysfs-interface file. -* [Attach] For I2C drivers, the attach function should make sure - that the adapter's class has I2C_CLASS_HWMON (or whatever class is - suitable for your driver), using the following construct: +* [Attach] The attach function should make sure that the adapter's + class has I2C_CLASS_HWMON (or whatever class is suitable for your + driver), using the following construct: if (!(adapter->class & I2C_CLASS_HWMON)) return 0; - ISA-only drivers of course don't need this. Call i2c_probe() instead of i2c_detect(). * [Detect] As mentioned earlier, the flags parameter is gone. The type_name and client_name strings are replaced by a single name string, which will be filled with a lowercase, short string. - In i2c-only drivers, drop the i2c_is_isa_adapter check, it's - useless. Same for isa-only drivers, as the test would always be - true. Only hybrid drivers (which are quite rare) still need it. The labels used for error paths are reduced to the number needed. It is advised that the labels are given descriptive names such as exit and exit_free. Don't forget to properly set err before |