aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-06-25 05:37:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-07-11 17:10:37 -0400
commit1d772e2587da3c8b0fb8610fcc1c91fd82f87e52 (patch)
tree816702c0b2b1a37f772b8884ce2177b88af4ab73 /Documentation/i2c
parenta68e2f4895070f3a449bfe5ae1174b73cc900642 (diff)
[PATCH] I2C: Clarify the usage of i2c-dev.h
Upon suggestion by Nils Roeder, here is an update to the i2c documentation to clarify which header files user-space applications relying on the i2c-dev interface should include. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/i2c')
-rw-r--r--Documentation/i2c/dev-interface11
1 files changed, 7 insertions, 4 deletions
diff --git a/Documentation/i2c/dev-interface b/Documentation/i2c/dev-interface
index a78ea62506ee..b849ad636583 100644
--- a/Documentation/i2c/dev-interface
+++ b/Documentation/i2c/dev-interface
@@ -14,9 +14,12 @@ C example
14========= 14=========
15 15
16So let's say you want to access an i2c adapter from a C program. The 16So let's say you want to access an i2c adapter from a C program. The
17first thing to do is `#include <linux/i2c.h>" and "#include <linux/i2c-dev.h>. 17first thing to do is "#include <linux/i2c-dev.h>". Please note that
18Yes, I know, you should never include kernel header files, but until glibc 18there are two files named "i2c-dev.h" out there, one is distributed
19knows about i2c, there is not much choice. 19with the Linux kernel and is meant to be included from kernel
20driver code, the other one is distributed with lm_sensors and is
21meant to be included from user-space programs. You obviously want
22the second one here.
20 23
21Now, you have to decide which adapter you want to access. You should 24Now, you have to decide which adapter you want to access. You should
22inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned 25inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned
@@ -78,7 +81,7 @@ Full interface description
78========================== 81==========================
79 82
80The following IOCTLs are defined and fully supported 83The following IOCTLs are defined and fully supported
81(see also i2c-dev.h and i2c.h): 84(see also i2c-dev.h):
82 85
83ioctl(file,I2C_SLAVE,long addr) 86ioctl(file,I2C_SLAVE,long addr)
84 Change slave address. The address is passed in the 7 lower bits of the 87 Change slave address. The address is passed in the 7 lower bits of the